# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:D5:42:F9
TYPE=Ethernet
UUID=89550ac1-dbf8-463c-b52e-36e164274bff
ONBOOT=yes
NM_CONTROLLED=yes
#BOOTPROTO=dhcp
BOOTPROTO=static
IPADDR=192.168.12.126 --所要设置的ip
NETMASK=255.255.255.0
IPV6INIT=no
DNS1=8.8.8.8
添加宿主机主机网关
# vim /etc/sysconfig/network
GATEWAY=192.168.12.1
# service network restart
所有评论(0)