OpenVZ Container正在丢弃数据包

时间:2015-07-24 07:14:15

标签: openvz

我有一个OVH服务器,使用网桥模式。在容器中似乎什么都不起作用,我也不能SSH / ping容器。

这是来自hostnode的route / ifconfig:

ifconfig -a eth0      Link encap:Ethernet  HWaddr 0C:C4:7A:4C:C0:06  
          inet6 addr: fe80::ec4:7aff:fe4c:c006/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40726 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11298 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2943207 (2.8 MiB)  TX bytes:1915174 (1.8 MiB)
          Memory:fb920000-fb93ffff 

eth1      Link encap:Ethernet  HWaddr 0C:C4:7A:4C:C0:07  
          BROADCAST MULTICAST  MTU:1500  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:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Memory:fb900000-fb91ffff 

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:65536  Metric:1
          RX packets:104 errors:0 dropped:0 overruns:0 frame:0
          TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:9092 (8.8 KiB)  TX bytes:9092 (8.8 KiB)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet6 addr: fe80::1/128 Scope:Link
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:395 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:84297 (82.3 KiB)  TX bytes:0 (0.0 b)

veth101.0 Link encap:Ethernet  HWaddr 02:00:00:0D:70:EA  
          inet6 addr: fe80::ff:fe0d:70ea/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:1178 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

vmbr0     Link encap:Ethernet  HWaddr 02:00:00:0D:70:EA  
          inet addr:167.114.174.210  Bcast:167.114.174.255  Mask:255.255.255.0
          inet6 addr: fe80::ec4:7aff:fe4c:c006/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40611 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11012 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2335856 (2.2 MiB)  TX bytes:1895173 (1.8 MiB)

路由:

[root@knode-ca2]:()/etc/sysconfig/network-scripts# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
158.69.135.200  0.0.0.0         255.255.255.255 UH        0 0          0 venet0
167.114.174.0   0.0.0.0         255.255.255.0   U         0 0          0 vmbr0
0.0.0.0         167.114.174.254 0.0.0.0         UG        0 0          0 vmbr0
[root@knode-ca2]:()/etc/sysconfig/network-scripts# ip route show
158.69.135.200 dev venet0  scope link  src 167.114.174.210 
167.114.174.0/24 dev vmbr0  proto kernel  scope link  src 167.114.174.210 
default via 167.114.174.254 dev vmbr0 
[root@knode-ca2]:()/etc/sysconfig/network-scripts#

以下是来自CONTAINER的相同命令

Executing command: ifconfig 
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:65536  Metric:1
          RX packets:29 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1830 (1.7 KiB)  TX bytes:1830 (1.7 KiB)

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:125 errors:0 dropped:14 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:8868 (8.6 KiB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:158.69.135.200  P-t-P:158.69.135.200  Bcast:158.69.135.200  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

[root@knode-ca2]:()~# vzctl exec 106 netstat -rn
Executing command: netstat -rn 
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 venet0
[root@knode-ca2]:()~# vzctl exec 106 ip route show
Executing command: ip route show 
default dev venet0  scope link 
[root@knode-ca2]:()~#

我不知道这里发生了什么,我正在使用虚拟MAC地址。

1 个答案:

答案 0 :(得分:0)

从容器中查看配置。

广播地址与inet地址和P-t-P

相同

我的容器显示了这个

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:1.2.3.4  P-t-P:1.2.3.4  Bcast:0.0.0.0  Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

确保这是正确的