Por favor, você poderia me ajudar a entender alguns fenômenos da rede abaixo. O host ol74a-server é uma VM do VirtualBox. O host oel73c11 é um contêiner LXC Linux em execução no servidor ol74a do host da VM.
O que está me confundindo e o que eu preciso de ajuda é, quando logado na VM ol74a-server, este comando falha:
ping -c 3 -I lxcbr0 10.207.29.2 (falha)
Mas quando conectado ao contêiner LXC Linux oel73c11, que é vinculado a esse mesmo lxcbr0, esse comando é bem-sucedido:
ping -c 3 -I eth0 10.207.29.2 (sucede)
O contêiner eth0 in oel73c11 LXC é vinculado a lxcbr0 na VM do servidor ol74a. Por que a bridge propriamente dita (lxcbr0) na VM não consegue executar o ping em 10.207.29.2, enquanto a eth0 no contêiner oel73c11 pode executar o ping em 10.207.29.2, mesmo que seja vinculada a lxcbr0, que não pode efetuar ping em 10.207.29.2?
DETALHES
NA VM:
[ubuntu@ol74a-server ~]$ ifconfig lxcbr0
lxcbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1420
inet 10.42.147.1 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::216:3eff:fe00:0 prefixlen 64 scopeid 0x20<link>
ether 00:16:3e:00:00:00 txqueuelen 0 (Ethernet)
RX packets 108 bytes 10781 (10.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 71 bytes 9806 (9.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[ubuntu@ol74a-server ~]$ ping -c 3 -I lxcbr0 10.207.29.2
PING 10.207.29.2 (10.207.29.2) from 10.42.147.1 lxcbr0: 56(84) bytes of data.
^C
--- 10.207.29.2 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2000ms
[ubuntu@ol74a-server ~]$ ifconfig sx1
sx1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1420
inet 10.207.29.12 netmask 255.255.255.0 broadcast 10.207.29.255
inet6 fe80::a00:27ff:fe78:ba24 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:78:ba:24 txqueuelen 0 (Ethernet)
RX packets 289 bytes 27445 (26.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 56 bytes 4344 (4.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[ubuntu@ol74a-server ~]$ ping -c 3 -I sx1 10.207.29.2
PING 10.207.29.2 (10.207.29.2) from 10.207.29.12 sx1: 56(84) bytes of data.
64 bytes from 10.207.29.2: icmp_seq=1 ttl=64 time=1.86 ms
64 bytes from 10.207.29.2: icmp_seq=2 ttl=64 time=0.431 ms
64 bytes from 10.207.29.2: icmp_seq=3 ttl=64 time=0.331 ms
--- 10.207.29.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.331/0.875/1.865/0.701 ms
[ubuntu@ol74a-server ~]$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.207.29.1 0.0.0.0 UG 0 0 0 sx1
0.0.0.0 10.207.39.1 0.0.0.0 UG 0 0 0 sw1
10.42.147.0 0.0.0.0 255.255.255.0 U 0 0 0 lxcbr0
10.207.29.0 0.0.0.0 255.255.255.0 U 0 0 0 sx1
10.207.39.0 0.0.0.0 255.255.255.0 U 0 0 0 sw1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
[ubuntu@ol74a-server ~]$
CONFIG FILE NETWORKING STANZA OF LXC CONTAINER:
[ubuntu@ol74a-server ~]$ sudo cat /var/lib/lxc/oel73c11/config | grep net | grep -v '#'
lxc.net.0.type = veth
lxc.net.0.flags = up
lxc.net.0.link = lxcbr0
lxc.net.0.name = eth0
lxc.net.0.mtu = 1420
lxc.net.0.hwaddr = 00:16:3e:99:78:05
[ubuntu@ol74a-server ~]$ sudo lxc-start -n oel73c11
[ubuntu@ol74a-server ~]$ sudo lxc-attach -n oel73c11
ON THE LXC LINUX CONTAINER
[root@oel73c11 /]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1420
inet 10.42.147.64 netmask 255.255.255.0 broadcast 10.42.147.255
inet6 fe80::216:3eff:fe99:7805 prefixlen 64 scopeid 0x20<link>
ether 00:16:3e:99:78:05 txqueuelen 1000 (Ethernet)
RX packets 9 bytes 964 (964.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11 bytes 1046 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@oel73c11 /]# ping -c 3 -I eth0 10.207.29.2
PING 10.207.29.2 (10.207.29.2) from 10.42.147.64 eth0: 56(84) bytes of data.
64 bytes from 10.207.29.2: icmp_seq=1 ttl=63 time=1.08 ms
64 bytes from 10.207.29.2: icmp_seq=2 ttl=63 time=0.461 ms
64 bytes from 10.207.29.2: icmp_seq=3 ttl=63 time=0.535 ms
--- 10.207.29.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.461/0.694/1.088/0.281 ms
[root@oel73c11 /]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.42.147.1 0.0.0.0 UG 0 0 0 eth0
10.42.147.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
[root@oel73c11 /]#