Linux Netfilter discussions
 help / color / mirror / Atom feed
* redirecting everything to another machine
@ 2003-03-21  0:40 Dan Cox
  2003-03-21 21:40 ` Joel Newkirk
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Cox @ 2003-03-21  0:40 UTC (permalink / raw)
  To: netfilter

With iptables how would I redirect all connection attempts coming from
the Internet interface to a machine inside my DMZ? I also have a LAN
that I have "masqueraded" though I don't know if thats related. My set
up is below:

Internet IP/iface = eth0 1.2.3.4
LAN IP/iface = eth1 192.168.0.1
DMZ IP/iface = eth2 192.168.1.1


Any help is very much appreciated. Thanks

Dan Cox




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: redirecting everything to another machine
  2003-03-21  0:40 redirecting everything to another machine Dan Cox
@ 2003-03-21 21:40 ` Joel Newkirk
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Newkirk @ 2003-03-21 21:40 UTC (permalink / raw)
  To: Dan Cox, netfilter

On Thursday 20 March 2003 07:40 pm, Dan Cox wrote:
> With iptables how would I redirect all connection attempts coming from
> the Internet interface to a machine inside my DMZ? I also have a LAN
> that I have "masqueraded" though I don't know if thats related. My set
> up is below:
>
> Internet IP/iface = eth0 1.2.3.4
> LAN IP/iface = eth1 192.168.0.1
> DMZ IP/iface = eth2 192.168.1.1

iptables -t nat -A PREROUTING -m state --state NEW -d 1.2.3.4 -p DNAT 
--to 192.168.1.x

The NEW match will send new connection attempts to the DNAT IP.  Anything 
already ESTABLISHED or RELATED will go where it is supposed to, IE 
replies to connections from the LAN will go back the the machine they 
were SNATted from, continued inbound traffic that is part of a DNATted 
connection to the DMZ will continue to go to the DNATted IP in the DMZ.

Make sure your SNAT or MASQUERADE for traffic from the LAN is applied 
ONLY to traffic from the LAN by matching "-i eth1" in that rule.

j


> Any help is very much appreciated. Thanks
>
> Dan Cox



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-21 21:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-21  0:40 redirecting everything to another machine Dan Cox
2003-03-21 21:40 ` Joel Newkirk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox