Problem with SNAT and same port number

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

 



Hi,

I am wanting to change the source address of outgoing packets that have a src 
port of 53.

I have tried 
/sbin/iptables -A POSTROUTING -p tcp -t nat -o bond0 --sport 53 -j SNAT 
--to-source 192.168.0.1:53

This doesnt work, it seems to be that you cant SNAT to a port the same as the 
original src port because

/sbin/iptables -A POSTROUTING -p tcp -t nat -o bond0 --sport 53 -j SNAT 
--to-source 192.168.0.1

/sbin/iptables -A POSTROUTING -p tcp -t nat -o bond0 --sport 53 -j SNAT 
--to-source 192.168.0.1:52

both works, but obviously not the same results as I wanted because the src 
port is also changed.

Is there any other way to do what I am wanting??

TIA



[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