Delete a rule by number

Remove rule number 3 from the INPUT chain

iptables -D INPUT 3

tool
iptables10 commands
tags
iptableslinuxnetwork

More iptables commands

  • iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m limit --limit 3/min --limit-burst 5 -j ACCEPT

    Allow max 3 new SSH connections per minute

  • nft list ruleset

    Show complete nftables configuration

  • nft add rule inet filter input tcp dport 8080 accept

    Accept inbound TCP traffic on port 8080 in nftables

  • nft flush ruleset

    Delete all nftables rules (caution: drops all firewall rules)

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

    Show INPUT chain rules with packet/byte counters

all 10 iptables commands