OpenVZ Forum


Home » General » Support » iptables problem; trying to have two servers on the same port
iptables problem; trying to have two servers on the same port [message #34518] Wed, 14 January 2009 20:12 Go to previous message
Thomasd is currently offline  Thomasd
Messages: 39
Registered: December 2007
Member
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?







 
Read Message
Read Message
Previous Topic: not able to enter VE after kernel-update
Next Topic: container shows not real cpu consumption with "top" command
Goto Forum:
  


Current Time: Wed Jul 24 06:26:07 GMT 2024

Total time taken to generate the page: 0.02420 seconds