ruleset.nft 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. flush ruleset
  2. table inet nat {
  3. chain prerouting {
  4. type nat hook prerouting priority -100; policy accept;
  5. iifname != "lo" udp dport 53 counter redirect to :9053
  6. iifname != "lo" tcp flags & (fin|syn|rst|ack) == syn counter redirect to :9040
  7. }
  8. chain input {
  9. type nat hook input priority 100; policy accept;
  10. }
  11. chain output {
  12. type nat hook output priority -100; policy accept;
  13. oifname "lo" counter return
  14. ip daddr 192.168.0.0/16 counter return
  15. meta skuid tor counter return
  16. udp dport 53 counter redirect to :9053
  17. tcp flags & (fin|syn|rst|ack) == syn counter redirect to :9040
  18. }
  19. chain postrouting {
  20. type nat hook postrouting priority 100; policy accept;
  21. }
  22. }
  23. table inet filter {
  24. chain input {
  25. type filter hook input priority 0; policy drop;
  26. iifname "lo" counter accept
  27. ip protocol icmp counter accept
  28. ct state related,established counter accept
  29. ip protocol tcp counter reject with tcp reset
  30. ip protocol udp counter reject
  31. counter reject with icmp type prot-unreachable
  32. counter reject
  33. }
  34. chain forward {
  35. type filter hook forward priority 0; policy drop;
  36. }
  37. chain output {
  38. type filter hook output priority 0; policy drop;
  39. ip daddr 127.0.0.0/8 counter accept
  40. ip daddr 192.168.0.0/16 counter accept
  41. ip daddr 10.0.0.0/8 counter accept
  42. ip6 saddr ::255.0.0.0/0 counter accept
  43. ct state related,established counter accept
  44. meta skuid tor counter accept
  45. counter reject with icmp type host-unreachable
  46. counter reject
  47. }
  48. }