您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

centos下访问不了外网怎么办

2024/2/26 15:45:08发布37次查看
问题描述:
内网的这一台centos服务器,以前一直都是好好的,可突然不能上外网了,表现,内网可以访问这台电脑资源,但是在这一台服务器上无法访问外网。
[root@localhost ~]# arp -naddress hwtype hwaddress flags mask iface192.168.1.102 ether e4:9a:79:d8:bf:0d c eth0192.168.1.214 ether 40:8d:5c:21:00:1a c eth0192.168.1.111 ether 4c:8d:79:e4:aa:d0 c eth0192.168.1.1 ether 00:17:16:08:3d:6a cm eth0[root@localhost ~]#
问题排查:
非dns问题,也非ip冲突问题,网关的网卡地址导致。
(推荐教程:centos教程)
解决方法:
更新网卡地址,先找到可访问外网的网卡地址,比如在当前win中执行 arp -a,得到网卡地址。
d:\mysite>arp -a接口: 192.168.1.204 --- 0xc internet 地址 物理地址 类型 192.168.1.1 00-17-16-08-33-6a 动态 192.168.1.3 94-de-80-55-1b-8d 动态 239.255.255.250 01-00-5e-70-ff-fa 静态 255.255.255.255 ff-ff-ff-ff-ff-ff 静态d:\mysite>
在centos上执行如下命令:
# 在 centos 上先执行删除旧的网卡信息/sbin/arp -d 192.168.1.1# 重新设置新的,上面win里面找到的 网卡,横线改为冒号 /sbin/arp -s 192.168.1.1 00:17:16:08:33:6a
测试:
[root@localhost ~]# ping www.baidu.comping www.a.shifen.com (183.232.231.172) 56(84) bytes of data.64 bytes from 183.232.231.172: icmp_seq=1 ttl=55 time=9.03 ms64 bytes from 183.232.231.172: icmp_seq=2 ttl=55 time=8.80 ms64 bytes from 183.232.231.172: icmp_seq=3 ttl=55 time=10.1 ms64 bytes from 183.232.231.172: icmp_seq=4 ttl=55 time=108 ms^c--- www.a.shifen.com ping statistics ---4 packets transmitted, 4 received, 0% packet loss, time 3814msrtt min/avg/max/mdev = 8.804/34.058/108.239/42.831 msyou have new mail in /var/spool/mail/root[root@localhost ~]#
完美解决!
相关视频教程推荐:linux视频教程
以上就是centos下访问不了外网怎么办的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product