Hello,
It seems that only the first interface mentioned in option ifname
of /etc/config/network
gets a proper connectivity within a VirtualBox x86_64 OpenWrt.
The OpenWrt router runs in a VirtualBox.
NIC1 is bridged with br1 (a local bridge). It is seen as eth0 by OpenWrt.
NIC2 is bridged with a physical interface (access to the outer lan) It is seen as eth1 by OpenWrt.
NIC3 is bridged with br2 (a local bridge). It is seen as eth2 by OpenWrt.
2 Alpine containers are respectively connected br1 and br2, all links are up. Both containers receive an IP address (192.168.1.122 and 192.168.1.154) upon DHCP request. However with
config interface 'lan'
option force_link '1'
option type 'bridge'
option ifname 'eth0 eth2'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
Only the container connected to eth0<->br1 is able to ping the router. With
config interface 'lan'
option force_link '1'
option type 'bridge'
option ifname 'eth2 eth0'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
Only the container connected to eth2<->br2 is able to ping the router.
I tried the following on both 19.07.2 and snapshot, with and without the firewall. The wrong checksum inherent to virtual bridged interfaces is addressed.
What puzzles me is that both get IP addresses through DCHP requests.
Arp requests confirms that the router sees both containers:
IP address HW type Flags HW address Mask Device
192.168.1.154 0x1 0x2 00:16:3e:6c:5b:5b * br-lan
192.168.1.122 0x1 0x2 00:16:3e:97:f1:c2 * br-lan
192.168.64.1 0x1 0x2 d8:58:d7:00:43:ad * eth1
and the routes seems ok
root@OpenWrt:/# ip r s
default via 192.168.64.1 dev eth1 src 192.168.64.173
192.168.1.0/24 dev br-lan scope link src 192.168.1.1
192.168.64.0/21 dev eth1 scope link src 192.168.64.173
as well as links and the bridge
root@OpenWrt:/# ip l sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
link/ether 08:00:27:66:be:81 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
link/ether 08:00:27:87:07:78 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
link/ether 08:00:27:ef:4e:23 brd ff:ff:ff:ff:ff:ff
5: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 08:00:27:ef:4e:23 brd ff:ff:ff:ff:ff:ff
root@OpenWrt:/# brctl show
bridge name bridge id STP enabled interfaces
br-lan 7fff.080027ef4e23 no eth2
eth0
With both containers pinging the router
Below is a tcpdump within the router, where it can be seen that pings are received and answered to a single one, BUT there is an answered arp request from the other one.
root@OpenWrt:/# tcpdump -vv
18:11:34.691933 IP (tos 0x0, ttl 64, id 5950, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.1.154 > OpenWrt.lan: ICMP echo request, id 18689, seq 401, length 64
18:11:34.692025 IP (tos 0x0, ttl 64, id 32843, offset 0, flags [none], proto ICMP (1), length 84)
OpenWrt.lan > 192.168.1.154: ICMP echo reply, id 18689, seq 401, length 64
18:11:35.239168 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has OpenWrt.lan tell 192.168.1.122, length 46
18:11:35.239207 ARP, Ethernet (len 6), IPv4 (len 4), Reply OpenWrt.lan is-at 08:00:27:ef:4e:23 (oui Unknown), length 28
18:11:35.692153 IP (tos 0x0, ttl 64, id 5987, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.1.154 > OpenWrt.lan: ICMP echo request, id 18689, seq 402, length 64
18:11:35.692239 IP (tos 0x0, ttl 64, id 32865, offset 0, flags [none], proto ICMP (1), length 84)
OpenWrt.lan > 192.168.1.154: ICMP echo reply, id 18689, seq 402, length 64
Below is a tcpdump from the physical on both veth
root@bioman2:~# tcpdump -vvi veth45d893e1
tcpdump: listening on veth45d893e1, link-type EN10MB (Ethernet), capture size 262144 bytes
20:10:11.353934 IP (tos 0x0, ttl 64, id 28066, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.1.122 > biorouter.home.prog.in: ICMP echo request, id 17153, seq 311, length 64
20:10:12.354157 IP (tos 0x0, ttl 64, id 28214, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.1.122 > biorouter.home.prog.in: ICMP echo request, id 17153, seq 312, length 64
20:10:13.354318 IP (tos 0x0, ttl 64, id 28397, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.1.122 > biorouter.home.prog.in: ICMP echo request, id 17153, seq 313, length 64
root@bioman2:~# tcpdump -vvi vethbcdaf621
tcpdump: listening on vethbcdaf621, link-type EN10MB (Ethernet), capture size 262144 bytes
20:10:53.686524 IP (tos 0x0, ttl 64, id 1058, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.1.154 > biorouter.home.prog.in: ICMP echo request, id 18689, seq 360, length 64
20:10:53.687342 IP (tos 0x0, ttl 64, id 30781, offset 0, flags [none], proto ICMP (1), length 84)
biorouter.home.prog.in > 192.168.1.154: ICMP echo reply, id 18689, seq 360, length 64
20:10:54.686716 IP (tos 0x0, ttl 64, id 1303, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.1.154 > biorouter.home.prog.in: ICMP echo request, id 18689, seq 361, length 64
20:10:54.687265 IP (tos 0x0, ttl 64, id 30815, offset 0, flags [none], proto ICMP (1), length 84)
biorouter.home.prog.in > 192.168.1.154: ICMP echo reply, id 18689, seq 361, length 64
Any hint or idea would be greatly appreciated. Thank you.