下面来源于 man iptables 的翻译
iptables默认有四个表:
nat filter(default) raw mangle
每个表下面有相应的链,如:
filter(input output forward )
nat (prerouting postrouting output)
raw (output prerouting postrouting)
mangle (forward input output prerouting postrouting)
--append -A chain Append to chain
增加一条规则到链中
--check -C chain Check for the existence of a rule
检查链中规则是否存在
--delete -D chain Delete matching rule from chain
删除链中规则
--delete -D chain rulenumDelete rule rulenum (1 = first) from chain
删除链中的某条规则
--insert -I chain [rulenum]Insert in chain as rulenum (default 1=first)
插入链中
--replace -R chain rulenum
Replace rule rulenum (1 = first) in chain替换
--list -L [chain [rulenum]]
List the rules in a chain or all chains查看iptables所有列表
--list-rules -S [chain [rulenum]]
Print the rules in a chain or all chains不懂
--flush -F [chain] Delete all rules in chain or all chains
删除所有的链
--zero -Z [chain [rulenum]]Zero counters in chain or all chains
不懂
--new -N chain Create a new user-defined chain
创建新的链
--delete-chain-X [chain] Delete a user-defined chain
删除一条用户定义的链
--policy -P chain target
Change policy on chain to target改变policy
--rename-chain
-E old-chain new-chainChange chain name, (moving any references)
对链重命名
Options:
[!] --proto -p proto protocol: by number or name, eg. `tcp'
制定协议
[!] --source -s address[/mask][...]source specification
[!] --destination -d address[/mask][...]
destination specification
[!] --in-interface -i input name[+]
network interface name ([+] for wildcard)
--jump -j target
target for rule (may load target extension)
--goto -g chain
jump to chain with no return
--match -m match
extended match (may load extension)
--numeric -n numeric output of addresses and ports
制定编号
[!] --out-interface -o output name[+]network interface name ([+] for wildcard)
--table -t table table to manipulate (default: `filter')
--verbose -v verbose mode
--line-numbers print line numbers when listing
--exact -x expand numbers (display exact values)
[!] --fragment -f match second or further fragments only
--modprobe=<command> try to insert modules using this command
--set-counters PKTS BYTES set the counter during insert/append
[!] --version -V print package version.