[WL::Change] Letop; bij updaten node (WAS: Re: [WL::Commits] r13503 - in node-config/genesis: nodes/ZTWRijneke tools)

Rick van der Zwet info at rickvanderzwet.nl
Wed Nov 25 09:41:46 UTC 2015


Folks,

Ik ben bezig met code welke ervoor zorgt dat alle AP interfaces op de
Node als een gezien worden. Hierdoor is het mogelijk om de SSID op een
node gelijk te trekken zodat er lokaal geroamed kan worden. De code is
vrij minimaal getest, dus mijn advies is om het niet op missie kritische
systemen door te voeren. Er bestaat een kans dat je moet fietsen.

Met vriendelijke groet,
/Rick

On 25/11/15 10:37, rick - SVN commit wrote:
> Author: rick
> Date: Wed Nov 25 09:37:32 2015
> New Revision: 13503
>
> Log:
> Major Change: Combine accesspoint interfaces to a shared bridge interfaces
> allowing users to roam between accesspoints of local node.
>
> Modified:
>    node-config/genesis/nodes/ZTWRijneke/wleiden.yaml
>    node-config/genesis/tools/gformat.py
>
> Modified: node-config/genesis/nodes/ZTWRijneke/wleiden.yaml
> ==============================================================================
> --- node-config/genesis/nodes/ZTWRijneke/wleiden.yaml	Wed Nov 25 08:23:40 2015	(r13502)
> +++ node-config/genesis/nodes/ZTWRijneke/wleiden.yaml	Wed Nov 25 09:37:32 2015	(r13503)
> @@ -80,6 +80,7 @@
>    extra_type : "eth2wifibridge"
>    channel    : "3"
>    ssid       : "apw-ZTW-RijnekeBlvd"
> +  dhcp       : "10-250"
>    compass    : "n"
>    ns_ip      : "172.17.73.2/24"
>    ns_mac     : "00:00:00:00:00:00"
>
> Modified: node-config/genesis/tools/gformat.py
> ==============================================================================
> --- node-config/genesis/tools/gformat.py	Wed Nov 25 08:23:40 2015	(r13502)
> +++ node-config/genesis/tools/gformat.py	Wed Nov 25 09:37:32 2015	(r13503)
> @@ -515,14 +515,18 @@
>      ifname = datadump[iface_key]['autogen_ifbase']
>      if not datadump[iface_key].has_key('comment'):
>        datadump[iface_key]['comment'] = None
> -    dhcp_out[ifname].append("  ## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key])
> +
> +    if dhcp_type(datadump[iface_key]) != DHCP_SERVER:
> +      dhcp_out[iface_key].append("  ## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key])
> +    else:
> +      dhcp_out[ifname].append("  ## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key])
>  
>      (addr, mask) = datadump[iface_key]['ip'].split('/')
>      datadump[iface_key]['autogen_addr'] = addr
>      datadump[iface_key]['autogen_netmask'] = cidr2netmask(mask)
>      datadump[iface_key]['autogen_subnet'] = get_network(addr, mask)
>      if dhcp_type(datadump[iface_key]) != DHCP_SERVER:
> -      dhcp_out[ifname].append("  subnet %(autogen_subnet)s netmask %(autogen_netmask)s {\n    ### not autoritive\n  }\n" % \
> +      dhcp_out[iface_key].append("  subnet %(autogen_subnet)s netmask %(autogen_netmask)s {\n    ### not autoritive\n  }\n" % \
>          datadump[iface_key])
>        continue
>  
> @@ -629,12 +633,18 @@
>      if not dhclient_if.has_key(ifname) or dhclient_if[ifname] == False:
>        dhclient_if[ifname] = dhcp_type(ifacedump) == DHCP_CLIENT
>  
> +    # DHCP interfaces are to be added to bridge0
> +    if ifname.replace('_','.') in datadump['autogen_dhcp_interfaces']:
> +      ifname_base = 'bridge0'
> +    else:
> +      ifname_base = ifname
> +
>      # Add interface IP to list
>      item = (ifacedump['ip'], ifacedump['comment'])
> -    if addrs_list.has_key(ifname):
> -      addrs_list[ifname].append(item)
> +    if addrs_list.has_key(ifname_base):
> +      addrs_list[ifname_base].append(item)
>      else:
> -      addrs_list[ifname] = [item]
> +      addrs_list[ifname_base] = [item]
>  
>      # Alias only needs IP assignment for now, this might change if we
>      # are going to use virtual accesspoints
> @@ -764,7 +774,7 @@
>    {% endfor -%}
>    "
>  
> -  captive_portal_interfaces="{{ autogen_dhcp_interfaces|join(',')|default('none', true) }}"
> +  captive_portal_interfaces="bridge0"
>    externalif="{{ externalif|default('vr0', true) }}"
>    masterip="{{ masterip }}"
>  
> @@ -831,7 +841,7 @@
>      named_enable="YES"
>      {% if autogen_dhcp_interfaces -%}
>      dhcpd_enable="YES"
> -    dhcpd_flags="$dhcpd_flags {{ autogen_dhcp_interfaces|join(' ') }}"
> +    dhcpd_flags="$dhcpd_flags bridge0"
>      {% endif -%}
>    {% elif board == "apu1d" %}
>      #
> @@ -841,7 +851,7 @@
>      local_unbound_enable="YES"
>      {% if autogen_dhcp_interfaces -%}
>      dhcpd_enable="YES"
> -    dhcpd_flags="$dhcpd_flags {{ autogen_dhcp_interfaces|join(' ') }}"
> +    dhcpd_flags="$dhcpd_flags bridge0"
>      {% endif -%}
>    {% endif -%}
>  {% endif %}
> @@ -867,6 +877,10 @@
>      if not iface in addrs_list.keys():
>        output += "ifconfig_%s='up'\n" % iface
>  
> +  output += "\n"
> +  output += "cloned_interfaces='bridge0'\n"
> +  output += "ifconfig_bridge0='addm %s up'\n" % ' addm '.join(datadump['autogen_dhcp_interfaces'])
> +
>    # Details like SSID
>    if extra_ouput:
>      output += extra_ouput.strip() + "\n"
> @@ -878,7 +892,7 @@
>        output += "# %s || %s || %s\n" % (iface, addr, comment)
>  
>      # Write DHCLIENT entry
> -    if dhclient_if[iface]:
> +    if iface in dhclient_if and dhclient_if[iface]:
>        output += "ifconfig_%s='SYNCDHCP'\n\n" % (iface)
>      
>      # Make sure the external address is always first as this is needed in the



More information about the Change mailing list