iptables commands
10 commands, each with a one-line explanation. Click a command to copy it, or its title for details.
Commands 10 shown
-
iptables -L INPUT --line-numbers -n -vShow INPUT chain rules with packet/byte counters
-
iptables -A INPUT -p tcp --dport 443 -j ACCEPTAppend a rule to accept inbound HTTPS traffic
-
iptables -I INPUT 1 -s 203.0.113.5 -j DROPInsert DROP rule at position 1 for a specific source IP
-
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEEnable IP masquerading for outbound traffic (router/NAT)
-
iptables-save > /etc/iptables/rules.v4 iptables-restore < /etc/iptables/rules.v4Persist rules across reboots
-
iptables -D INPUT 3Remove rule number 3 from the INPUT chain
-
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m limit --limit 3/min --limit-burst 5 -j ACCEPTAllow max 3 new SSH connections per minute
-
nft list rulesetShow complete nftables configuration
-
nft add rule inet filter input tcp dport 8080 acceptAccept inbound TCP traffic on port 8080 in nftables
-
nft flush rulesetDelete all nftables rules (caution: drops all firewall rules)
no commands match — try a different search