- Edit / etc / sysconfig / network-script / ifcfg-enss33 add
#首先将IPV6相关协议都注释;
BOOTPROTO=static #开机协议,有dhcp(默认,动态分配IP)及static(静态地址, 即自定义)
ONBOOT=yes #设置为开机启动;确定ONBOOT=yes,否则不能联网
DNS1=223.5.5.5 #这个是阿里巴巴的DNS地址,还可以使用114 DNS等等
IPADDR=192.168.1.2 #你想要设置的固定IP,取值192.168.1.2-255
NETMASK=255.255.255.0 #子网掩码,不需要修改;
GATEWAY=192.168.1.1 #网关
Network Service Restart
service network restart
Edit /etc/resolve.cnf, the # comment out the contents with increased nameserver 192.168.1.1 (gateway)
Restart the network service network restart