Skip to contentSkip to conversation

Forwarding packets within local network

DISCUSSION Matt Parlane 1 participant 1 message Sep 24, 2002

lore
Share & tools
lore
#0 lore raw

Hi all...

I am trying to set up iptables to forward all packets on port 80 to an internal machine - the only difference to the normal DNAT setup is that the web server is on another internal machine. Let me explain...

The gateway is at 192.168.0.1.

The webserver is at 192.168.0.2, and is DNATed, so it can be seen from the outside, and the inside - as per the chapter entitled 'Destination NAT Onto the Same Network' in the unreliable guides.

I go to www.google.com from my workstation which is 192.168.0.3, and I am forwarded by iptables through to the internal webserver, and it serves my request. One caveat is that I want to be able to specify which IP addresses are allowed straight out as per normal, and which ones are forwarded to the internal webserver.

Is this possible? And if it's not possible using iptables, does anyone know any other way of doing this?

Regards,

Matt Parlane
Zevi Interactive
[email protected]