2015-04-28 03:25:56 +00:00
|
|
|
#!/usr/bin/lua
|
|
|
|
|
2017-01-19 11:51:04 +00:00
|
|
|
local uci = require('simple-uci').cursor()
|
2015-04-28 03:25:56 +00:00
|
|
|
|
2016-02-02 05:38:03 +00:00
|
|
|
uci:delete('firewall', 'wan_announced')
|
|
|
|
|
|
|
|
-- Allow respondd port on WAN to allow resolving neighbours over mesh-on-wan
|
|
|
|
uci:section('firewall', 'rule', 'wan_respondd',
|
2015-04-28 03:25:56 +00:00
|
|
|
{
|
2016-02-02 05:38:03 +00:00
|
|
|
name = 'wan_respondd',
|
2015-04-28 03:25:56 +00:00
|
|
|
src = 'wan',
|
|
|
|
src_ip = 'fe80::/64',
|
|
|
|
dest_port = '1001',
|
|
|
|
proto = 'udp',
|
|
|
|
target = 'ACCEPT',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2016-02-05 15:59:27 +00:00
|
|
|
-- Restrict respondd queries to link-local addresses to prevent amplification attacks from outside
|
|
|
|
uci:section('firewall', 'rule', 'client_respondd',
|
|
|
|
{
|
|
|
|
name = 'client_respondd',
|
|
|
|
src = 'client',
|
|
|
|
src_ip = '!fe80::/64',
|
|
|
|
dest_port = '1001',
|
|
|
|
proto = 'udp',
|
|
|
|
target = 'REJECT',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2015-04-28 03:25:56 +00:00
|
|
|
uci:save('firewall')
|