轉載自:http://www.nidify.com/index.php?option=com_content&view=article&id=211&Itemid=229
CentOS 6的網路確實有些問題,GUI介面下抓不到網路設備,如果要修改網路設定只能使用ifconfig指令.
#設定ip及mask
[root@proxy-new ~]#ifconfig eth1 60.251.215.180
[root@proxy-new ~]# ifconfig eth1 netmask 255.255.255.240
#設定Gateway:
[root@proxy-new ~]# route del default
[root@proxy-new ~]# route add default gw 59.120.22.254
#設定 DNS 只要編輯 /etc/resolv.conf 即可
search nidify.com
nameserver 163.14.192.1 #第一個 nameserver (primary DNS)
nameserver 168.14.1.1 #第二個 nameserver (secondary DNS)
啟動 eth1
[root@proxy-new ~]#ifconfig eth1 up
又!!CentOS 6 預設網卡開機時不會自動啟動,需修改ifcfg-eth1 將onboot=no 改成yes (or eth0)
[root@proxy-new ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
EVICE=eth1
NM_CONTROLLED=yes
ONBOOT=yes
HWADDR=00:0c:6e:14:fa:b1
TYPE=Ethernet
BOOTPROTO=none
IPADDR=60.251.215.180
PREFIX=28
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth1
UUID=9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04
NETMASK=255.255.255.240
USERCTL=no
DEVICE=eth1