NetworkManager-openvpn ignores metric
Hello,
I have a problem where I connect to 2 OpenVPN servers at the same time which advertise the same set of routes, but with different metrics. Example:
-
Server A does this:
push "route 111.0.0.0 255.255.255.0 vpn_gateway 500";
push "route 222.0.0.0 255.255.255.0 vpn_gateway 1000"; -
Server B does this:
push "route 222.0.0.0 255.255.255.0 vpn_gateway 500";
push "route 111.0.0.0 255.255.255.0 vpn_gateway 1000";
For context, 111/24 is local to Server A and 222/24 is local to Server B; there is an ipsec tunnel between them and connecting to either will allow access to both 111/24 and 222/24, however the latency is high due to the ipsec tunnel etc and by respecting the metrics a user could connect to both servers at the same time and each connection would prioritise via metric value its local subnet/route.
When using the official OpenVPN client the metrics are set properly, when using NetworkManager-openvpn they are ignored and all the received routes are set to metric 50.
Setting route-metric would not help in this case as it would still set the same metric for all pushed routes.
Can you please update the code so that the metrics are respected?
I'm using Fedora 36 and these are currently the packages and versions, if it matters:
NetworkManager-openvpn-1.8.18-1.fc36.x86_64
NetworkManager-openvpn-gnome-1.8.18-1.fc36.x86_64
openvpn-2.5.9-1.fc36.x86_64
Thank you