diff --git a/cloudinit/net/ephemeral.py b/cloudinit/net/ephemeral.py index 1dfd1c428e1..651cefa6451 100644 --- a/cloudinit/net/ephemeral.py +++ b/cloudinit/net/ephemeral.py @@ -197,6 +197,14 @@ def _bringup_static_routes(self): via_arg = [] if gateway != "0.0.0.0": via_arg = ["via", gateway] + + # Use "append" rather than "add" since the DHCP server may provide + # rfc3442 classless static routes with multiple routes to the same + # subnet via different routers or local interface addresses. + # + # In this scenario, `ip r add` fails. + # + # RHBZ: #2003231 subp.subp( ["ip", "-4", "route", "append", net_address] + via_arg