OpenVZ Forum


Home » General » Support » Redirect traffic from a specific hostame to a specific VE ?
Re: Redirect traffic from a specific hostame to a specific VE ? [message #32396 is a reply to message #32362] Tue, 05 August 2008 09:50 Go to previous message
int64 is currently offline  int64
Messages: 2
Registered: August 2008
Location: Toronto
Junior Member

hmm it seems that not all protocols (ftp/ssh/ etc..) are "hostname aware" with the exception of HTTP/S. Thus, to overcome this, I simply modified the ports that services run on so all the VE's are happy.


>> [FOR OTHER SERVICES (SSH/FTP/etc) ]

I set SSH for VE1 to listen on port 2222.

Below is simple DNAT iptable to route the traffic

# iptables -t nat -A PREROUTING -p tcp -d 192.168.1.100 --dport 2222 \
-i eth0 -j DNAT --to-destination 192.168.1.101:2222

let,
HN ip = 192.168.1.100
dport = HN port (public port)
VE destination = 192.168.1.101
VE Destination Port = 2222

this isn't that fun to do, but if you have only one public IP its the only thing you can do.

>> [FOR HTTP/S]

HTTP protocol is different, you can set up a reverse proxy on the HN to sort traffic to appropriate VE.

some reverse proxies I've heard of are pound or pen , but I'm sure you can find more online!

good luck!
 
Read Message icon5.gif
Read Message
Previous Topic: [Solved]Can't install yum on container.
Next Topic: How create a backup
Goto Forum:
  


Current Time: Thu Oct 10 12:47:20 GMT 2024

Total time taken to generate the page: 0.05595 seconds