CentOS 6.5、6.7 设置静态 ip 教程
2016-12-11 13:46
573 查看
CentOS 6.5、6.7 设置静态 ip 教程,可以ping通外网:www.baidu.com
①. 网络适配器(VMware Network Adapter) 选择NAT模式
②. 设置静态 ip
vim /etc/sysconfig/network-scripts/ifcfg-eth0
③. vi /etc/sysconfig/network
④. 重启服务
⑤. 验证
完成!
①. 网络适配器(VMware Network Adapter) 选择NAT模式
②. 设置静态 ip
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 #描述网卡对应的设备别名 BOOTPROTO=static #设置网卡获得 ip 的方式,选项:static【静态指定】、dhcp【协议】、bootp【协议】 HWADDR=00:0c:29:24:e2:1b IPV6INIT=no NM_CONTROLLED=no ONBOOT=yes TYPE=Ethernet UUID="e6ecacb0-4608-47f9-b56c-49c5d2f61e2a" IPADDR=192.168.178.131 #设置自己喜欢的ip地址,保持在同一个网段 NETMASK=255.255.255.0 #网卡对应的网络掩码 GATEWAY=192.168.178.2 #保持在同一网段,末尾设置为2 DNS1=192.168.178.2 #DNS1服务器的地址,保持在同一网段,末尾设置为2 USERCTL=no
③. vi /etc/sysconfig/network
NETWORKING=yes #确认是否设置为yes
④. 重启服务
service network restart
⑤. 验证
[root@localhost ~]# ip addr 1: 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 forever 2: 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 [root@localhost ~]# ping www.baidu.com PING 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 ms 64 bytes from www.baidu.com (115.239.211.112): icmp_seq=2 ttl=128 time=8.32 ms 64 bytes from www.baidu.com (115.239.211.112): icmp_seq=3 ttl=128 time=8.09 ms
完成!
相关文章推荐
- centos6.7静态ip设置---2
- CentOS6.5中的网络配置(静态IP设置)
- centos6.5/7.1-server 设置静态IP
- CentOS 6.5静态IP的设置
- CentOS7 mini的安装和静态ip设置教程
- centos 6.5 设置静态ip
- CentOS 6.5静态IP的设置(NAT和桥接都适用)
- Centos6.5设置静态IP
- centos6.5配置静态IP 时,出现BCAST不能设置的问题
- VWMare CentOS 6.5 静态IP设置
- centos6.5静态IP和DNS设置
- centos6.5静态IP和DNS设置
- linux 静态ip设置教程
- VMware中CentOS设置静态IP
- Linux VMWare虚拟机设置静态IP并且能上网的设置方法(以CentOS为例)
- Centos 7 学习之静态IP设置
- VMWare中CentOS静态设置IP
- VMware中CentOS设置静态IP
- VMWare中CentOS 静态IP设置
- centOS配置静态IP,设置网卡的名字