Hardware flowtable offload nftables
Offloads established flows to fast path; add 'flags offload' for NIC hardware offload
nft add flowtable inet filter ft '{ hook ingress priority 0 ; devices = { eth0, eth1 } ; }' && nft add rule inet filter forward ct state established flow add @ft
more nftables
all 12 commands →
Create input chain with drop policy
nft add chain inet filter input '{ type filter hook input priority 0 ; policy drop ; }'
Named set as IP blocklist
nft add set inet filter blocklist '{ type ipv4_addr ; flags interval ; }' && nft add element inet filter blocklist '{ 10.0.0.0/8, 192.0.2.5 }'
Verdict map for port dispatch
nft add rule inet filter input tcp dport vmap '{ 22 : accept, 80 : accept, 443 : accept, 3306 : drop }'
List ruleset with rule handles
nft -a list ruleset
Delete a single rule by handle
nft delete rule inet filter input handle 7