enPublicProxmox VE 9.2 Debian TrixieRaspberry PI 5

Change your Raspberry PI 5 Proxmox Netboot installation from DHCP to STATIC IP addresses

This recipe show how to change from DHCP to STATIC IP addresses on your network boot Proxmox on your Raspberry PI 5.

#dhcp#netboot#proxmox#raspi5#static

The IP has to be made static in two places, because networking exists in two phases:

  1. Initramfs / netboot phase — needed so the Pi can reach the NFS root.
  2. Normal Proxmox system — vmbr0 must keep the same static address after systemd/ifupdown2 takes over.

Do not put the static IP on eth0 in the final system. The host IP belongs on vmbr0.

Using your current values:

IP:       192.168.42.107
Netmask:  255.255.254.0 = /23
Gateway:  192.168.42.1
NFS:      192.168.42.73
DNS1:     192.168.42.22
DNS2:     192.168.43.22
Hostname: pve-pi5

1. Change the netboot cmdline.txt

On your TFTP server, edit the cmdline.txt used by this Pi.

You currently likely have:

ip=dhcp

Replace only that part with:

ip=192.168.42.107:192.168.42.73:192.168.42.1:255.255.254.0:pve-pi5:eth0:off

So the full line should look roughly like this, still all on one line:

console=serial0,115200 console=tty1 root=/dev/nfs nfsroot=192.168.42.73:/srv/nfs/pve-pi5,vers=3,tcp boot=nfs rw ip=192.168.42.107:192.168.42.73:192.168.42.1:255.255.254.0:pve-pi5:eth0:off rootwait cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 apparmor=1 security=apparmor psi=1

The important part is:

ip=CLIENT:NFS-SERVER:GATEWAY:NETMASK:HOSTNAME:DEVICE:AUTOCONF

So:

192.168.42.107
192.168.42.73
192.168.42.1
255.255.254.0
pve-pi5
eth0
off

off means: do not use DHCP.

Your early bridge script will then do:

eth0 gets 192.168.42.107
        ↓
vmbr0 created
        ↓
eth0 attached to vmbr0
        ↓
192.168.42.107 moved to vmbr0

Exactly what we want.

2. Set the same IP in /etc/network/interfaces

On the Pi's NFS root:

nano /etc/network/interfaces

Use:

auto lo
iface lo inet loopback

iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.42.107/23
        gateway 192.168.42.1
        bridge-ports eth0
        bridge-stp off
        bridge-fd 0

source /etc/network/interfaces.d/*

The important distinction is:

eth0 = no IP
vmbr0 = 192.168.42.107/23

Do not configure:

iface eth0 inet static

because that would conflict with the Proxmox bridge design.

3. Fix /etc/hosts

Edit:

nano /etc/hosts

For example:

127.0.0.1       localhost
192.168.42.107  pve-pi5.home.arpa pve-pi5

::1             localhost ip6-localhost ip6-loopback

If you use a real internal domain instead of home.arpa, use that.

Then:

hostnamectl set-hostname pve-pi5

Check:

hostname
hostname -f
getent hosts pve-pi5

You want pve-pi5 to resolve to:

192.168.42.107

and not 127.0.1.1.

4. Set DNS statically too

First check:

ls -l /etc/resolv.conf

If it is a normal file, you can simply use:

cat >/etc/resolv.conf <<'EOF'
nameserver 192.168.42.22
nameserver 192.168.43.22
EOF

Then:

cat /etc/resolv.conf

If /etc/resolv.conf is a symlink to systemd-resolved, tell me what:

ls -l /etc/resolv.conf

returns and we'll configure resolved instead.

5. Make sure DHCP will not hand .107 to someone else

Even though the Pi itself will no longer use DHCP, make sure your DHCP server doesn't assign:

192.168.42.107

to another machine.

Either exclude it from the DHCP pool or keep a reservation for the Pi's MAC:

e4:5f:01:ce:f8:f1

A reservation is still useful purely to prevent conflicts; the Pi itself will use the static address from cmdline.txt.

6. Do not live-reload networking

Because your entire root filesystem is NFS-mounted over this connection, I would not now run:

ifreload -a

or:

systemctl restart networking

Instead verify the files and reboot:

sync
reboot

That tests the entire intended boot path.

7. What you should see during boot

Instead of:

IP-Config: eth0 ... DHCP

you should now see the static configuration.

Then your early bridge code should produce roughly:

PVE early bridge: converting eth0 to vmbr0
PVE early bridge: address=192.168.42.107/23
PVE early bridge: gateway=192.168.42.1
...
vmbr0: port 1(eth0) entered forwarding state

The NFS root should then mount through vmbr0.

8. Verify after boot

First:

ip -br addr

Expected:

lo       UNKNOWN  127.0.0.1/8
eth0     UP
vmbr0    UP       192.168.42.107/23

There should be no IPv4 address on eth0.

Then:

ip route

Expected:

default via 192.168.42.1 dev vmbr0
192.168.42.0/23 dev vmbr0 proto kernel scope link src 192.168.42.107

Most important for your NFS root:

ip route get 192.168.42.73

You want:

192.168.42.73 dev vmbr0 src 192.168.42.107

Then:

findmnt /

should still show your NFS root.

Finally:

ping -c 3 192.168.42.73
ping -c 3 192.168.42.1
ping -c 3 1.1.1.1
getent hosts download.proxmox.com

If all four work, you have a fully static Proxmox host IP.

Final desired state

                 192.168.42.107/23
                         │
                      vmbr0
                     /     \
                  eth0      VM tap interfaces
                   │
                 LAN
                   │
       ┌───────────┴────────────┐
       │                        │
192.168.42.73              192.168.42.1
NFS/TFTP                    Gateway

The key is that cmdline.txt and /etc/network/interfaces must contain the same IP/network configuration. The former gets you to the NFS root; the latter keeps Proxmox networking consistent after the real system starts.