Relevant for:
Distributed Switch Architecture (DSA) is a subsystem of the Linux kernel for managing Ethernet switches. DSA maps the individual ports of a supported Ethernet switch as separate Linux network interfaces. This allows you to configure the ports independently of each other, e.g. with different IP addresses.
In addition to lan0, the RevPi Flat S has an integrated Ethernet switch with three ports. After DSA has been activated, these ports are available as swp1, swp2 and swp3.
The following interfaces are available on the RevPi Flat S:
-
lan1: internal network interface between the Linux system and the Ethernet switch -
swp1: first switch port -
swp2: second switch port -
swp3: third switch port
Activating DSA #
You can activate DSA via a device tree parameter:
▷ Log in to the RevPi via a terminal.
▷ Open the file config.txt:
sudo nano /boot/firmware/config.txt
▷ Add the following line at the beginning of the file:
dtparam=dsa
▷ Save the file.
▷ Restart the RevPi:
sudo reboot
Checking DSA #
▷ After the restart, display the available network interfaces:
ip a
If DSA is activated, the three switch ports are displayed as separate network interfaces, e.g.:
3: lan1: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
link/ether c8:3e:a7:13:9e:57 ...
4: swp3@lan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> ...
link/ether c8:3e:a7:13:9e:5a ...
5: swp2@lan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> ...
link/ether c8:3e:a7:13:9e:59 ...
6: swp1@lan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> ...
link/ether c8:3e:a7:13:9e:58 ...
The names swp1@lan1, swp2@lan1 and swp3@lan1 show that the three switch ports are connected to the Linux system via lan1.
If swp1, swp2 and swp3 are displayed, DSA is activated.
Configuring Switch Ports Individually #
After activation, you can configure the three switch ports independently of each other.
For example, you can use NetworkManager to assign a separate IPv4 address to each port:
sudo nmcli connection add type ethernet ifname swp1 con-name swp1 ip4 10.100.1.1/24
sudo nmcli connection add type ethernet ifname swp2 con-name swp2 ip4 10.100.2.1/24
sudo nmcli connection add type ethernet ifname swp3 con-name swp3 ip4 10.100.3.1/24