All of lore.kernel.org
 help / color / mirror / Atom feed
From: "curby ." <curby.public@gmail.com>
To: netfilter@lists.netfilter.org
Subject: Re: only SNAT packets originating from local?
Date: Tue, 6 Sep 2005 14:39:01 -0600	[thread overview]
Message-ID: <5d2f3791050906133966bfc5ac@mail.gmail.com> (raw)
In-Reply-To: <42410.80.87.162.74.1125668107.squirrel@aachalon.de>

(forgot to CC the list the first time i sent this)

On 9/2/05, Christian Bricart <christian@bricart.de> wrote:
> is there a simple way to do SNAT for packets that originate from the
> router itself?

Try using something like the following:

iptables -t nat -A OUTPUT -j SNAT --to-source $EXTDEV_SNATIP

Of course, this is oftentimes not necessary, but it might be if you
have *multiple* external-facing static IPs from which you want to set
one for outbound traffic.

Off-topic musing: It might also be strange if you have two static IPs
A and B with sshd listening to port 22 on both of them.  Someone
connects to B, but you SNAT the reply out of A, and the client gets
confused and drops the reply.

--Curby


      reply	other threads:[~2005-09-06 20:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-02 13:35 only SNAT packets originating from local? Christian Bricart
2005-09-06 20:39 ` curby . [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=5d2f3791050906133966bfc5ac@mail.gmail.com \
    --to=curby.public@gmail.com \
    --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.