Commit eb8606f1 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Add possibility to set gateway in --networkmanager mode

parent fa952f19
......@@ -259,6 +259,13 @@ def configure_networking(connection, interface, settings=None):
update['ipv4', 'never-default'] = None
update['ipv6', 'never-default'] = None
pass
ipv4gw = list(filter(None, [ ip.gateway[0] for ip in interface._ip_]))
if ipv4gw:
if len(ipv4gw) != 1:
raise Exception('Only one gateway allowed')
update['ipv4', 'gateway'] = ipv4gw[0]
update['ipv4', 'never-default'] = None
pass
ipv6gw = list(filter(None, [ ip.gateway[0] for ip in interface._ipv6_]))
if ipv6gw:
if len(ipv6gw) != 1:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment