nftables: add an accept rule
Accept incoming TCP traffic on port 8080 in nftables
nft add rule inet filter input tcp dport 8080 accept
- tool
- iptables10 commands
More iptables commands
-
nft flush rulesetDelete all nftables rules; be careful, this removes the whole firewall
-
iptables -L INPUT --line-numbers -n -vShow INPUT chain rules with packet and byte counters
-
iptables -A INPUT -p tcp --dport 443 -j ACCEPTAdd a rule at the end of INPUT that accepts incoming HTTPS traffic
-
iptables -I INPUT 1 -s 203.0.113.5 -j DROPInsert a DROP rule for one source IP at position 1, so it runs first
-
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADETurn on IP masquerading for outgoing traffic, as on a router