BPI-R2 link all network ports as a switch

I do not see your br0 in “ip a”, and lan-ports are not mapped to bridge…

mac address changing has to be done for br0 and br0 has to be down before (so drop the br0 up in the middle).

You can use ip to configure the bridge instead of brctl,but set bridge up with the mac-change at the end

ip link set eth0 up
ip link add name br0 type bridge
ip link set lan0 master br0
#lan1,2,3,maybe need to set lanX up,but not yet the bridge
ip addr add 192.168.2.10/24 dev br0
ip link set br0 address 0A:94:C3:AC:DA:57 up
ip a

ok i entered:

ip link set eth0 up
ip link add name br0 type bridge
ip link set lan0 master br0
#lan1,2,3,maybe need to set lanX up,but not yet the bridge
ip link set br0 address 0A:94:C3:AC:DA:57 up
ip a

ip addr add 192.168.2.33/24 broadcast 192.168.2.255 dev br0
ip route add 192.168.2.0/24 dev br0
ip route add default via 192.168.2.1

i can connect to the R2, but no fixed MAC-Address and network switch is also not working. “ip a” says:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 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 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 92:38:8f:6b:85:f3 brd ff:ff:ff:ff:ff:ff
3: wan: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 02:42:9d:f5:06:a1 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: lan0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 92:38:8f:6b:85:f3 brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 92:38:8f:6b:85:f3 brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 92:38:8f:6b:85:f3 brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 92:38:8f:6b:85:f3 brd ff:ff:ff:ff:ff:ff
9: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:08:22:2a:da:fb brd ff:ff:ff:ff:ff:ff
10: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:cf:37:e3:e6 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 scope global docker0
       valid_lft forever preferred_lft forever

i can’t see the BR0 - should i setup BR0 anywhere else?

When you reboot you need to ip link etc again… It is only permanent when you use systemd-netwirkd or ifupdown

You can accomplish it with systemd-networkd by:

::::::::::::::
/etc/systemd/network/10-brlan.netdev
::::::::::::::
[NetDev]
Name=brlan
Kind=bridge

::::::::::::::
/etc/systemd/network/10-brlan.network
::::::::::::::
[Match]
Name=brlan

[Link]
RequiredForOnline=no

[Network]
DHCP=yes

::::::::::::::
/etc/systemd/network/10-eth0.network
::::::::::::::
[Match]
Name=eth0

[Link]
RequiredForOnline=no

::::::::::::::
/etc/systemd/network/10-lan.network
::::::::::::::
[Match]
Name=lan0 lan1 lan2 lan3 wan

[Link]
RequiredForOnline=no

[Network]
BindCarrier=eth0
Bridge=brlan

Ip number of the bridge through DHCP. All ports in the bridge including wan

Remove package ifupdown

Enable systemd-netwirkd service.

Then use a .link file to set Mac

------
/etc/systemd/network/10-brlan.link
--------
[Match]
OriginalName=eth0 brlan lan* wan

[Link]
MACAddress=aa:bb:cc:de:ee:ff

Address of brlan can also be done in the . network file I think but I know this works. All the same mac

It depends on which init is used…my images till buster use /etc/network/interfaces for permanant setting. I wanted to test is via ip command if the behaviour is as expected before doing a permanent solution. But yes,these settings get lost on reboot

Did luene remove the interfaces file before trying manually?

As he setup only wan there and with bridge only lan ports it does not matter

Thanks guys!

@ericwoud: i used /etc/network/interfaces only for now. I always did a reboot before testing.

I tried your post (using “/etc/systemd/network”) and it’s working now! All 4 Ports are linked - just the WAN-Port is not working as a switch. But for my case it doesn’t matter.

i made the “/etc/network/interfaces” empty, removed ifupdown, enabled systemd-networkd

But thank you! I can work with that :slight_smile:

If you used:

::::::::::::::
/etc/systemd/network/10-lan.network
::::::::::::::
[Match]
Name=lan0 lan1 lan2 lan3 wan

Then your wan port should be acting identical to a lan port. If it does not work, something is wrong…

Is ifupdown and the interfaces file really deactived?

Is nf-tables active (or ip-tables)? This could still be setup to block traffic on wan.

Anyway, great the lan ports are working as they should!