Skip to contentSkip to conversation

Redirect and change the source IP

DISCUSSION Martín 1 participant 1 message Nov 3, 2003

lore
Share & tools
lore

Martín

author
#0 lore raw
Quoted 4 lines · Ray Leach
Quoted 1 line · Martín

How can I redirect inbound traffic and also change the source IP of this traffic?

iptables -t nat -A POSTROUTING -i eth0 -s 123.321.123.321 -p tcp --dport 80 -j SNAT --to 1.2.3.4

This would change the SOURCE IP, but I need also to redirect the traffic to another machine
How can I do both things?
Supose the linux machine has IP 192.168.1.1, the traffic is comeing from 192.16.1.2 and I want to recive that traffic in 192.168.1.1 cange its source IP to 192.168.1.2 and also redirect that trafic to 192.168.2.1.

Signature · 1 line
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/