/usr/share/doc/nftables/examples
NameSizeModeActions
sysvinit/-0755rm
all-in-one.nft10160644editdlrm
arp-filter.nft1290644editdlrm
bridge-filter.nft1970644editdlrm
ct_helpers.nft12630755editdlrm
inet-filter.nft1870644editdlrm
inet-nat.nft2510644editdlrm
ipv4-filter.nft1820644editdlrm
ipv4-mangle.nft740644editdlrm
ipv4-nat.nft2460644editdlrm
ipv4-raw.nft1370644editdlrm
ipv6-filter.nft1860644editdlrm
ipv6-mangle.nft780644editdlrm
ipv6-nat.nft2530644editdlrm
ipv6-raw.nft1410644editdlrm
load_balancing.nft18580755editdlrm
nat.nft11650755editdlrm
netdev-ingress.nft1280644editdlrm
overview.nft10770755editdlrm
pf.os288840644editdlrm
README4750644editdlrm
secmark.nft24040755editdlrm
sets_and_maps.nft12780755editdlrm
workstation.nft8170755editdlrm
Edit: /usr/share/doc/nftables/examples/ct_helpers.nft (1263B)
#!/usr/sbin/nft -f # This example file shows how to use ct helpers in the nftables framework. # Note that nftables includes interesting improvements compared to how this # was done with iptables, such as loading multiple helpers with a single rule # This script is meant to be loaded with `nft -f ` # You require linux kernel >= 4.12 and nft >= 0.8 # For up-to-date information please visit https://wiki.nftables.org # Using ct helpers is an important security feature when doing stateful # firewalling, since it mitigate certain networking attacks. # More info at: https://home.regit.org/netfilter-en/secure-use-of-helpers/ flush ruleset table inet filter { # declare helpers of this table ct helper ftp-standard { type "ftp" protocol tcp; l3proto inet } ct helper sip-5060 { type "sip" protocol udp; l3proto inet } ct helper tftp-69 { type "tftp" protocol udp l3proto inet } chain input { type filter hook input priority 0; policy drop; ct state established,related accept # assign a single helper in a single rule tcp dport 21 ct helper set "ftp-standard" # assign multiple helpers in a single rule ct helper set udp dport map { 69 : "tftp-69", \ 5060 : "sip-5060" } } }