Re: iptables nat forwarding
On Tue, Sep 18, 2001 at 08:32:59PM +0100, Hereward Cooper wrote:
> Could someone please tell me why this command won't forward any www
> calls to 192.168.1.1 (firewall + gateway) to 192.168.1.2 (apache
> server).
>
> iptables -t nat -A PREROUTING -p TCP --dport 80 -j DNAT --to-destination 192.168.1.2:80
Bear in mind that, even if that does work (with -i ippp0 or whatever),
you'll need to make sure that the web server is configured to accept
requests with the 'Host: 192.168.1.1' header, or the corresponding DNS
name, and to pass them to the correct virtual server. If you're using
virtual hosts at all, that is.
Sorry if I'm preaching to the choir,
--
Colin Watson [cjwatson@flatline.org.uk]
Reply to: