[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [iptables] Forward http

Mark wrote:
Hash: SHA1


I just installed a new debian lenny server and now i am trying to
forward all http request from my old debian etch installation to the new
one. The statement i used was the following:

iptables -t nat -A PREROUTING -p tcp --dport http -j DNAT \
- --to-destination <ip>:80

iptables -t nat -L gives the following:

target     prot opt source               destination
DNAT       tcp  --  anywhere             anywhere            tcp dpt:www

I'm not getting redirected when i try to access the server via a webbrowser.

Do you also have the appropriate forwarding rule? My understanding is that after PREROUTING, a packet is submitted to the appropriate main path, in this case, the FORWARD one.

Otherwise, the rule seems structurally similar to one of mine forwarding ssh, apart from mine also filtering by input interface and destination IP address to avoid ambiguity. The important bits are the same.

If all else fails, stick in a few logging rules in appropriate places, a bit like 'print' statements while debugging programs.


Reply to: