#设置开机启动和静态地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 HWADDR=D8:50:E6:56:3F:CF TYPE=Ethernet UUID=47bdf2d3-0132-4481-8475-28bd0e8e456b ONBOOT=yes #此处改为yes NM_CONTROLLED=yes BOOTPROTO=static #此处改为static IPADDR=192.168.1.234 #此处新增静态IP地址 NETMASK=255.255.255.0 #此处新增子网掩码
#修改网关地址
vi /etc/sysconfig/network
NETWORKING=YES HOSTNAME=localhost.localdomain GATEWAY=192.168.1.1 #新增网关地址
#修改DNS地址
vi /etc/resolv.conf
nameserver 192.168.1.1
#退出重新网络服务
service network restart
end