歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> Linux文化 >> 請教iptables參數問題

請教iptables參數問題

日期:2017/2/27 12:10:48   编辑:Linux文化

>>> 此貼的回復 >> 語法一堆問題...

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。


Copyright © Linux教程網 All Rights Reserved