Categories
Linux Open Source Technology Ubuntu

Raspberry PI4 upgrade to bullseye and LXC notes

So whilst guides like this one: https://www.tomshardware.com/how-to/upgrade-raspberry-pi-os-to-bullseye-from-buster are very useful there were a couple of extra things that I needed to fix.

  1. I needed to update /etc/apt/sources.list.d/raspi.list in addition to /etc/apt/sources.list – changing buster to bullseye
  2. LXC config for networking caused issues to the networking

Point 1 is explained above but point 2 took me a while to figure out what was wrong. And this is only really relevant if you are using LXC (Linux Containers – a lightweight precursor to Docker / K8s). I am documenting this for anyone else who might be seeing issues (or my forgetful future self!). Also note that trying to define the static IP via dhcpcd.conf didn’t work (although perhaps as I was trying to configure eth0 rather than lxcbr0?!)

# 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'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# attempting to configuring eth0 here 
# like the below will cause multiple errors!
auto eth0
iface eth0 static
    address 192.168.x.y
    netmask 255.255.255.0
    gateway 192.168.a.b
 
auto lxcbr0
iface lxcbr0 inet dhcp
    bridge_ports eth0
    bridge_fd 0
    bridge_maxwait 0
    
# wifi
allow-hotplug wlan0
iface wlan0 inet dhcp
        wpa-ssid SSID
        wpa-psk KEY

What it needs to look like (the static IP part is configured within the LXC definition).

# interfaces(5) file used by ifup(8) and ifdown(8)



# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

#eth0 - built in ethernet is configured via the LXC bridge
# DO NOT CONFIGURE IT SEPERATELY OR networking and LXC will give errors

auto lxcbr0
iface lxcbr0 inet static
    bridge_ports eth0
    bridge_fd 0
    bridge_maxwait 0
    address 192.168.x.y
    netmask 255.255.255.0
    gateway 192.168.a.b

x.y and a.b are replaced by your actual addresses of course. Hope this helps someone (and I remember it if I need it again!)

By Ollie Cronk

See the About page!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.