From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert LeBlanc Subject: Re: Many to many NAT Date: Fri, 22 Jun 2007 08:14:05 -0600 Message-ID: References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-bounces@lists.netfilter.org Errors-To: netfilter-bounces@lists.netfilter.org Content-Type: text/plain; charset="us-ascii" To: Robert LeBlanc , netfilter@lists.netfilter.org On 6/16/07 6:28 PM, "Robert LeBlanc" 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