一、设置静态IP
sudo vim /etc/network/interfaces
修改如下部分:(CentOS 6.5)
auto eth0
iface eth0 inet static
address 192.168.0.117
gateway 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
(CentOS 6.8)
DEVICE=eth0
HWADDR=00:0C:29:D2:68:67
TYPE=Ethernet
UUID=70407ef5-a9ef-4554-80a9-cf2ec27439cf
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
IPADDR=192.168.18.233
NETMASK=255.255.254.0
GATEWAY=192.168.18.1
DNS1=202.96.134.133
2、设置永久dns
vi /etc/resolvconf/resolv.conf.d/base
202.96.134.133 (当地DNS服务器)