BPi

DSA (Distributed Switch Architecture)

Configuring a Trunk Port (Tagged VLAN)

ip link add br0 type bridge
ip link add link eth0 name eth0.42 type vlan id 42
ip addr add 192.168.42.23/24 brd 192.168.42.255 dev eth0.42
ip link set lan1 master br0
bridge vlan add vid 42 dev lan1
# bridge vlan del vid 1 dev lan1

ip link set eth0 up
ip link set eth0.42 up
ip link set lan1 up
ip link set br0 up

Configuring an Access Port (Untagged VLAN)

ip link add br0 type bridge
ip link add link eth0 name eth0.75 type vlan id 75
ip addr add 192.168.75.23/24 brd 192.168.75.255 dev eth0.75
ip link set lan2 master br0
bridge vlan add vid 75 dev lan2 pvid untagged
# bridge vlan del vid 1 dev lan2

ip link set eth0 up
ip link set eth0.75 up
ip link set lan2 up
ip link set br0 up
  • tagged port
  • untagged port
  • access port
  • trunk port
  • default vlan
  • native vlan
  • pvid (port vlan id)

Bridge VLAN Setup

Somehow the installed systemd version (215-17+dep8u7) does not correctly configure the bridge ports VLAN's.

As a workaround we configure rc.local to setup the vlans on the bridge ports:

sh# vi /etc/rc.local
...
bridge vlan add vid 42 dev lan1 pvid untagged
bridge vlan add vid 75 dev lan2 pvid untagged
bridge vlan del vid 1 dev lan1
bridge vlan del vid 1 dev lan2
exit 0

Disable DHCP Client

sh# vi /etc/network/interfaces
#iface eth0 inet dhcp

Enable systemd-networkd, systemd-resolved

sh# systemctl enable systemd-networkd systemd-resolved
sh# ln -svf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Enable systemd-networkd, systemd-resolved

sh# systemctl enable systemd-networkd systemd-resolved
sh# ln -svf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Netfilter

sh# apt install iptables-persistent