All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin A. Brown" <mabrown-lartc@securepipe.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] masqurading and source based routing
Date: Mon, 11 Aug 2003 20:37:21 +0000	[thread overview]
Message-ID: <marc-lartc-106063432827817@msgid-missing> (raw)
In-Reply-To: <marc-lartc-106061348502901@msgid-missing>

Hello Agri,

This doesn't seem to difficult--are you telling us the whole story?  :)

 : i have private network let it be 192.168.0.0/24
 : and and two external networks,
 : let it be 10.1.1.0/24 and 10.2.2.0/24
 : ip addresses of my linux box is
 : 192.168.0.1
 : 10.1.1.1
 : 10.2.2.1
 :
 : i want to masquarade all private network addresses through 10.1.1.1 but
 : also if destination is not at 10.1.1.0/24 want to route masquaraded
 : packets through gateway 10.2.2.2

routing + masquerading:

  ip route change default via 10.2.2.2 src 10.1.1.1
  iptables -t nat -A POSTROUTING \
    -s 192.168.0.0/24 ! -d 10.1.1.0/24 -j MASQUERADE

or, better, just use SNAT --to-source:

  iptables -t nat -A POSTROUTING \
    -s 192.168.0.0/24 ! -d 10.1.1.0/24 -j SNAT --to-source 10.1.1.1

Let us know if this doesn't do it.

-Martin

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

      reply	other threads:[~2003-08-11 20:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-11 14:46 [LARTC] masqurading and source based routing Agri
2003-08-11 20:37 ` Martin A. Brown [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=marc-lartc-106063432827817@msgid-missing \
    --to=mabrown-lartc@securepipe.com \
    --cc=lartc@vger.kernel.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.