当前位置:Linux教程 - Linux文化 - 请教iptables参数问题

请教iptables参数问题


>>> 此贴的回复 >> 语法一堆问题...

1. iptables 没有 -y 这个参数,这应该只有出现于 ipchains 那年代才有的参数。

2. 那个写法整个换成 ipchains 也不会过,dport 根本写错。

CODE:[Copy to clipboard]$ man ipchains

[!] -y, --syn

Only match TCP packets with the SYN bit set and the ACK and FIN bits cleared. Such packets are used to request TCP connection initiation; for example, blocking such packets coming in an interface will prevent incoming TCP connections, but outgoing TCP connections will be unaffected. This option is only meaningful when the protocol type is set to TCP. If the "!" flag precedes the "-y", the sense of the option is inverted. 若你系统有装甚至还是使用 ipchains 的话,请先看 manpage。

另外,iptables 的年代已经很少会使用 --syn 这种参数,因为有更好方式可以比对判断,像是:

CODE:[Copy to clipboard]iptables -A INPUT -m state --state NEW -j .... 要使用 iptables 的话,好好把 iptables 的 packet tracking 好好了解一下,不要使用 ipchains 观念来写 firewall rule。