標籤:art inet6 back eve 方式 stat fast res static
CentOS 6.5、6.7 設定靜態 ip 教程,可以ping通外網:www.baidu.com
①. 網路介面卡(VMware Network Adapter) 選擇NAT模式
②. 設定靜態 ip
DEVICE=eth0 #描述網卡對應的裝置別名BOOTPROTO=static #設定網卡獲得 ip 的方式,選項:static【靜態指定】、dhcp【協議】、bootp【協議】HWADDR=00:0c:29:24:e2:1bIPV6INIT=noNM_CONTROLLED=noONBOOT=yesTYPE=EthernetUUID="e6ecacb0-4608-47f9-b56c-49c5d2f61e2a"IPADDR=192.168.178.131 #設定自己喜歡的ip地址,保持在同一個網段NETMASK=255.255.255.0 #網卡對應的網路遮罩GATEWAY=192.168.178.2 #保持在同一網段,末尾設定為2DNS1=192.168.178.2 #DNS1伺服器的地址,保持在同一網段,末尾設定為2USERCTL=no
③. vi /etc/sysconfig/network
NETWORKING=yes #確認是否設定為yes
④. 重啟服務
service network restart
⑤. 驗證
[[email protected] ~]# ip addr1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:6e:49:33 brd ff:ff:ff:ff:ff:ff inet 192.168.178.132/24 brd 192.168.178.255 scope global eth0 inet6 fe80::20c:29ff:fe6e:4933/64 scope link valid_lft forever preferred_lft forever
[[email protected] ~]# ping www.baidu.comPING www.a.shifen.com (115.239.211.112) 56(84) bytes of data.64 bytes from www.baidu.com (115.239.211.112): icmp_seq=1 ttl=128 time=7.45 ms64 bytes from www.baidu.com (115.239.211.112): icmp_seq=2 ttl=128 time=8.32 ms64 bytes from www.baidu.com (115.239.211.112): icmp_seq=3 ttl=128 time=8.09 ms
完成!
CentOS 6.5、6.7 設定靜態 ip 教程