400-respondd-firewall 839 B

123456789101112131415161718192021222324252627282930313233343536
  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. name = 'wan_respondd',
  7. src = 'wan',
  8. src_ip = 'fe80::/64',
  9. dest_port = '1001',
  10. proto = 'udp',
  11. target = 'ACCEPT',
  12. })
  13. -- Restrict respondd queries to link-local addresses to prevent amplification attacks from outside
  14. uci:section('firewall', 'rule', 'client_respondd', {
  15. name = 'client_respondd',
  16. src = 'client_local',
  17. src_ip = 'fe80::/64',
  18. dest_port = '1001',
  19. proto = 'udp',
  20. target = 'ACCEPT',
  21. })
  22. uci:section('firewall', 'rule', 'mesh_respondd_ll', {
  23. name = 'mesh_respondd_ll',
  24. src = 'mesh',
  25. src_ip = 'fe80::/64',
  26. dest_port = '1001',
  27. proto = 'udp',
  28. target = 'ACCEPT',
  29. })
  30. uci:save('firewall')