ifcfg-rh: support route options

System Internals / NetworkManager - Beniamino Galvani [redhat.com] - 6 March 2017 09:20 EST

For IPv4 we support both the legacy and the new route file format. In the legacy format, option are appended to the "ip route" command arguments:

203.0.113.0/24 metric 3 via 198.51.100.1 dev eth2 cwnd 14 mtu lock 1500

This is backwards compatible with initscripts. In the new format, a OPTIONSx= variable is added to represent the options in the same format understood by iproute2:

ADDRESS0=203.0.113.0 NETMASK0=255.255.255.0 GATEWAY0=198.51.100.1 METRIC0=3 OPTIONS0="cwnd 14 mtu lock 1500"

initscripts do not support this variable at the moment (but the changes needed to support it are trivial).

By default the new format is used, unless the route file is already in the legacy format.

For IPv6 only the legacy format is supported, as before.

40e1fd9 ifcfg-rh: support route options
libnm-core/nm-setting-ip4-config.c | 2 +-
.../plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 164 +++++++++++++++++++--
.../plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 118 ++++++++++++---
.../network-scripts/route-test-wired-static-routes | 1 +
.../route-test-wired-static-routes-legacy | 2 +-
.../network-scripts/route6-test-wired-ipv6-manual | 2 +
.../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 36 ++++-
7 files changed, 292 insertions(+), 33 deletions(-)

Upstream: cgit.freedesktop.org


  • Share