iptables Debug问题

debug iptables规则的时候,不要仅仅简单的使用

iptables -L INPUT

虽然自己不喜欢在iptables 的INPUT chain 里面绑定interface,但是还是有很多公司喜欢的

(今天的debug 没有注意到interface,结果白白浪费了一上午时间)

因此一般建议使用

iptables -L INPUT -v --line-numbers

或者更加推荐使用

iptables -nvL INPUT --line-number

-n → Numeric output (prevents DNS resolution, showing raw IPs instead of hostnames).
-v → Verbose output (displays packet counts, byte counts, and interface details).
-L → List rules in the specified chain (INPUT in this case).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.