Mangle ip source with iptables
Can I modify packets that leave my station using iptables to have a different source address ?
For example I have the ip X and I want the packets that leave the station having in the ip header the ip Y. I guess it has something to do with the mangle table of iptables but I`m not too good with that. something like this maybe? Code:
iptables -t mangle -A PREROUTING -s X -j SAME --to Y |
If you want to change the source address of packets leaving your box, you can use the POSTROUTING table. For example, with masquerading:
Code:
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE |
All times are GMT -5. The time now is 09:11 PM. |