Banana Pi-R2. Add bridge on Debian

Sorry for my bad english…

I have tried to add bridge interface with this config:

    cat /etc/network/interfaces
    # interfaces(5) file used by ifup(8) and ifdown(8)
    # Include files from /etc/network/interfaces.d:

    auto eth0
    iface eth0 inet manual
      pre-up ip link set $IFACE up
      post-down ip link set $IFACE down

    auto eth1
    iface eth1 inet manual
      pre-up ip link set $IFACE up
      post-down ip link set $IFACE down

    auto wan
      allow-hotplug wan
      iface wan inet dhcp

    auto lan0
    iface lan0 inet manual

    auto lan1
    iface lan1 inet manual

    auto lan2
    iface lan2 inet manual

    auto lan3
    iface lan3 inet manual

    auto br0
      iface br0 inet static
      address 172.16.0.1
      netmask 255.255.255.0
      bridge_ports lan0 lan1 lan2 lan3
      bridge_fd 5
      bridge_stp no
      bridge_maxwait 0

      iface br0 inet6 static
      address 2001:db8:1111::1
      netmask 64 

    source-directory /etc/network/interfaces.d

But, when i have applied new config by: systemctl restart networking

System has returned the error:

    [ 1372.668063] br0: port 1(lan0) entered blocking state
    [ 1372.673133] br0: port 1(lan0) entered disabled state
    [ 1372.679620] device lan0 entered promiscuous mode
    [ 1372.684342] device eth0 entered promiscuous mode
    [ 1372.703936] br0: port 2(lan1) entered blocking state
    [ 1372.708911] br0: port 2(lan1) entered disabled state
    [ 1372.715157] device lan1 entered promiscuous mode
    [ 1372.736150] br0: port 3(lan2) entered blocking state
    [ 1372.741119] br0: port 3(lan2) entered disabled state
    [ 1372.747341] device lan2 entered promiscuous mode
    [ 1372.766559] br0: port 4(lan3) entered blocking state
    [ 1372.771541] br0: port 4(lan3) entered disabled state
    [ 1372.778568] device lan3 entered promiscuous mode
    [ 1372.800248] IPv6: ADDRCONF(NETDEV_UP): br0: link is not ready
    Job for networking.service failed because the control process exited with error code.
    See "systemctl status networking.service" and "journalctl -xe"     for details.

And error text from journalctl:

    Feb 07 13:07:47 bpi-r2 sshd[5199]: Received SIGHUP; restarting.
    Feb 07 13:07:47 bpi-r2 sshd[5199]: Server listening on 0.0.0.0 port 22.
    Feb 07 13:07:47 bpi-r2 sshd[5199]: Server listening on :: port 22.
    Feb 07 13:07:54 bpi-r2 ifup[5328]: Waiting for DAD... Timed out
    Feb 07 13:07:54 bpi-r2 ifup[5328]: ifup: failed to bring up br0
    Feb 07 13:07:54 bpi-r2 systemd[1]: networking.service: Main process exited, code
    Feb 07 13:07:54 bpi-r2 systemd[1]: Failed to start Raise network interfaces.
    -- Subject: Unit networking.service has failed
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    -- 
    -- Unit networking.service has failed.
    -- 
    -- The result is failed.
    Feb 07 13:07:54 bpi-r2 systemd[1]: networking.service: Unit entered failed state
    Feb 07 13:07:54 bpi-r2 systemd[1]: networking.service: Failed with result 'exit-

Also, after restarting i saw new interface, but can’t rise up it:

    root@bpi-r2:~# ip l sh br0
    12: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group defe DEFAULT group default qlen 1000
        link/ether 82:7f:cc:95:f4:77 brd ff:ff:ff:ff:ff:ff
    root@bpi-r2:~# ip l set br0 up
    root@bpi-r2:~# ip l sh br0
    12: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
        link/ether 82:7f:cc:95:f4:77 brd ff:ff:ff:ff:ff:ff

What i’m doing wrong?

Debian 9, kernel: 4.14.80-bpi-r2-main

Is any of the ports (lanX) physically up (cable connected to switch or computer)?

All lanX links is down. I will try test again with connected device.

Yes, it’s works if any device connected to lan port.

But. How i can fix bridge connection for working without connected devices?

You can try something like this in bridge-block:

pre-up ip link set $IFACE up

Maybe with lanx instead of $iface

I have a solution of problem with using kernel 4.19 instead of 4.14.

Thanx for help.

maybe 5.4 is better (e.g. vlan is not working in 4.19)…and newer

Hello, i have the same problem with bridge. [ 19.289222] br0: port 1(lan1) entered blocking state [ 19.294384] br0: port 1(lan1) entered disabled state [ 19.326404] br0: port 2(lan2) entered blocking state [ 19.331415] br0: port 2(lan2) entered disabled state

I have kernel 5.4

Is any port of bridge up? I do not know a way to force bridge up if all interfaces are down…

The bridge contains lan1 and lan2. Both are down. i use only lan0.

does networkd go into failure? does the bridge work if you connect a device to lan1/lan2?

it is still down.

[19643.679524] br0: port 1(lan1) entered blocking state
[19643.684554] br0: port 1(lan1) entered forwarding state

after restarting network service there is a error

● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor prese
   Active: failed (Result: exit-code) since Mon 2020-03-30 15:16:24 CEST; 1min 1
     Docs: man:interfaces(5)
  Process: 8096 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=
 Main PID: 8096 (code=exited, status=1/FAILURE)

Mar 30 15:16:23 Server systemd[1]: Starting Raise network interfaces...
Mar 30 15:16:23 Server ifup[8096]: Cannot find device "eth1"
Mar 30 15:16:23 Server ifup[8096]: ifup: failed to bring up eth1
Mar 30 15:16:24 Server ifup[8096]: Waiting for br0 to get ready (MAXWAIT is 12 s
Mar 30 15:16:24 Server ifup[8096]: RTNETLINK answers: File exists
Mar 30 15:16:24 Server ifup[8096]: ifup: failed to bring up br0
Mar 30 15:16:24 Server systemd[1]: networking.service: Main process exited, code
Mar 30 15:16:24 Server systemd[1]: networking.service: Failed with result 'exit-
Mar 30 15:16:24 Server systemd[1]: Failed to start Raise network interfaces.

I do not understand why there is Cannot find device “eth1” and here is my network config.

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
auto lo
iface lo inet loopback

auto eth0
  iface eth0 inet manual
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

auto eth1
  iface eth1 inet manual
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

auto lan1
  iface lan1 inet manual
  pre-up ip link set lan1 up


auto lan2
  iface lan2 inet manual
  pre-up ip link set lan2 up


#auto lan3
#  iface lan3 inet manual



auto lan0
  iface lan0 inet static
address 192.168.10.10
netmask 255.255.255.0
gateway 192.168.10.1
pre-up ip link set $IFACE up
post-down ip link set $IFACE down



auto br0
iface br0 inet static
    address 192.168.10.20
    netmask 255.255.255.0
    gateway 192.168.10.1
    bridge_ports lan1 lan2
    bridge_fd 5
    bridge_stp no


source-directory /etc/network/interfaces.d

5.4 has no second gmac so you have only eth0 where all dsa ports routed over it.

I had added patches to enable eth1 and route wan over it (or better renaming eth1 to wan) in early 5.4,but some users had issues with it,so i reverted the patches (you can see both in 5.4-gmac)

Just deactivate the section of eth1 with # on beginning of line.

So, after disabling eth1 in my interface config, the bridge works withouth any problem.

1 Like