1. Open the Command window and switch to the root account: Su-root
2. Enter directory:/etc/sysconfig/network-scripts, open File VI ifcfg-eth0
3. Modify the Parameters:
# # NAME device=eth0# The physical address of the network card hwaddr=00:0c:29:6a:91:5atype=ethernet# bootproto=dbcp get the IP is automatically obtained, static is fixed IP, None is a manual bootproto=static# configured IP address ipaddr=192.168.40.126# configuration dns1dns1=192.168.40.2# Configure the Gateway gateway=192.168.40.2netmask= 255.255.255.0nm_controlled=no# the network interface is active at startup Onboot=yesnm_controlled=yes
4.:x exit Edit, restart service network start so it's ready.
5. Additional Instructions:
The Bootproto needs to be configured statically, or the system will fail to restart
Configure DNS1 and gateways yourself, DNS corresponds to DNS on the physical machine or VMnet8 corresponding gateways
Configuration of the CentOS IP