Chinaunix
标题:
!!自定义chains的问题!!
[打印本页]
作者:
ancharn
时间:
2005-12-01 16:58
标题:
!!自定义chains的问题!!
请问各位:
\r\n如果我已经写了下面的这条的话(默认的策略是全部DROP),\r\niptables -t nat -A PREROUTING -i eth0 -p tcp 00dport 53 -j dnat --to 192.168.15.22:53\r\n那么还需要写上下面的吗?\r\niptables -A INPUT -M STATE --STATE NEW,ESTABLISHED,RELATED -I ETH0 -P TCP --SPORT 1024: --DPORT 53 -j accept\r\n是不是这两条都需要写呢?\r\n\r\n还有,我原本的意思是想这样:\r\n自定义一条chains(取名为dnsdnat),它的策略想让iptables -A INPUT -M STATE --STATE NEW,ESTABLISHED,RELATED -I ETH0 -P TCP --SPORT 1024: --DPORT 53 -j
“*”
-j的后面去匹配iptables -t nat -A PREROUTING -i eth0 -p tcp 00dport 53 -j dnat --to 192.168.15.22:53,应该怎么自定义chains(取名为dnsdnat)呢?\r\n\r\n请各位详细告知,多谢各位了!!
作者:
ancharn
时间:
2005-12-01 17:21
这样写可以吗?\r\niptables -t nat -N dnsdnat\r\niptables -t nat -A dnsdnat -i eth0 -p tcp --dport 53 -j dnat --to 192.168.15.22:53\r\niptables -A INPUT -m state --state NEW,ESTABLISHED,RELATED -i eth0 -p tcp --sport 1024: --dport 53 -j dnsdnat
作者:
ancharn
时间:
2005-12-02 10:09
各位大哥,如果知晓的话,麻烦您抽出一点时间告诉我好吗?谢谢了!!!
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2