Changeset 13503 in genesis
- Timestamp:
- Nov 25, 2015, 9:37:32 AM (9 years ago)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/ZTWRijneke/wleiden.yaml
r13502 r13503 81 81 channel : "3" 82 82 ssid : "apw-ZTW-RijnekeBlvd" 83 dhcp : "10-250" 83 84 compass : "n" 84 85 ns_ip : "172.17.73.2/24" -
tools/gformat.py
r13435 r13503 516 516 if not datadump[iface_key].has_key('comment'): 517 517 datadump[iface_key]['comment'] = None 518 dhcp_out[ifname].append(" ## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key]) 518 519 if dhcp_type(datadump[iface_key]) != DHCP_SERVER: 520 dhcp_out[iface_key].append(" ## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key]) 521 else: 522 dhcp_out[ifname].append(" ## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key]) 519 523 520 524 (addr, mask) = datadump[iface_key]['ip'].split('/') … … 523 527 datadump[iface_key]['autogen_subnet'] = get_network(addr, mask) 524 528 if dhcp_type(datadump[iface_key]) != DHCP_SERVER: 525 dhcp_out[if name].append(" subnet %(autogen_subnet)s netmask %(autogen_netmask)s {\n ### not autoritive\n }\n" % \529 dhcp_out[iface_key].append(" subnet %(autogen_subnet)s netmask %(autogen_netmask)s {\n ### not autoritive\n }\n" % \ 526 530 datadump[iface_key]) 527 531 continue … … 630 634 dhclient_if[ifname] = dhcp_type(ifacedump) == DHCP_CLIENT 631 635 636 # DHCP interfaces are to be added to bridge0 637 if ifname.replace('_','.') in datadump['autogen_dhcp_interfaces']: 638 ifname_base = 'bridge0' 639 else: 640 ifname_base = ifname 641 632 642 # Add interface IP to list 633 643 item = (ifacedump['ip'], ifacedump['comment']) 634 if addrs_list.has_key(ifname ):635 addrs_list[ifname ].append(item)644 if addrs_list.has_key(ifname_base): 645 addrs_list[ifname_base].append(item) 636 646 else: 637 addrs_list[ifname ] = [item]647 addrs_list[ifname_base] = [item] 638 648 639 649 # Alias only needs IP assignment for now, this might change if we … … 765 775 " 766 776 767 captive_portal_interfaces=" {{ autogen_dhcp_interfaces|join(',')|default('none', true) }}"777 captive_portal_interfaces="bridge0" 768 778 externalif="{{ externalif|default('vr0', true) }}" 769 779 masterip="{{ masterip }}" … … 832 842 {% if autogen_dhcp_interfaces -%} 833 843 dhcpd_enable="YES" 834 dhcpd_flags="$dhcpd_flags {{ autogen_dhcp_interfaces|join(' ') }}"844 dhcpd_flags="$dhcpd_flags bridge0" 835 845 {% endif -%} 836 846 {% elif board == "apu1d" %} … … 842 852 {% if autogen_dhcp_interfaces -%} 843 853 dhcpd_enable="YES" 844 dhcpd_flags="$dhcpd_flags {{ autogen_dhcp_interfaces|join(' ') }}"854 dhcpd_flags="$dhcpd_flags bridge0" 845 855 {% endif -%} 846 856 {% endif -%} … … 868 878 output += "ifconfig_%s='up'\n" % iface 869 879 880 output += "\n" 881 output += "cloned_interfaces='bridge0'\n" 882 output += "ifconfig_bridge0='addm %s up'\n" % ' addm '.join(datadump['autogen_dhcp_interfaces']) 883 870 884 # Details like SSID 871 885 if extra_ouput: … … 879 893 880 894 # Write DHCLIENT entry 881 if dhclient_if[iface]:895 if iface in dhclient_if and dhclient_if[iface]: 882 896 output += "ifconfig_%s='SYNCDHCP'\n\n" % (iface) 883 897
Note:
See TracChangeset
for help on using the changeset viewer.