produced a interface config file something like this:
# cat /etc/sysconfig/network-scripts/ifcfg-ens160
# Created by cloud-init automatically, do not edit.
#
AUTOCONNECT_PRIORITY=120
BOOTPROTO=none
DEFROUTE=yes
DEVICE=ens160
GATEWAY=172.16.127.2
IPADDR=172.16.127.125
METRIC=99
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
However, the route is not configured with this metric:
# # ip r show
default via 172.16.127.2 dev ens160 proto static metric 100
172.16.127.0/24 dev ens160 proto kernel scope link src 172.16.127.125 metric 100
NetworkManager does not recognize METRIC for global generic metric value
nmcli con mod 'System ens160' ipv4.route-metric 90
# grep -i metric /etc/sysconfig/network-scripts/ifcfg-ens160
IPV4_ROUTE_METRIC=90
nmcli con up 'System ens160'
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)
# ip r show
default via 172.16.127.2 dev ens160 proto static metric 90
172.16.127.0/24 dev ens160 proto kernel scope link src 172.16.127.125 metric 90
The following config
produced a interface config file something like this:
However, the route is not configured with this metric:
NetworkManager does not recognize METRIC for global generic metric value
NM uses IPV4_ROUTE_METRIC and IPV6_ROUTE_METRIC.
See also https://people.freedesktop.org/~lkundrak/nm-docs/nm-settings-ifcfg-rh.html and https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html-single/configuring_and_managing_networking/index#con_how-networkmanager-manages-multiple-default-gateways_managing-the-default-gateway-setting
We need to fix this.