CentOS 6.5, 6.7 set static IP tutorial, you can ping the extranet: www.baidu.com
①. Networking Adapter (VMware network Adapter) Select NAT Mode
②. Setting up a static IP
Device=eth0 #描述网卡对应的设备别名BOOTPROTO =static #设置网卡获得 IP, options: Static specified, DHCP protocol, Boo TP "Protocol" hwaddr=00:0c:29:24: E2:1bipv6init=nonm_controlled=Noonboot=Yestype=Ethernetuuid="E6ECACB0-4608-47F9-B56C-49C5D2F61E2A" ipaddr=192.168. 178.131 #设置自己喜欢的ip地址, stay on the same network segment NETMASK=255.255.255.0 #网卡对应的网络掩码gateway=192.168.178.2 #保持在同一网段, set to 2dns1=192.168.178.2 #DNS1服务器的地址 at the end, remain in the same segment, and at the end set to 2Userctl=no
③. vi/etc/sysconfig/network
Networking=yes #确认是否设置为yes
④. Restart Service
Service Network restart
⑤. Validation
[[Email protected] ~]# IP addr 1: Lo: <LOOPBACK,UP,LOWER_UP> MTU65536qdisc noqueue State UNKNOWN Link/loopbackxx:xx:xx:xx:xx:xxBrdxx:xx:xx:xx:xx:xxinet127.0.0.1/8Scope host lo inet6::1/ -Scope host Valid_lft forever Preferred_lft forever2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU theQdisc Pfifo_fast State up Qlen +Link/etherxx: 0c: in: 6e: the: -BRD ff:ff:ff:ff:ff:ff inet192.168.178.132/ -Brd192.168.178.255ScopeGlobaleth0 inet6 fe80::20c:29ff:fe6e:4933/ -scope link Valid_lft forever Preferred_lft forever
[[Email protected]~]# Ping www.baidu.comping www.a.shifen.com (115.239.211.112) About( -) bytes of data. -bytes fromWww.baidu.com (115.239.211.112): icmp_seq=1Ttl= -Time=7.45Ms -bytes fromWww.baidu.com (115.239.211.112): icmp_seq=2Ttl= -Time=8.32Ms -bytes fromWww.baidu.com (115.239.211.112): icmp_seq=3Ttl= -Time=8.09Ms
done!
CentOS 6.5, 6.7 set static IP tutorial