Manually added network routes reset in qubes after suspend/resume


For some reasons, I have qubes behind a VPN in which I add a route to my local network, it works perfectly fine except when I suspend my laptop. Upon resume, the extra routes are lost.

What happens in Qubes at the resume step so that the routes are lost? It’s like if Qubes OS was resetting the network.

How could I make the routes persistent across suspend/resume?

A question out of curiosity. Is it a wireless connection?

it happens on wireless or ethernet, the route are within AppVM qubes anyway, not in sys-net (which already knows how to reach the local network of course)

1 Like

You can try to add the routes in the script in /etc/network/if-up.d/ and use bind-dirs for persistence.

This is a debian specific solution right?

NetworkManager seems to offer a similar mechanism though, thanks for mentioning it: NetworkManager-dispatcher(8) — Arch manual pages

It’s an ifupdown package. It’s installed by default in debian but I’m not sure about other OS.

NetworkManager is disabled by default in app qubes so it won’t work without enabling network-manager service for the qube.

They are using a VPN so I have network manager there :wink: I have reasons for that setup :woman_shrugging:

ifupdown doesn’t seem to exist in fedora, there is this but I’m not sure it matches ifupdown

NetworkManager-initscripts-updown.noarch : Legacy ifup/ifdown scripts for
     ...: NetworkManager that replace initscripts (network-scripts)

This post is fairly speculative.

Do the routes get lost if you manually disconnect and reconnect from the network? I’ve noticed that in my Guix qube, which manually sets up the network with a script that is function similar to ip addr add, etc, some pieces of information get lost (including the default route) if I accidentally unplug my ethernet cable.

The suspend/resume troubleshooting page discusses that drivers sometimes need to be reloaded and/or devices need to be re-attached. So perhaps the devices are getting detached and re-attached, and sys-net is automatically recovering, but there is a brief moment where the network is unavailable which causes the AppVM to discard the routing information for reasons that are mysterious to me.

1 Like

I think network-scripts package is the equivalent for ifupdown package in debian.
The NetworkManager-initscripts-updown is just using NetworkManager to call the legacy scripts in /etc/network/if* (or similar directory). Since you’re already using NetworkManager then there is no point to use the legacy scripts and it’s better to use the NetworkManager-dispatcher instead.

1 Like