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
tags
iptableslinuxnetworksecurity

More iptables commands

  • nft flush ruleset

    Delete all nftables rules; be careful, this removes the whole firewall

  • iptables -L INPUT --line-numbers -n -v

    Show INPUT chain rules with packet and byte counters

  • iptables -A INPUT -p tcp --dport 443 -j ACCEPT

    Add a rule at the end of INPUT that accepts incoming HTTPS traffic

  • iptables -I INPUT 1 -s 203.0.113.5 -j DROP

    Insert a DROP rule for one source IP at position 1, so it runs first

  • iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

    Turn on IP masquerading for outgoing traffic, as on a router

all 10 iptables commands