OpenVZ Forum - RDF feed
type: channel
items: VEs sharing an IP address?
items: Re: VEs sharing an IP address?

VEs sharing an IP address?
type: item
description: Can I make VEs share an IP where each VE services different ports?
creator: mperkel
date: 2008-07-03T14:06:01-00:00

Re: VEs sharing an IP address?
type: item
description: Hi, what about this ways (unfortunately I haven't tried them ) 1. Using venet it's impossible to assign the same IP addresses to your VEs. But your can assign IP address you want to share to your HN, assign any different IP addresses to your VEs and then for example via iptables distribute the traffic. 2. Using veth try to assign the IP address you want to share to your VEs and then set appropriate iptables rules on the HN to sort the traffic.
creator: maratrus
date: 2008-07-03T14:43:24-00:00

Re: VEs sharing an IP address?
type: item
description: Could I do a fake net 10.0.0.2 for the IP than then use iptables in the HE and redirect the traffic for a particular port to 10.0.0.2?
creator: mperkel
date: 2008-07-03T14:49:01-00:00

Re: VEs sharing an IP address?
type: item
description: Hi, that I had in mind. (using fake IP for your VEs). P.S. don't forget to set appropriate routes to your VEs.
creator: maratrus
date: 2008-07-03T14:52:42-00:00

Re: VEs sharing an IP address?
type: item
description: Would you have an example of how to do this? Lets say the HE had an IP of 1.2.3.4 and the VE had IP of 10.0.0.2 and I wanted to service TCP port 80. What whould I do?
creator: mperkel
date: 2008-07-03T15:01:46-00:00

Re: VEs sharing an IP address?
type: item
description: Hi, I think there is a little misunderstanding between us. Quote: HE had an IP of 1.2.3.4 and the VE had IP of 10.0.0.2 this way should help you http://wiki.openvz.org/Using_NAT_for_container_with_private_ IPs#How_to_provide_access_from_Internet_to_a_container I mean something different Let's assume we have a HN and two VEs (VE1 and VE2). Let's assume we have an IP address - IP1. We have some services inside VE1 and inside VE2 that are using different ports. We want to use IP1 for both of our VEs and sort the traffic using ports numbers. 1. we assign IP1 to HN (for example with alias to net interface or using additional net card). Then we assign fake IPs (IP_fake_1, IP_fake_2) to VEs. Put appropriate routes to our VEs. Then we set appropriate iptables rules on the HN to sort traffic using destination port. 2. Using veth. We assign IP1 to our VEs. And then we set appropriate iptables rules on the HN to sort traffic using destination port.
creator: maratrus
date: 2008-07-03T15:13:38-00:00

Re: VEs sharing an IP address?
type: item
description: Can you tell me how you solve this problem. I looked every where and still cannot find how to make services available from the internet to a VE
creator: msl7868
date: 2009-01-12T21:05:47-00:00