-SOLVED- Re: How to do PAT based on source IP adress and port ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 18, 2010 at 1:57 AM, Thomas Elsgaard
<thomas.elsgaard@xxxxxxxxx> wrote:
> 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?
>
> -----------------------------------------
>
 Hi everybody

 After some work, i managed to get it working...

 The solution was very simple:

  iptables -t nat -A PREROUTING -i eth0 --source 10.5.1.0/24 -p udp --dport
 69 -j REDIRECT --to-port 20001
 iptables -t nat -A PREROUTING -i eth0 --source 10.5.2.0/24 -p udp --dport 69
 -j REDIRECT --to-port 20002

 Thanks for the advices

 Thomas
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux