[Debian 12] Problems Setting Default Route with ifupdown2 (/etc/network/interfaces) with more than one NIC

I have two virtual NICs set up in my Debian 12 VM on Proxmox 9. Both NICs are configured to use DHCP to get their IP and other network settings (except as overridden in the config, see below).

VLAN10: The VLAN that is meant to have internet access.
VLAN200: My high-speed storage network.

Now that I’m implementing more firewall rules, I’m realizing that Debian 12 (or rather, the version of ifupdown2 that ships with it) seems to have some issues letting users set a default route in a way that survives reboot.

As shown below, I want my default route to be 10.10.10.1, as that VLAN has a set of rules that allow it to access the WAN and use DHCP and DNS from the upstream firewall.

EDIT: I lose internet access if VLAN200 doesn’t have WAN access. Even though VLAN10 does have WAN access and there’s a route there, the server won’t fail over and use it.

But as you can see below, it’s setting the default route to VLAN 200 and I have no idea how to make it not do that. I tried manually setting a gateway address to designate the default gateway per some older tutorials, but that’s not going it.

I’ve also read that this might be a known issue in the version of ifupdown2 that shipped with Debian 12, but I’m not sure about that.

Diagnostic info below. Thanks for any advice. :slight_smile:

root@memory-alpha2:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

root@memory-alpha2:~# uname -a
Linux memory-alpha2 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64 GNU/Linux
root

root@memory-alpha2:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp6s18
iface enp6s18 inet dhcp
    gateway 10.10.10.1
    dns-nameservers 10.10.10.1

root@memory-alpha2:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp6s18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc fq_codel state UP group default qlen 1000
    link/ether bc:24:11:48:22:88 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.47/24 brd 10.10.10.255 scope global dynamic enp6s18
       valid_lft 6709sec preferred_lft 6709sec
    inet6 fe80::be24:11ff:fe48:2288/64 scope link 
       valid_lft forever preferred_lft forever
3: enp6s19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc fq_codel state UP group default qlen 1000
    link/ether bc:24:11:eb:1b:6c brd ff:ff:ff:ff:ff:ff
    inet 10.10.200.9/24 brd 10.10.200.255 scope global dynamic enp6s19
       valid_lft 6456sec preferred_lft 6456sec
    inet6 fe80::be24:11ff:feeb:1b6c/64 scope link 
       valid_lft forever preferred_lft forever

root@memory-alpha2:~# ip route
default via 10.10.200.1 dev enp6s19 
10.10.10.0/24 dev enp6s18 proto kernel scope link src 10.10.10.47 
10.10.200.0/24 dev enp6s19 proto kernel scope link src 10.10.200.9

root@memory-alpha2:~# ifup --version
ifup version 0.8.41

...

root@memory-alpha2:~# ifdown --version
ifdown version 0.8.41

Copyright (c) 1999-2009 Anthony Towns
              2010-2015 Andrej Shadura
              2015-2017 Guus Sliepen

...

Note: never had to do this, meaning all info as is!

My initial reaction was that you’d need to bind physical ports and VLANs. Have a look at rpcbind:

HTH!

Do you have some other file in /etc/network/interfaces.d/? based on that network config snippet there is nothing bringing enp6s19 up, so it’s unclear how it is overwriting/updating the route table.

I’d focus on determining how enp6s19 is being brought up. Maybe you’ve got systemd-networkd or NetworkManager also configuring network interfaces.

If you just want to fix it without investigating that you could probably just add an if-up.d script which sets your routing table to the desired value after any interface comes up

So, terrible news. Through some combination of rebooting a few times and adjusting something on my ONPSense firewall rules for this VLAN (and possibly just getting really, really mad at the servers in question), it appears to be working as intended now.

root@memory-alpha2:~# ip route
default via 10.10.10.1 dev enp6s18 
10.10.10.0/24 dev enp6s18 proto kernel scope link src 10.10.10.47 
10.10.200.0/24 dev enp6s19 proto kernel scope link src 10.10.200.9 

I have no idea what changed at this point to get the default to stick.
I did just update the system from a much older version of Debian 12 (it was at least a couple of point releases behind), so maybe that fixed some sort of bug with ifupdown2?

Sorry to get everyone chasing a problem that doesn’t seem to exist anymore. -_- I really appreciate the help.

Oof. Sorry. I forgot to paste in that file.

antonia84@memory-alpha2:~$ cat /etc/network/interfaces.d/10-storagenet.config 
# Configuration for Storage Network NIC

auto enp6s19
iface enp6s19 inet dhcp

Pasting them both, I notice that this is an auto interface, and the primary was allow-hotplug.

(I think I did that on the primary interface because that’s the only interface SSH is bound to, and the interface wasn’t coming up fast enough on boot and the SSH daemon was freaking out and failing to start.)

EDIT: I have another Debian 12 VM showing the same symptoms as the original post, that I haven’t fixed yet, so I’m going to try to fix that and actually pay closer attention to when it starts working. :stuck_out_tongue:

EDIT 2: Okay.

  1. You have to edit the file, and then reboot for the change to take effect.
  2. systemctl restart networking is ineffective to change the active route. (I suppose you could manually use the ip route default command to change it at runtime, as well.)
  3. I’m logged in via SSH, so I didn’t try to use ifup to restart the interface, because I thought it would kick me and also the tutorial I read indicated that systemctl restart networking would be enough.

So, it seems this thread was largely motivated by me reading not-the-best tutorial and being too tired to try rebooting first.

(In my vague defense, I’ve been working on firewall rules the last couple of days and was in a bit of a panic when I realized several of my VMs had lost working gateways or DNS server access because of issues with default routes and (let’s be honest) improper interface configurations on my end.

Again, sorry for the false alarm thread.

EDIT 3: I take it back. I duplicated the working configuration on memory-alpha2 on a second Debian 12 machine, grimorum, and it’s still not behaving correctly.

root@grimorum:~# ip route
default via 10.10.200.1 dev enp6s19 
10.10.20.0/24 dev enp6s18 proto kernel scope link src 10.10.20.2 
10.10.200.0/24 dev enp6s19 proto kernel scope link src 10.10.200.243 

root@grimorum:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp6s18
iface enp6s18 inet dhcp
    gateway 10.10.20.1
    dns-nameservers 10.10.20.1

root@grimorum:~# cat /etc/network/interfaces.d/10-storagenet.config 
auto enp6s19
iface enp6s19 inet dhcp

EDIT 4:
Rebooting twice seems to have fixed it. And it’s still set properly after a fourth reboot.

eratosthenes47@grimorum:~$ ip route
default via 10.10.20.1 dev enp6s18 
10.10.20.0/24 dev enp6s18 proto kernel scope link src 10.10.20.2 
10.10.200.0/24 dev enp6s19 proto kernel scope link src 10.10.200.243 

What.

1 Like

So. Um. Good?

I kind of hate that. I have no idea why two reboots fixed it when one didn’t. Alas.

I’m starting not to like ifupdown2. When I was just getting started with Serious Hobbyist Linux Things way back with Proxmox 7, it was nice to just be able to read and edit a simple config file to change the network settings.

But when it gets obscure and weird, it gets really obscure and weird.

Yeah I find ifupdown2 behaves weirdly, imo both NetworkManager and systemd-networkd are nicer. I run systemd-networkd exclusively throughout my networks.

2 Likes

From what I’ve seen ifupdown2 will still be the default in Debian 14.

I’m more of a hobbyist than I’d like to admit. I’m not sure how comfortable I’d be ripping out and replacing the network infrastructure for my Debian servers.

But I’d really like to.
I got to use Netplan once and from what I’ve seen systemd-networkd is also a nicer experience. :stuck_out_tongue:

EDIT: I forget which system I had that I used nmcli to manage the network, but that was awesome, too. I always forget about Network Manager for servers because I’m so used to thinking of it as GUI-only given how I first encountered it.