您的位置 首页 技术

CentOS不能上外网怎么办

CentOS不能上外网怎么办 CentOS不能上外网的解决方法如下: 1、检查路由 # route -nKernel IP routing tableDestination Gat…

CentOS不能上外网怎么办

CentOS不能上外网的解决方法如下:

1、检查路由

# route -nKernel IP routing tableDestination     Gateway         Genmask         Flags Metric Ref    Use Iface0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 ens33169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 ens33192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

推荐学习:网站建设教程

如果你缺失第一个路由,是肯定无法ping通外网的

2、添加dns

# vim /etc/resolv.confnameserver 8.8.8.8

3、添加路由

# route add default gw 192.168.0.1

4、重启网卡

service network restart

本篇文章来自PHP中文网,CentOS使用教程栏目,更多相关教程请关注本栏目!

以上就是CentOS不能上外网怎么办的详细内容,更多请关注24课堂在线网其它相关文章!

本文来自网络,不代表24小时课堂在线立场,转载请注明出处:https://www.24ketang.cn/53161.html

为您推荐

返回顶部