The route-metric has a per-device-type-default [1] and this global default can be overwritten (globally) [2].\
But more importantly, you can configure the route-metric per-connection too. Ok, it's not as granular as "route by route", but it's also more then "can be set globally only"!
I suspect that is sufficient to model your use-case, or why not?
Say, you connect to your office sites via a ethernet connection. If you configure it to have route-metric 49, then you'll get:
default via eth0 metric 49
172.16.42.0/24 via eth0 metric 49
172.16.0.0/16 via vpn metric 50
if you plugin your notebook in office-site #2 you'll get:
default via eth0 metric 49
172.16.23.0/24 via eth0 metric 49
172.16.0.0/16 via vpn metric 50
[1] 50 for VPN, 100 for ethernet, 600 for Wi-Fi, etc.
[2] see CONNECTION SECTION in `man NetworkManager.conf`
The route-metric has a per-device- type-default [1] and this global default can be overwritten (globally) [2].\
But more importantly, you can configure the route-metric per-connection too. Ok, it's not as granular as "route by route", but it's also more then "can be set globally only"!
I suspect that is sufficient to model your use-case, or why not?
Say, you connect to your office sites via a ethernet connection. If you configure it to have route-metric 49, then you'll get:
default via eth0 metric 49
172.16.42.0/24 via eth0 metric 49
172.16.0.0/16 via vpn metric 50
if you plugin your notebook in office-site #2 you'll get:
default via eth0 metric 49
172.16.23.0/24 via eth0 metric 49
172.16.0.0/16 via vpn metric 50
[1] 50 for VPN, 100 for ethernet, 600 for Wi-Fi, etc. conf`
[2] see CONNECTION SECTION in `man NetworkManager.