1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #!/usr/bin/lua
- -- This script must be ordered after 300-gluon-client-bridge-network, as
- -- it overrides parts of network.client
- local site = require 'gluon.site'
- local sysconfig = require 'gluon.sysconfig'
- local sysctl = require 'gluon.sysctl'
- local util = require 'gluon.util'
- local uci = require('simple-uci').cursor()
- uci:section('network', 'interface', 'client', {
- ipv6 = true,
- proto = 'dhcpv6',
- reqprefix = 'no',
- peerdns = not site.dns.servers(),
- sourcefilter = false,
- keep_ra_dnslifetime = true,
- robustness = 3,
- query_interval = 2000,
- query_response_interval = 500,
- })
- uci:delete('network', 'client_lan')
- uci:delete('network', 'local_node_route')
- uci:section('network', 'route', 'local_node_route', {
- interface = 'client',
- target = site.prefix4(),
- })
- uci:delete('network', 'local_node_route6')
- uci:section('network', 'route6', 'local_node_route6', {
- interface = 'client',
- target = site.prefix6(),
- gateway = '::',
- })
- uci:save('network')
- local networks = uci:get_list('firewall', 'mesh', 'network')
- util.add_to_set(networks, 'client')
- uci:set_list('firewall', 'mesh', 'network', networks)
- local networks = uci:get_list('firewall', 'drop', 'network')
- util.remove_from_set(networks, 'client')
- uci:set_list('firewall', 'drop', 'network', networks)
- uci:delete('firewall', 'local_node_dns')
- uci:save('firewall')
- sysctl.set('net.ipv6.conf.local-node.forwarding', 0)
|