CentOS 6.5、6.7 設定靜態 ip 教程

來源:互聯網
上載者:User

標籤: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 教程

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.