This is a quick reference chart for iptables for the switches I use most commonly. For more information, see the man pages or use the --help
switch.
-n (numeric output)
-v (verbose output)
--line-numbers (lists line numbers for use with -D)
-D [chain] [line-number] (deletes line-number from chain)
-N (creates a new chain)
add tcp 27014 to INPUT chain and ACCEPT
- iptables -A INPUT -p tcp --dport 27014 -j ACCEPT
create new chain; add to INPUT
- iptables -N NewChain
- iptables -I INPUT -j NewChain