I’ve been trying to configure the BPi-R2 as a one-armed router (of a fashion), and have hit some problems I don’t understand. I’m conversant enough with Linux networking, including software bridging with the old brctl
tool, but it’s my first experience with DSA and the ip-bridge
utility, and I’ve probably made a mistake.
I wonder if the below approach of adding a wan
VLAN interface to the br-lan
bridge is the right way to do it and I’m just missing some detail, or if I should switch to the (unfamiliar) bridge vlan
tool in a completely different approach, or what. Ideas?
Facility network environment: We have a router (MikroTik PoE running RouterOS) with all active ports configured as “hybrid” trunk ports, i.e. untagged traffic is VLAN 1, and tagged VLANs 100-103. A couple of WiFi APs (Ubiquiti AC running OpenWRT) broadcast several ESSIDs, each bridged to one of the VLANs 100-103.
Goal configuration: The goal is to set up the BPi-R2 in a lab as a router. It will have a PXE boot environment on the br-lan
bridge for provisioning machines. The wan
interface forwards Internet traffic through the MikroTik, as you’d expect. Also, the wan
interface should forward VLAN 103 traffic between the BPi’s br-lan
bridge and the rest of the network to provide access to lab machines via the lab
ESSID from other parts of the facility.
Current config (failing): The wan
port is connected to one of the hybrid trunk ports on the Mikrotik, untagged, carrying masqueraded traffic from the br-lan
bridge to the Internet. The VLAN 103 traffic goes over the wan.103
port, which is slaved to the br-lan
bridge together with the four lan0
-lan3
ports. This configuration partly works: hosts wired to the lan0
-lan3
ports can access the Internet and hosts on the lab
ESSID can, too. The BPi-R2 can ping both groups of hosts. However, the two groups of hosts cannot talk with each other.
OS and kernel: I actually started this experiment with Debian Buster with @frank-w’s 5.4 kernel, and when I hit the wall, switched over to OpenWRT (built from master
branch, kernel 5.4.101), and seeing the exact same problem.
Output of `ip`, `bridge`, etc. utilities
root@OpenWrt:~# ip link
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 1504 qdisc fq_codel state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
3: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
4: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
5: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
6: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
7: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
11: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
12: wan.103@wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
root@OpenWrt:~# ip addr
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
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc fq_codel state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
inet6 fe80::a8b6:32ff:fe5c:a233/64 scope link
valid_lft forever preferred_lft forever
3: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
inet 10.88.0.222/24 brd 10.88.0.255 scope global wan
valid_lft forever preferred_lft forever
inet6 2605:a601:ab40:4000:a8b6:32ff:fe5c:a233/64 scope global dynamic noprefixroute
valid_lft 14274sec preferred_lft 14274sec
inet6 fe80::a8b6:32ff:fe5c:a233/64 scope link
valid_lft forever preferred_lft forever
4: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
5: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
6: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
7: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
11: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
inet 10.64.0.1/24 brd 10.64.0.255 scope global br-lan
valid_lft forever preferred_lft forever
inet6 fd9b:4875:7d7::1/60 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::a8b6:32ff:fe5c:a233/64 scope link
valid_lft forever preferred_lft forever
12: wan.103@wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
link/ether aa:b6:32:5c:a2:33 brd ff:ff:ff:ff:ff:ff
root@OpenWrt:~# bridge link
4: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-lan state disabled priority 32 cost 100
5: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-lan state forwarding priority 32 cost 4
6: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-lan state disabled priority 32 cost 100
7: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-lan state disabled priority 32 cost 4
12: wan.103@wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-lan state forwarding priority 32 cost 4
root@OpenWrt:~# brctl show
bridge name bridge id STP enabled interfaces
br-lan 7fff.aab6325ca233 yes lan0
lan1
lan2
lan3
wan.103
root@OpenWrt:~# bridge vlan
port vlan ids
lan0 1 PVID Egress Untagged
lan1 1 PVID Egress Untagged
lan2 1 PVID Egress Untagged
lan3 1 PVID Egress Untagged
br-lan 1 PVID Egress Untagged
wan.103 1 PVID Egress Untagged