All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: netfilter@lists.netfilter.org
Subject: Re: How to mangle source packet source ports to a fixed range
Date: Fri, 09 Feb 2007 16:34:04 +0100	[thread overview]
Message-ID: <45CC946C.4060201@plouf.fr.eu.org> (raw)
In-Reply-To: <200702090915.56546.netfilter@arntzen.us>

Hello,

Steve a écrit :
> I have a need to set the source packet's high (unprivileged) source ports to a 
> fixed range of high  ports on a firewall providing NAT.

NAT = source NAT (or masquerading) ?

> The goal is to be able to identify the inside machines at the destination 
> after NAT has changed the addresses.  This is for identification only.  I do 
> not need to connect back to the machines inside the firewall.  I realize this 
> may break certain protocols which may use dedicated unprivileged ports.
> 
> i.e.:
> 
> PREROUTING -i eth0 -p tcp -m tcp -s 192.168.0.x  --sport 1024:65535 -j 
> REDIRECT --to-ports 2000-2200
> 
> The above modifies the destination port based on the source port.

Not only it modifies the destination port but also the destination address.

>  I wish to modify the source port (  --from-ports ? ).

POSTROUTING [...] -j SNAT --to-source [ipaddr[-ipaddr]]:port-port
or
POSTROUTING [...] -j MASQUERADE --to-ports port-port


      reply	other threads:[~2007-02-09 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-09 15:15 How to mangle source packet source ports to a fixed range Steve
2007-02-09 15:34 ` Pascal Hambourg [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=45CC946C.4060201@plouf.fr.eu.org \
    --to=pascal.mail@plouf.fr.eu.org \
    --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.