- cd /etc/sysconfig/network-scripts/
- vi ifcfg-网卡名称
BOOTPROTO=static
IPADDR=192.168.1.149
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=114.114.114.114
DNS2=8.8.8.8
- 重启网卡:service network restart
BOOTPROTO=static
IPADDR=192.168.1.149
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=114.114.114.114
DNS2=8.8.8.8