fix handling wan with added subnets
This commit is contained in:
10
install.py
10
install.py
@ -206,8 +206,8 @@ def create_if(name, cfg, mac, dhcp_server_cfg):
|
|||||||
dhcp_server_cfg.append(('0.0.0.0/128.0.0.0', []))
|
dhcp_server_cfg.append(('0.0.0.0/128.0.0.0', []))
|
||||||
dhcp_server_cfg.append(('128.0.0.0/192.0.0.0', []))
|
dhcp_server_cfg.append(('128.0.0.0/192.0.0.0', []))
|
||||||
for nw in cfg.split(',')[1:]:
|
for nw in cfg.split(',')[1:]:
|
||||||
nw = IPv4Interface(cfg).network
|
nw = IPv4Interface(nw).network
|
||||||
dhcp_server_cfg.append((nw.with_netmask.split('/'), []))
|
dhcp_server_cfg.append((nw.with_netmask, []))
|
||||||
else:
|
else:
|
||||||
cfgip = IPv4Interface(cfg)
|
cfgip = IPv4Interface(cfg)
|
||||||
network = cfgip.network
|
network = cfgip.network
|
||||||
@ -365,7 +365,11 @@ def handle_config():
|
|||||||
if dhcp_server_cfg:
|
if dhcp_server_cfg:
|
||||||
content = [DHCP_HEADER]
|
content = [DHCP_HEADER]
|
||||||
for subnet, rangelist in dhcp_server_cfg:
|
for subnet, rangelist in dhcp_server_cfg:
|
||||||
adr, mask = subnet.split('/')
|
try:
|
||||||
|
adr, mask = subnet.split('/')
|
||||||
|
except Exception as e:
|
||||||
|
print(subnet, repr(e))
|
||||||
|
continue
|
||||||
content.append('subnet %s netmask %s {\n' % (adr, mask))
|
content.append('subnet %s netmask %s {\n' % (adr, mask))
|
||||||
#content.append(' option netmask %s;\n' % mask)
|
#content.append(' option netmask %s;\n' % mask)
|
||||||
for rng in rangelist:
|
for rng in rangelist:
|
||||||
|
Reference in New Issue
Block a user