Remove / replace default route on ipv4 hosts

This commit is contained in:
Nico Schottelius 2019-03-31 10:51:47 +02:00
commit c5a3be5ccf
2 changed files with 20 additions and 7 deletions

View file

@ -330,6 +330,7 @@ class L2Controller(object):
log.debug("Config v4 host: {} {}->{} on {}".format(host, net, ipaddr, dev))
subprocess.call(["mx", host, "ip", "addr", "flush", "dev", dev])
subprocess.call(["mx", host, "ip", "route", "del", "default"])
subprocess.call(["mx", host, "ip", "addr", "add", ipaddr, "dev", dev])
if router: