I have the following setup:
three IPs (let's call them IP1, IP2 & IP3) on the HW node;
one FTP server on the HW node
one FTP server on one of the VE with it's own local IP (VEIP)
I want to be able to access the HW node's ftp server through IP1, port 21 and also access the VE's FTP server through IP2, port 21
so I did the following:
iptables -t nat -A PREROUTING -p tcp -m tcp -s IP2 --dport 21 -j DNAT --to VEIP:21
connecting to the VE's ftp server works find, but when I connect through IP1, I end up on the VE node's FTP server
so I tried to make two rules:
iptables -t nat -A PREROUTING -p tcp -m tcp -s IP1 --dport 21 -j DNAT --to IP1:21
iptables -t nat -A PREROUTING -p tcp -m tcp -s IP2 --dport 21 -j DNAT --to VEIP:21
but this still doesn't work...
any idea?