Re: IP aliases and iptables forwarding



Yejjou wrote:
Hello every body
I made one linux red hat server with only 1 ethernet interface eth0
and 2 ip aliases, something like that :
eth0 -> 10.0.0.1
eth0:1 -> 10.0.0.10
eth0:2 -> 10.0.0.20


i want to redirect a trafic on my network as :

if destination ip is 10.0.0.10 ---> forward to 10.8.0.1
and if destination ip is 10.0.0.20 ---> forward to 10.16.0.1

I try that :

iptables -t nat -A PREROUTING -d 10.0.0.10 -j DNAT --to-destination
10.8.0.1

but it doesnot work can some one help me ?
tanx


If your subnet is /8 then you need to do more because 10.8.0.1 will try to reply directly.

http://www.faqs.org/docs/iptables/targets.html#DNATTARGET

Andy.

.