首页 > 其他 > 详细

Centos不能上外网解决

时间:2019-03-16 18:49:19      阅读:188      评论:0      收藏:0      [点我收藏+]

检查路由

# route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 ens33
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 ens33
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

 

如果你缺失第一个路由,是肯定无法ping通外网的这里写代码片
添加dns

# vim /etc/resolv.conf


nameserver 8.8.8.8

添加路由

# route add default gw 192.168.0.1

重启网卡

service network restart

Centos不能上外网解决

原文:https://www.cnblogs.com/pxblog/p/10543372.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!