* Many to many NAT
@ 2007-06-17 0:28 Robert LeBlanc
2007-06-22 14:14 ` Robert LeBlanc
0 siblings, 1 reply; 2+ messages in thread
From: Robert LeBlanc @ 2007-06-17 0:28 UTC (permalink / raw)
To: netfilter
I've looked online and can't seem to find a HOW-TO on this. I've
configured iptables to do a many to many NAT, but traffic is not
accepted because the IP address does not exist on the outside interface.
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j SNAT --to 1.2.3.0/25
I'm thinking that I need to add a route for this to work, but I'm not
terribly sure. Would something like this work?
route add -net 1.2.3.0/25 gw 192.168.1.1
Or
route add -net 1.2.3.0/25 gw 1.2.2.1
Or
route add -net 1.2.3.0/25 dev eth0
Where eth0 is the external interface.
Thanks,
Robert
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Many to many NAT
2007-06-17 0:28 Many to many NAT Robert LeBlanc
@ 2007-06-22 14:14 ` Robert LeBlanc
0 siblings, 0 replies; 2+ messages in thread
From: Robert LeBlanc @ 2007-06-22 14:14 UTC (permalink / raw)
To: Robert LeBlanc, netfilter
On 6/16/07 6:28 PM, "Robert LeBlanc" <robert@leblancnet.us> wrote:
> I've looked online and can't seem to find a HOW-TO on this. I've
> configured iptables to do a many to many NAT, but traffic is not
> accepted because the IP address does not exist on the outside interface.
>
> iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j SNAT --to 1.2.3.0/25
>
> I'm thinking that I need to add a route for this to work, but I'm not
> terribly sure. Would something like this work?
>
> route add -net 1.2.3.0/25 gw 192.168.1.1
> Or
> route add -net 1.2.3.0/25 gw 1.2.2.1
> Or
> route add -net 1.2.3.0/25 dev eth0
> Where eth0 is the external interface.
>
> Thanks,
> Robert
>
>
Just to follow up on my own post, I did get this to work, I had to add the
route for the subnet into the router instead of the linux machine itself.
The actual iptables command that used was:
Iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j SNAT --to
1.1.1.2-1.1.1.63
And added the route
1.1.1.2/26 gw 1.1.1.65
Into the cisco router.
Robert
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-22 14:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-17 0:28 Many to many NAT Robert LeBlanc
2007-06-22 14:14 ` Robert LeBlanc
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.