On Thursday 18 April 2002 1:03 am, mok2 wrote: > hi , > > my box has four ips on eth0 > eth0 192.168.0.1 > eth0:0 192.168.0.2 > eth0:1 192.168.0.3 > eth0:1 192.168.0.4 > > i want to force all outgoing packets to change ther src add from .1 to .4 > > for some reason this doesnt work > iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 192.168.0.4 > > any ideas
Here's one idea - put 192.168.0.4 onto the 'real' interface eth0, and then add the extra addresses 192.168.0.3, 192.168.0.2, 192.168.0.1 afterwards. That way the outgoing packets will automatically have the source address you require. Antony.
