diff --git a/README.md b/README.md index 8bb9817..90a5b57 100644 --- a/README.md +++ b/README.md @@ -526,7 +526,8 @@ The IP configuration supports the following options: [`ipv6.route-metric`](https://developer.gnome.org/NetworkManager/stable/nm-settings.html#nm-settings.property.ipv6.route-metric) properties, respectively. If specified, it determines the route metric for DHCP assigned routes and the default route, and thus the priority for multiple - interfaces. + interfaces. For `initscripts`, `route_metric4` sets the metric for the default + route and `route_metric6` is not supported. - `route` diff --git a/library/network_connections.py b/library/network_connections.py index 02659cc..074d79b 100644 --- a/library/network_connections.py +++ b/library/network_connections.py @@ -323,8 +323,6 @@ class IfcfgUtil: if ip["dhcp4_send_hostname"] is not None: warn_fcn("ip.dhcp4_send_hostname is not supported by initscripts provider") - if ip["route_metric4"] is not None and ip["route_metric4"] >= 0: - warn_fcn("ip.route_metric4 is not supported by initscripts provider") if ip["route_metric6"] is not None and ip["route_metric6"] >= 0: warn_fcn("ip.route_metric6 is not supported by initscripts provider") @@ -516,6 +514,9 @@ class IfcfgUtil: else: ifcfg["DEFROUTE"] = "no" + if ip["route_metric4"] is not None and ip["route_metric4"] >= 0: + ifcfg["METRIC"] = str(ip["route_metric4"]) + route4 = [] route6 = [] for r in ip["route"]: