All of lore.kernel.org
 help / color / mirror / Atom feed
* Dual-home and forward outgoing requests
@ 2006-03-02 13:33 Andy Lego
  2006-03-02 15:24 ` Chinh Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Lego @ 2006-03-02 13:33 UTC (permalink / raw)
  To: netfilter

Hello,

I have a dual-homed network. Is there any way to tell iptables to
forward all requests for specific service, that come from one
interface, to go back out on the same interface?

Right now I have simply:

-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -o eth1 -j MASQUERADE

So, what am I missing?

Thank you.

--
http://legoandy.com


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

* Re: Dual-home and forward outgoing requests
  2006-03-02 13:33 Dual-home and forward outgoing requests Andy Lego
@ 2006-03-02 15:24 ` Chinh Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Chinh Nguyen @ 2006-03-02 15:24 UTC (permalink / raw)
  To: netfilter

Andy Lego wrote:
> Hello,
> 
> I have a dual-homed network. Is there any way to tell iptables to
> forward all requests for specific service, that come from one
> interface, to go back out on the same interface?
> 
> Right now I have simply:
> 
> -A POSTROUTING -o eth0 -j MASQUERADE
> -A POSTROUTING -o eth1 -j MASQUERADE
> 
> So, what am I missing?
> 
> Thank you.
> 
> --
> http://legoandy.com
> 
Not sure what you mean. Say your device is 10.0.1.5, do you mean that if someone
was to telnet to 10.0.1.5 you would forward it to 10.0.1.10 (10.0.1.0/24 is on
eth0)?

The simplest is to have ip_forwarding on. Then add DNAT and MASQUERADE rules.
Linux routing should take care of the rest.

iptables -A PREROUTING -t nat -p tcp -s 10.0.1.0/24 --dport 23 -j DNAT --to
10.0.1.10
iptables -A POSTROUTING -t nat -j MASQUERADE


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

end of thread, other threads:[~2006-03-02 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-02 13:33 Dual-home and forward outgoing requests Andy Lego
2006-03-02 15:24 ` Chinh Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.