All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert LeBlanc <robert@leblancnet.us>
To: Robert LeBlanc <robert@leblancnet.us>, netfilter@lists.netfilter.org
Subject: Re: Many to many NAT
Date: Fri, 22 Jun 2007 08:14:05 -0600	[thread overview]
Message-ID: <C2A1354D.1CF51%robert@leblancnet.us> (raw)
In-Reply-To: <BBDDF0B7CFFFCE4FB5110F0A37CE6003E738@q.leblancnet.us>


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



      reply	other threads:[~2007-06-22 14:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-17  0:28 Many to many NAT Robert LeBlanc
2007-06-22 14:14 ` Robert LeBlanc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C2A1354D.1CF51%robert@leblancnet.us \
    --to=robert@leblancnet.us \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.