Document toolboxDocument toolbox

Use RevPi modules as a network switch

 

This application note is available in our GitHub repository as an Ansible playbook.

https://github.com/RevolutionPi/revpi-ansible-recipes/tree/master/roles/network-bridge

You can combine two ports into one bridge. The global functionality is explained here: https://wiki.debian.org/BridgeNetworkConnections#Configuring_bridging_in_.2Fetc.2Fnetwork.2Finterfaces.

An example has been done, and the configuration file located in /etc/network/interfaces has to be edited as below: Using our example names, make it look like this, and you’re set (if you want to use DHCP):

# interfaces(5) file used by ifup(8) and ifdown(8) # Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' # allow-hotplug eth0 # allow-hotplug eth1 # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d #This file describes the network interfaces available on your system #and how to activate them. For more information, see interfaces(5). #The loopback network interface auto lo iface lo inet loopback #RJ45 - Ethernet Port A auto eth0 iface eth0 inet manual pre-up ip link set eth0 up post-down ip link set eth0 down || true #RJ45 - Ethernet Port B auto eth1 iface eth1 inet manual pre-up ip link set eth1 up post-down ip link set eth1 down || true #Bridge (brctl) auto br0 iface br0 inet dhcp pre-up brctl addbr br0 && brctl addif br0 eth0 eth1 post-down { brctl delif br0 eth0 eth1 && brctl delbr br0 } || true