Linux Netfilter discussions
 help / color / mirror / Atom feed
* How to do PAT based on source IP adress and port ?
@ 2010-07-17 21:30 Thomas Elsgaard
  2010-07-17 23:13 ` Antoine Souques
  2010-07-17 23:21 ` Antoine Souques
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Elsgaard @ 2010-07-17 21:30 UTC (permalink / raw)
  To: netfilter

Hi

I am wondering how i can get iptables to do a PAT based on source IP address?

Traffic from 10.5.1.0/24 towards UDP port 69 should be mapped to port
20000 instead of port 69
Traffic from 10.5.2.0/24 towards UDP port 69 should be mapped to port
20001 instead of port 69

Is this possible with iptables?

Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to do PAT based on source IP adress and port ?
  2010-07-17 21:30 How to do PAT based on source IP adress and port ? Thomas Elsgaard
@ 2010-07-17 23:13 ` Antoine Souques
  2010-07-17 23:21 ` Antoine Souques
  1 sibling, 0 replies; 3+ messages in thread
From: Antoine Souques @ 2010-07-17 23:13 UTC (permalink / raw)
  To: netfilter

Le 17/07/2010 23:30, Thomas Elsgaard a écrit :
> Hi
>
> I am wondering how i can get iptables to do a PAT based on source IP address?
>
> Traffic from 10.5.1.0/24 towards UDP port 69 should be mapped to port
> 20000 instead of port 69
> Traffic from 10.5.2.0/24 towards UDP port 69 should be mapped to port
> 20001 instead of port 69
>
> Is this possible with iptables?
>
> Thomas
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>    
Hi,

With iptables (almost) everything is possible. You should look around 
the target SNAT

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to do PAT based on source IP adress and port ?
  2010-07-17 21:30 How to do PAT based on source IP adress and port ? Thomas Elsgaard
  2010-07-17 23:13 ` Antoine Souques
@ 2010-07-17 23:21 ` Antoine Souques
  1 sibling, 0 replies; 3+ messages in thread
From: Antoine Souques @ 2010-07-17 23:21 UTC (permalink / raw)
  To: netfilter

Le 17/07/2010 23:30, Thomas Elsgaard a écrit :
> Hi
>
> I am wondering how i can get iptables to do a PAT based on source IP address?
>
> Traffic from 10.5.1.0/24 towards UDP port 69 should be mapped to port
> 20000 instead of port 69
> Traffic from 10.5.2.0/24 towards UDP port 69 should be mapped to port
> 20001 instead of port 69
>
> Is this possible with iptables?
>
> Thomas
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>    
I am sorry, I gave you the wrong target. DNAT matches better your goal.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-17 23:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-17 21:30 How to do PAT based on source IP adress and port ? Thomas Elsgaard
2010-07-17 23:13 ` Antoine Souques
2010-07-17 23:21 ` Antoine Souques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox