You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Most RHEL systems use Network manager to bring up manage network connections.
Network manager does not recognize "METRIC" option for network connections.
It uses IPV4_ROUTE_METRIC and IPV6_ROUTE_METRIC options. Please see
https://people.freedesktop.org/~lkundrak/nm-docs/nm-settings-ifcfg-rh.html
This change ensures that cloud-init generates ifcfg network connection files
with IPV{4/6}_ROUTE_METRIC options that are compatible with RHEL and
network manager.
Fixes: canonicalGH-5776
Signed-off-by: Ani Sinha <anisinha@redhat.com>
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.
The text was updated successfully, but these errors were encountered: