赞
踩
续上一篇文章: Hadoop集群搭建-NAT/桥接网络配置-基于CentOS7-【连载中】
虚拟机输入:ip a
或ifconfig
若ifconfig
报错,请参考此篇文章:
3.2 Hadoop集群搭建-Linux中“ifconfig”命令报错问题解决方案-基于CentOS7-【连载中】
[root@master network-scripts]# ip a
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
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:cb:e4:f6 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.4/24 brd 192.168.1.255 scope global eno16777736
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fecb:e4f6/64 scope link
valid_lft forever preferred_lft forever
[root@master network-scripts]# ip a
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
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: <NO-CARRIER,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:cb:e4:f6 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.4/24 brd 192.168.1.255 scope global eno16777736
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fecb:e4f6/64 scope link
valid_lft forever preferred_lft forever
注解:
- 解释:
2: eno16777736: <NO-CARRIER,MULTICAST,UP,LOWER_UP>
上面这行代码中的网卡名称后面跟的NO-CARRIER是没有载体的意思【百度的英文意思】
就是说没有网卡【猜的】
NO-CARRIER
后面是什么我没注意看过,只在无法联网时着重看了这一个单词。
首先的解决办法是去查看下网卡名称是否一致:ifcfg-eno777736是网卡名称【网卡名称因机器而异,大多数用户是这样】
因为网卡名称开始是默认给的,在下次开机可能会更改,所以先确认一下。
[root@master ~]# cd /etc/sysconfig/network-scripts/
[root@master network-scripts]# ls
ifcfg-eno16777736 ifdown-ipv6 ifdown-TeamPort ifup-ippp ifup-routes network-functions
ifcfg-lo ifdown-isdn ifdown-tunnel ifup-ipv6 ifup-sit network-functions-ipv6
ifdown ifdown-post ifup ifup-isdn ifup-Team
ifdown-bnep ifdown-ppp ifup-aliases ifup-plip ifup-TeamPort
ifdown-eth ifdown-routes ifup-bnep ifup-plusb ifup-tunnel
ifdown-ib ifdown-sit ifup-eth ifup-post ifup-wireless
ifdown-ippp ifdown-Team ifup-ib ifup-ppp init.ipv6-global
说明:
- 用这个名称去和你
ip a
得到的名称去做对比,如果不一致改成一致重启下网卡应该就可以了
#重启网卡命令:service network restart
services.msc
打开服务管理项
2. 打开大写键盘锁(为了快速查找),输入V(VMware的首字母)
3. 找到后发现“VMware NAT service”没有在运行或“VMware DHCP service”
4. 鼠标右键点击“启用”后再鼠标右键点击“属性”,将“启动类型”改为“自动”
5. 再去Linux中重启下网卡,重启网卡命令如下:
service network restart
[root@master network-scripts]# ping baidu.com
PING baidu.com (39.156.69.79) 56(84) bytes of data.
64 bytes from 39.156.69.79: icmp_seq=1 ttl=128 time=22.2 ms
64 bytes from 39.156.69.79: icmp_seq=2 ttl=128 time=22.6 ms
64 bytes from 39.156.69.79: icmp_seq=3 ttl=128 time=22.7 ms
^C
--- baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 22.240/22.522/22.712/0.203 ms
此时就已经可以上网了,可以再ip a
查看一下状态已变成上面所说的正常状态信息啦!
下一篇文章:专栏 [ 查看所有文章 ]:Hadoop生态圈搭建
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。