Skip to content
Snippets Groups Projects
Select Git revision
  • 561941d6a9d0f798faf32e12843a79713045d94f
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
41 results

index.rst

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    400-next-node 1.10 KiB
    #!/usr/bin/lua
    
    local site = require 'gluon.site_config'
    local uci = require 'luci.model.uci'
    local ip = require 'luci.ip'
    
    local c = uci.cursor()
    
    
    c:delete('network', 'local_node_dev')
    c:section('network', 'device', 'local_node_dev',
    	  {
    		  name = 'local-node',
    		  ifname = 'br-client',
    		  type = 'macvlan',
    		  macaddr = site.next_node.mac,
    	  }
    )
    
    local prefix4 = ip.IPv4(site.prefix4)
    c:delete('network', 'local_node')
    c:section('network', 'interface', 'local_node',
    	  {
    		  ifname = 'local-node',
    		  proto = 'static',
    		  ipaddr = site.next_node.ip4,
    		  netmask = prefix4:mask():string(),
    		  ip6addr = site.next_node.ip6 .. '/128',
    	  }
    )
    
    c:delete('network', 'local_node_route6')
    c:section('network', 'route6', 'local_node_route6',
    	  {
    		  interface = 'client',
    		  target = site.prefix6,
    		  gateway = '::',
    	  }
    )
    
    c:save('network')
    c:commit('network')
    
    c:delete('firewall', 'local_node')
    c:section('firewall', 'zone', 'local_node',
    	  {
    		  name = 'local_node',
    		  network = {'local_node'},
    		  input = 'ACCEPT',
    		  output = 'ACCEPT',
    		  forward = 'REJECT',
    	  }
    )
    c:save('firewall')
    c:commit('firewall')