- 論壇徽章:
- 0
|
原帖由 hhzhaokun 于 2006-4-3 10:56 發(fā)表
如下規(guī)則:
$iptables -A output -i eth0 -p tcp ! -y -s 192.168.0.0/24 \
-d 0/0 1024-65535 -j ACCEPT
請老大幫忙看一下 ! -y參數(shù)是什么意思?謝謝
語法一堆問題...
1. iptables 沒有 -y 這個參數(shù),這應該只有出現(xiàn)于 ipchains 那年代才有的參數(shù)。
2. 那個寫法整個換成 ipchains 也不會過,dport 根本寫錯。
- $ 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.
復制代碼
若你系統(tǒng)有裝甚至還是使用 ipchains 的話,請先看 manpage。
另外,iptables 的年代已經(jīng)很少會使用 --syn 這種參數(shù),因為有更好方式可以比對判斷,像是:
- iptables -A INPUT -m state --state NEW -j ....
復制代碼
要使用 iptables 的話,好好把 iptables 的 packet tracking 好好了解一下,不要使用 ipchains 觀念來寫 firewall rule。
==
[ 本帖最后由 kenduest 于 2006-4-3 11:14 編輯 ] |
|