
centos不能上外网怎么办
CentOS不能上外网的解决方法如下:
1、检查路由
# 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通外网的
2、添加dns
CentOS Linux 7.9.2009是传统CentOS Linux 7的最后主要版本,也是很多企业历史服务器中仍可能遇到的系统版本。它以稳定、兼容RHEL 7生态、文档丰富和软件支持广泛著称,曾长期用于Web服务、数据库、虚拟化节点和企业内部业务系统。不过CentOS Linux 7已于2024年6月30日停止维护,现在继续使用会面临安全补丁缺失风险。该版本更适合旧业务迁移、历史环境恢复或离
# vim /etc/resolv.conf nameserver 8.8.8.8
3、添加路由
# route add default gw 192.168.0.1
4、重启网卡
service network restart
本篇文章来自PHP中文网,CentOS使用教程栏目,更多相关教程请关注本栏目!










