通过An In-Depth Guide to iptables, the Linux Firewallarrow-up-right了解iptables的基本概念(table, chain, target, module)和原理,掌握一些常用使用方法。以后遇到不懂的基本可以通过iptables -h或man iptables解决。
iptables -h
man iptables
下面的图对于理解iptables有一些帮助。
Prerouting -> routing(路由) -> |--> input -> 进程处理 -> output -> postrouting
|--> forward
LOG和TRACE target可以用来debug。
-m后面接的是module name,列出所有的modules的命令:cat /proc/net/ip_tables_matches,关于各个module的详细使用见iptables-extensionsarrow-up-right。
-m
cat /proc/net/ip_tables_matches
An In-Depth Guide to iptables, the Linux Firewall: https://www.booleanworld.com/depth-guide-iptables-linux-firewall/arrow-up-right
iptables-extensions: http://ipset.netfilter.org/iptables-extensions.man.htmlarrow-up-right
A Deep Dive into Iptables and Netfilter Architecture: https://www.digitalocean.com/community/tutorials/a-deep-dive-into-iptables-and-netfilter-architecturearrow-up-right
Iptables Tutorial 1.2.2: https://www.frozentux.net/iptables-tutorial/iptables-tutorial.htmlarrow-up-right
Last updated 7 years ago