这些iptables规则有什么问题?

我有一个简单的iptables设置,这是不完全正确的,我很想知道为什么它这样工作,我能做些什么来得到这个工作。 这是我的规则:

# redirect 80 to site sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to 8080 sudo iptables -A INPUT -s 127.0.0.1 -j ACCEPT # local is good sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT # stuff from me is good sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT # ssh is good sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT # and so is web sudo iptables -A INPUT -j DROP # culprit? 

所以从80到8080的端口转发是很酷的,直到我添加最后的DROP规则。 当我这样做,我得到超时请求。 有什么我必须链接,以获得下降和先行一起工作,或是错误的东西? 谢谢你的帮助。

最有用的工具iptables EVER:

http://en.wikipedia.org/wiki/File:Netfilter-packet-flow.svg

请参阅-t nat -A PREROUTING在到达INPUT链之前将其应用于数据包。 所以,接受 – --dport 8080而不是 – --dport 80