Adding VLAN Support to Raspberry Pi Bookworm

The standard Allonis Raspberry Pi Bookworm image requires the following additional OS modifications to fully support a working VLAN environment.

To ensure that all multicast traffic is routed to all VLANs on a Raspberry Pi, you need to configure the Raspberry Pi to act as a multicast router. This involves the following steps:

  1. Static set Pi's eth0 IP address:  This reduces risk that the Pi can't reach the House Network's DHCP server.
  2. Enable IP forwarding: This allows the Raspberry Pi to forward packets between different network interfaces.
  3. Install and configure igmpproxy: This tool will forward multicast traffic between network interfaces.
  4. Set up VLAN interfaces: Configure VLAN interfaces on the Raspberry Pi using NetworkManager.

 

Prerequisites

Gather the list of VLANS that are in use on the network. You will need the VLAN id and IP address that was assigned to the VLAN interface on the upstream switch.  Setup the Switch using THESE steps.

This document will make the following assumptions. Modify as necessary for your active installation.

VLAN10 (Control) ID = 10, IP Address = 10.10.10.249/24

VLAN20 (AVOIP) ID = 20, IP Address = 10.10.20.249/24

VLAN30 (AES67) ID = 30, IP Address = 10.10.30.249/24

Step-by-Step Guide

  1. Right click on the network status icon on the Raspberry OS Desktop and select the Wireless & Wired Network Settings.
  2. Select the appropriate interface. If you're configuring a static IP for Wi-FI, choose wlan0. For Ethernet, choose eth0.
  3. Enter the IP addresses into the relevant fields.  Your desired IP address will be in the IPv4 field, followed by a /24. Your router's IP and DNS server's IP will be in the fields named after them.
  4. Click Applyclose the window and reboot your Pi.

    Your Pi will now attempt to use your desired IP address at each boot. However, the Network Preferences menu sets this as a preference, not an absolute. So, if the IP address you asked for is not available, it will use another.

  5. Install the required software.

From a terminal window

                sudo apt update / sudo apt upgrade

                sudo apt install tcpdump

                sudo apt install igmpproxy

  1. Enable IP Forwarding

Edit the /etc/sysctl.conf file and set net.ipv4.ip_forward to 1:

               

sudo nano /etc/sysctl.conf

                Uncomment or add the line         net.ipv4.ip_forward=1

                Save the changes

                Activate the changes by                 sudo sysctl -p

  1. Configure igmpproxy

sudo nano /etc/igmpproxy.conf

replace the contents of this file with the following

quickleave

# Upstream interface (main network interface connected

# to the source of multicast traffic)

phyint eth0 upstream  ratelimit 0  threshold 1

        altnet 0.0.0.0/0

# Downstream interfaces (VLAN interfaces)

phyint vlan10 downstream  ratelimit 0  threshold 1

phyint vlan20 downstream  ratelimit 0  threshold 1

phyint vlan30 downstream  ratelimit 0  threshold 1

save the edits.

  1. Enable and start the igmpproxy service to ensure it starts on boot:

sudo systemctl enable igmpproxy

sudo systemctl start igmpproxy

  1. Set Up VLAN Interfaces

Open a terminal and issue the following commands. Modify as necessary for your specific VLANS and primary interface name.

sudo nmcli connection add type vlan con-name vlan10 ifname vlan10 dev eth0 id 10 ip4 10.10.10.251/24

sudo nmcli connection add type vlan con-name vlan20 ifname vlan20 dev eth0 id 20 ip4 10.10.20.215/24

sudo nmcli connection add type vlan con-name vlan30 ifname vlan30 dev eth0 id 30 ip4 10.10.30.251/24

sudo systemctl restart NetworkManager

  1. Multicast Traffic Monitoring

Use these commands to look for multicast traffic.

sudo tcpdump -i vlan10 multicast

sudo tcpdump -i vlan20 multicast

sudo tcpdump -i vlan30 multicast