LINUX安装好后无法访问网络

LINUX安装好后无法访问网络

在虚拟机安装好新的LINUX系统后,ping www.baidu.com ,发现无法ping通。

键入ifconfig查询配置:

eno16777728: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  ether 00:0c:29:3e:ad:2d txqueuelen 1000 (Ethernet)

  RX packets 0 bytes 0 (0.0 B)

  RX errors 0 dropped 0 overruns 0 frame 0

  TX packets 0 bytes 0 (0.0 B)

  TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

 

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

  inet 127.0.0.1 netmask 255.0.0.0

   inet6 ::1 prefixlen 128 scopeid 0x10<host>

   loop txqueuelen 0 (Local Loopback)

   RX packets 942 bytes 79580 (77.7 KiB)

   RX errors 0 dropped 0 overruns 0 frame 0

   TX packets 942 bytes 79580 (77.7 KiB)

   TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

得到本机的网卡是eno16777728

然后,重启网卡服务:service network restart

再次查询:ifconfig,发现依旧如上所示,并且无法访问网络。

修改网卡配置: root模式下vim /etc/sysconfig/network-scripts/ifcfg-eno16777728(最后的数字不一定一致,不要照搬,根据查询出来的配置信息灵活替换),然后将文件里最后一项的ONBOOT=no在插入模式中修改为yes并保存退出,以后计算机自动启动网卡。

现在手动启动网卡服务ifup eno16777736

重新键入ifconfig:

eno16777728: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  inet 192.168.81.134 netmask 255.255.255.0 broadcast 192.168.81.255

   inet6 fe80::20c:29ff:fe3e:ad2d prefixlen 64 scopeid 0x20<link>

   ether 00:0c:29:3e:ad:2d txqueuelen 1000 (Ethernet)

   RX packets 125 bytes 14963 (14.6 KiB)

   RX errors 0 dropped 0 overruns 0 frame 0

   TX packets 147 bytes 15265 (14.9 KiB)

   TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

 

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

   inet 127.0.0.1 netmask 255.0.0.0

   inet6 ::1 prefixlen 128 scopeid 0x10<host>

   loop txqueuelen 0 (Local Loopback)

   RX packets 946 bytes 80000 (78.1 KiB)

   RX errors 0 dropped 0 overruns 0 frame 0

   TX packets 946 bytes 80000 (78.1 KiB)

   TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

问题解决,网卡服务成功启动,并且后续不需要每次都手动启动网卡服务

本文参照:http://114193107.blog.51cto.com/3025337/1676433

转载于:https://www.cnblogs.com/sum41/p/9349040.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值