nftables.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/usr/sbin/nft -f
  2. #
  3. # Example nftables configuration for letmein.
  4. #
  5. flush ruleset
  6. table inet filter {
  7. chain LETMEIN-INPUT {
  8. # This chain will be managed and filled by letmeind.
  9. # Do NOT put manual rules here.
  10. # Leave this chain empty in this configuration.
  11. # letmeind will dynamically insert 'accept' rules here for the leases.
  12. }
  13. chain INPUT {
  14. type filter hook input priority filter; policy drop;
  15. iifname lo accept
  16. ct state invalid drop
  17. ct state related,established accept
  18. udp dport 32768-60999 accept # ephemeral port range (/proc/sys/net/ipv4/ip_local_port_range)
  19. meta l4proto ipv6-icmp accept
  20. meta l4proto icmp accept
  21. ip protocol igmp accept
  22. # TODO: Put your static rules here...
  23. jump LETMEIN-INPUT # Jump to letmein dynamic rules.
  24. meta l4proto udp drop # Drop all other UDP.
  25. reject # Reject everything else.
  26. }
  27. chain FORWARD {
  28. type filter hook forward priority filter; policy drop;
  29. # Put your static rules here...
  30. reject
  31. }
  32. chain OUTPUT {
  33. type filter hook output priority filter; policy drop;
  34. oifname lo accept
  35. ct state related,established accept
  36. meta l4proto ipv6-icmp accept
  37. meta l4proto icmp accept
  38. ip protocol igmp accept
  39. # TODO: Put your static rules here...
  40. meta l4proto udp accept # Accept all outgoing UDP.
  41. meta l4proto tcp accept # Accept all outgoing TCP.
  42. reject # Reject everything else.
  43. }
  44. }