linux ping加数据包,linux – ping没有收到数据包,但tcpdump可以看到它们进入

我正在将旧的Ubuntu OpenVZ实例(Jaunty)迁移到新的CentOS 6.3主机(使用vzdump / vzrestore).

现在网络无法正常工作.事实:

>如果设置一个新的OpenVZ实例,它可以正常工作.

>我可以很好地连接INTO旧实例,但它无法连接到外部.

>它不能ping主机,也不能ping其他任何东西.

>我已经清除了主机和VE内部的所有iptables规则.

平:

root@dolores:/# ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

^C

--- 8.8.8.8 ping statistics ---

11 packets transmitted, 0 received, 100% packet loss, time 9999ms

在VE内同时:

17:49:12.730360 IP dolores > 8.8.8.8: ICMP echo request, id 59701, seq 1, length 64

17:49:12.735095 IP 8.8.8.8 > dolores: ICMP echo reply, id 59701, seq 1, length 64

17:49:13.730305 IP dolores > 8.8.8.8: ICMP echo request, id 59701, seq 2, length 64

17:49:13.735524 IP 8.8.8.8 > dolores: ICMP echo reply, id 59701, seq 2, length 64

17:49:14.730411 IP dolores > 8.8.8.8: ICMP echo request, id 59701, seq 3, length 64

这个输出偶尔会发生一些延迟,我相信因为tcpdump试图反向DNS所涉及的ips:

17:47:20.977819 IP dolores.40623 > 213.133.98.97.domain: 60247+ PTR? 8.8.8.8.in-addr.arpa. (38)

我可以在主机上运行tcpdump并立即获得相同的输出.

当然,/ sys / devices / virtual / net / venet0 / statistics / rx_bytes正在更新,并且/ sys / devices / virtual / net / venet0 / statistics / rx_错误文件都没有进行窥视.

这是怎么回事?我现在在哪里看?我认为问题必须与Ubuntu VE本身有关,因为它适用于新创建的.

如果有帮助,可以提供更多输出:

root@dolores:/# ifconfig -a

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING MTU:16436 Metric:1

RX packets:0 errors:0 dropped:0 overruns:0 frame:0

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

inet addr:127.0.0.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255

UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

RX packets:39652 errors:0 dropped:0 overruns:0 frame:0

TX packets:39398 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:3344760 (3.3 MB) TX bytes:3303115 (3.3 MB)

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

inet addr:78.46.236.xxx P-t-P:78.46.236.xxx Bcast:0.0.0.0 Mask:255.255.255.255

UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

.

root@dolores:/# route

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

default * 0.0.0.0 U 0 0 0 venet0

在主持人:

[root@olive ~]# route

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

static.xxx.236. * 255.255.255.255 UH 0 0 0 venet0

78.46.236.xxx * 255.255.255.224 U 0 0 0 eth0

link-local * 255.255.0.0 U 1002 0 0 eth0

default gw-wan2.little- 0.0.0.0 UG 0 0 0 eth0

解决方法:

有相同的症状但没有虚拟机.我修好了.

我的SNAT设置和ip规则存在问题,但不匹配.

运行ip route,应该有一行……

default dev venet0 scope link

运行ip规则,应该有3行……

0: from all lookup local

32766: from all lookup main

32767: from all lookup default

标签:linux,ubuntu,networking,centos,openvz

来源: https://codeday.me/bug/20190812/1642671.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值