Advertisement
Guest User

Untitled

a guest
Mar 26th, 2023
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | Cybersecurity | 0 0
  1. table inet nftables_svc {
  2.  
  3. # protocols to allow
  4. set allowed_protocols {
  5. type inet_proto
  6. elements = { icmp, icmpv6 }
  7. }
  8.  
  9. # interfaces to accept any traffic on
  10. set allowed_interfaces {
  11. type ifname
  12. elements = { "lo" }
  13. }
  14.  
  15. # services to allow
  16. set allowed_tcp_dports {
  17. type inet_service
  18. elements = { 80,443}
  19. }
  20.  
  21. # this chain gathers all accept conditions
  22. chain allow {
  23.  
  24. ct state established,related accept
  25.  
  26. meta l4proto @allowed_protocols accept
  27. iifname @allowed_interfaces accept
  28. tcp dport @allowed_tcp_dports accept
  29.  
  30. }
  31.  
  32. # base-chain for traffic to this host
  33. chain INPUT {
  34. type filter hook input priority filter + 20
  35. policy accept
  36.  
  37. jump allow
  38. reject with icmpx type port-unreachable
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement