Confirm Current Network configuration:
[Email protected] ~]# nmcli-p Dev===================== Status of Devices===================== DEVICE TYPE State CONNECTION------------------------------------------------------------------virbr0 Bridge connected virbr0 eth0 Ethernet connected eth0 lo loopback unmanaged
To set the IP file, modify the following:
##Configure eth0# # vi/etc/sysconfig/network-scripts/ifcfg-eth0hwaddr=00:0c:29:10: A0:dbmacaddr=00:0c:29:10: A0:dbTYPE=Ethernetproxy_method=nonebrowser_only=No# Static IP Address #Bootproto=staticipaddr=192.168.1.249PREFIX=24# Default Gateway IP #GATEWAY=192.168.1.1# DNS Servers #DNS1=118.118.118.1Defroute=Yespeerdns=No# Disable IPv6 #Ipv4_failure_fatal=Noipv6init=NoNAME=Eth0uuid=2734ae8a-4190-4cb9-9b32-4404dfc83e29# Activate on Boot#Onboot=Yes##Configure Default Gateway# # vi/etc/sysconfig/networknetworking=Yeshostname=Centos6gateway=192.168.1.1##Restart Network Interface#/etc/init.d/Network Restart##Configure DNS Server# # Vi/etc/resolv.Confnameserver118.118.118.1 #ReplaceWith your nameserver ipnameserver192.168.1.1 #ReplaceWith your nameserver IP
Open the console and modify the command as follows:
sudo ifconfig eth0 192.168.1.251 netmask 255.255.255.0192.168.1.1echo "nameserver 118.118.118.1 ">/etc/resolv. echo "NameServer 192.168.1.1" >/etc/resolv.conf
To turn off the firewall and restart the network link:
systemctl Stop firewalldsystemctl disable FIREWALLD/etc/init.d/network restart
To view the current IP through the ifconfig command, if not reflected, you can restart the network link via the Setup screen:
Linux environment set IP and firewall off