1.查看规则
iptables --line -nvL 显示行号更详细信息
iptables -nL
root@ubuntu:/# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP icmp -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain self_ctl (0 references)
target prot opt source destination
root@ubuntu:/#
2.创建一个自定义链
iptables -t filter -N my_ctl
-t 指定链要添加的到的表,默认不指定就是filter
-N =new 指定新链
root@ubuntu:/# iptables -t filter -N my_ctl
root@ubuntu:/#
root@ubuntu:/# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP icmp -- 0.0.0.0/