- 论坛徽章:
- 0
|
原帖由 hhzhaokun 于 2006-4-3 10:56 发表
如下规则:
$iptables -A output -i eth0 -p tcp ! -y -s 192.168.0.0/24 \
-d 0/0 1024-65535 -j ACCEPT
请老大帮忙看一下 ! -y参数是什么意思?谢谢
语法一堆问题...
1. iptables 没有 -y 这个参数,这应该只有出现于 ipchains 那年代才有的参数。
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.
复制代码
若你系统有装甚至还是使用 ipchains 的话,请先看 manpage。
另外,iptables 的年代已经很少会使用 --syn 这种参数,因为有更好方式可以比对判断,像是:
- iptables -A INPUT -m state --state NEW -j ....
复制代码
要使用 iptables 的话,好好把 iptables 的 packet tracking 好好了解一下,不要使用 ipchains 观念来写 firewall rule。
==
[ 本帖最后由 kenduest 于 2006-4-3 11:14 编辑 ] |
|