400-respondd-firewall 698 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/lua
  2. local uci = require('simple-uci').cursor()
  3. uci:delete('firewall', 'wan_announced')
  4. -- Allow respondd port on WAN to allow resolving neighbours over mesh-on-wan
  5. uci:section('firewall', 'rule', 'wan_respondd',
  6. {
  7. name = 'wan_respondd',
  8. src = 'wan',
  9. src_ip = 'fe80::/64',
  10. dest_port = '1001',
  11. proto = 'udp',
  12. target = 'ACCEPT',
  13. }
  14. )
  15. -- Restrict respondd queries to link-local addresses to prevent amplification attacks from outside
  16. uci:section('firewall', 'rule', 'client_respondd',
  17. {
  18. name = 'client_respondd',
  19. src = 'client',
  20. src_ip = '!fe80::/64',
  21. dest_port = '1001',
  22. proto = 'udp',
  23. target = 'REJECT',
  24. }
  25. )
  26. uci:save('firewall')