I wiped my Raspberry Pi today and installed the latest OS (Debian Bullseye).
It looks like there’s some changes on the networking side of things. Nothing new I guess, just that it’s new to me as this is my first Bullseye encounter.
In the past I would have files in /etc/network/interfaces.d
, or modify /etc/network/interfaces
itself. They’d contain entries like:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# The primary network interface allow-hotplug eth0 # uncomment this if you want dhcp # iface eth0 inet dhcp # I prefer static iface eth0 inet static address 192.168.1.2/23 gateway 192.168.1.1 iface eth0 inet6 static address 2a04:5000:9f05:110::2/64 |
Looks like we don’t do things that way any more. Instead, you skip the above and use /etc/dhcpcd.conf
:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
interface eth0 # If you set ip_address then dhcpcd will not attempt to obtain a lease. # Better to use inform as that tells the DHCP server this is the address we want to use. # The advantage of using inform is that all other DHCP values like DNS server etc. are got and used. Thus the DNS servers are set in resolv.conf, for instance. inform 192.168.1.2/23 # If you set ip6_address, dhcpcd will continue auto-configuration as normal. static ip6_address=2a04:5000:9f05:110::2/64 # Skipping this, get via DHCP. # static routers=192.168.17.1 # Performs a DHCPv6 Information Request. inform6 # Not specifying any manual DNS servers, I'll get these from DHCP. # static domain_name_servers=192.168.1.1 8.8.8.8 fd51:42f8:caae:d92e::1 |
You still need the interfaces
file/folder if you want to create virtual interfaces. For instance I have /etc/network/interfaces.d/eth0.0 with the following contents:
1 2 3 4 |
# "auto" means bring up along with other interfaces auto eth0.0 # IP address is configured in dhcpcd.conf iface eth0.0 inet manual |
And dhcpcd.conf
has the rest:
1 2 |
interface eth0.0 static ip_address=192.168.1.3/23 |
There’s also a /etc/network/interfaces.new
file. Not sure what that does, but I don’t care as I am using the interfaces.d
folder to add stuff and both files point to the contents of that folder.