OpenVZ Forum


Home » General » Support » *SOLVED* Multiple IP - Speed?
*SOLVED* Multiple IP - Speed? [message #5977] Wed, 06 September 2006 09:05 Go to next message
chinaman is currently offline  chinaman
Messages: 15
Registered: August 2006
Junior Member
Hello,

I am a newbie in server virtualisation. Thanks for the fine ware, so far I followed the howtos and it's runnin fine.
But I got some problems and questions about IPs and LAN Speed.

I will try to explain my configuration and my problems.
I am running Openvz on a Debian HWNode with Debian VPS.
I need to use different IPs out of different Networks all with it's own gateway.
So far I've got it running using the instructions about source based routing with different tables. But I had to use 1 Ip out of each Net inside the HWNode. Then I could use another IP inside the VPS too.

Question:
Is it possible to use one IP out of Network one inside the HWNode and an IP out of another network inside the VPS?

It seems there is a speedproblem with Network inside the VPS. When I ping to a certain host I get a response time of 25ms out of the HWNode. If I ping out of the VPS the response time is around 350ms !

Is this usual? are there any settings to switch? How can I debug to come closer to the reason?

Thanks for your help, I hope my explanations are clear enough.

Thomas

[Updated on: Fri, 08 September 2006 06:40] by Moderator

Report message to a moderator

Re: Multiple IP - Speed? [message #5982 is a reply to message #5977] Wed, 06 September 2006 10:16 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Quote:

Question:
Is it possible to use one IP out of Network one inside the HWNode and an IP out of another network inside the VPS?


If I understand you right, then you have two interfaces on HW?
Then you can move one interface inside VPS using --netdeth_add
option of vzctl.
Does it pass for you?


Quote:

When I ping to a certain host I get a response time of 25ms out of the HWNode. If I ping out of the VPS the response time is around 350ms!


Hmm...
What interface do you use? (veth or venet)
While pinging the host does SNAT/DNAT rule work?

Thanks.
Re: Multiple IP - Speed? [message #5983 is a reply to message #5982] Wed, 06 September 2006 10:29 Go to previous messageGo to next message
chinaman is currently offline  chinaman
Messages: 15
Registered: August 2006
Junior Member
vass wrote on Wed, 06 September 2006 06:16

then you have two interfaces on HW?
Then you can move one interface inside VPS using --netdeth_add
option of vzctl.
Does it pass for you?



I've got several virtual interfaces on HW. eth0, eth0:0, ...
One for each Network.
Do I need to set one interface for each IP and then move it into VPS? Is this possible if I will get 10 ... eth0:10 ?

vass wrote on Wed, 06 September 2006 06:16


What interface do you use? (veth or venet)



venet

vass wrote on Wed, 06 September 2006 06:16


While pinging the host does SNAT/DNAT rule work?



What do you mean? Could you explain, I don't know SNAT/DNAT.

Thanks.
Re: Multiple IP - Speed? [message #5986 is a reply to message #5983] Wed, 06 September 2006 11:06 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Now I understand, that you're not using DNAT/SNAT (Destination Network Address Translation/Source Network Address Translation). =)

Thus you're using virtual eth0:0, eth0:1,... you can't use --netdev_add. The other way to save IPs is bridging. Andrey will tell you how to set up such configuration in few minutes.

Quote:

When I ping to a certain host I get a response time of 25ms out of the HWNode. If I ping out of the VPS the response time is around 350ms !


Can you traceroute packages from VE and from HN? May be they go through different routes?

Thanks.
Re: Multiple IP - Speed? [message #5987 is a reply to message #5983] Wed, 06 September 2006 11:19 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
So, you have one ethernet interface on HW node and you want to use minimal set of IP addresses.
Next veth with birdge configuration can helps you:

1. Create veth device for your VPS (See http://wiki.openvz.org/Virtual_Ethernet_device#Simple_config uration_with_virtual_ethernet_device)
2. Join veth and eth0 device in one bridge on HW node
3. Assign HW node IP address to created bridge and change all routes on HW node accordingly
4. Assign appropriate IP address to eth0 in VPS

In this configuration you will use only 2 IP addresses. And you will not need to configure source based routing with different tables at all. Smile

Feel free to ask any question if you will have some difficulties with such configuration.


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Multiple IP - Speed? [message #5988 is a reply to message #5987] Wed, 06 September 2006 11:40 Go to previous messageGo to next message
chinaman is currently offline  chinaman
Messages: 15
Registered: August 2006
Junior Member
Andrey Mirkin wrote on Wed, 06 September 2006 07:19

In this configuration you will use only 2 IP addresses.


Pls. let me doublechek if I am clear with your suggestion:

Let's say I am using 3 Networks on one physical NIC. I would like to have follwing configuration:

HW: NET1
VPS1: NET1, NET2
VPS2: NET2, NET3
...

I don't mind if every VPS use it's own IPs, but but i don't wanna waste the IPs for HW, bcs. I just need it for configuration y ssh. All services are running inside VPS.

Is this possible by using bridged eth ?

Sorry for stupid question, but I would like to make sure before I start working this out.

Thanks.

[Updated on: Wed, 06 September 2006 11:42]

Report message to a moderator

Re: Multiple IP - Speed? [message #5989 is a reply to message #5988] Wed, 06 September 2006 11:48 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
chinaman wrote on Wed, 06 September 2006 07:40

Pls. let me doublechek if I am clear with your suggestion:

Let's say I am using 3 Networks on one physical NIC. I would like to have follwing configuration:

HW: NET1
VPS1: NET1, NET2
VPS2: NET2, NET3
...

Is this possible by using bridged eth ?



Yes, it is possible to create such configuration with veth devices and bridge.

1. VPS1: create 2 veth devices with IP addresses from NET1 and NET2
2. VPS2: create 2 veth devices with IP addresses from NET2 and NET3
3. create bridge on HW node and add 4 veth devices and eth0 device in it, assign IP address from NET1 to created bridge


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Multiple IP - Speed? [message #6061 is a reply to message #5989] Thu, 07 September 2006 13:37 Go to previous messageGo to next message
chinaman is currently offline  chinaman
Messages: 15
Registered: August 2006
Junior Member
Thanks for the instructions.
After installing new kernel with veth support veth devices are running now. So far I can see the speed is the same as HW now.

But due to veth there are some new questions now:

1. I add veth and eth0 device to bridge in HW node. I had to set a route to IP of VPS to veth device, otherwise I couldn't reach the VPS. Is this correct? I thought there is no routing necessary bcs. of the bridge.

2. How can I automatically assign IP to eth0 device in VPS? If i use /etc/network/interfaces the file is empty after restarting VPS.

3. After restarting the VPS the veth dev in HW was down. I had to do the whole procedure (adding to bridge ...) manually again. Is it possible to do this automatically?

Thanks.
Re: Multiple IP - Speed? [message #6063 is a reply to message #6061] Thu, 07 September 2006 15:04 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
chinaman wrote on Thu, 07 September 2006 09:37

1. I add veth and eth0 device to bridge in HW node. I had to set a route to IP of VPS to veth device, otherwise I couldn't reach the VPS. Is this correct? I thought there is no routing necessary bcs. of the bridge.

You couldn't reach VPS from HW node? Just add route to this VPS via bridge interface (veth in bridge, so everything should work fine).
chinaman wrote on Thu, 07 September 2006 09:37

2. How can I automatically assign IP to eth0 device in VPS? If i use /etc/network/interfaces the file is empty after restarting VPS.
You can use DHCP daemon to assign IP addresses for VPSes.
chinaman wrote on Thu, 07 September 2006 09:37

3. After restarting the VPS the veth dev in HW was down. I had to do the whole procedure (adding to bridge ...) manually again. Is it possible to do this automatically?
Unfortunately it is not yet automated. But you can add necessary commands to <VEID>.start script, so veth device will be configured on VPS start.


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Multiple IP - Speed? [message #6076 is a reply to message #6063] Thu, 07 September 2006 17:02 Go to previous message
chinaman is currently offline  chinaman
Messages: 15
Registered: August 2006
Junior Member
Andrey Mirkin wrote on Thu, 07 September 2006 11:04

chinaman wrote on Thu, 07 September 2006 09:37

1. I add veth and eth0 device to bridge in HW node. I had to set a route to IP of VPS to veth device, otherwise I couldn't reach the VPS. Is this correct? I thought there is no routing necessary bcs. of the bridge.

Just add route to this VPS via bridge interface (veth in bridge, so everything should work fine).


Yes, you are right, now it's working fine. Propably i did something wrong before.

Andrey Mirkin wrote on Thu, 07 September 2006 11:04


chinaman wrote on Thu, 07 September 2006 09:37

2. How can I automatically assign IP to eth0 device in VPS? If i use /etc/network/interfaces the file is empty after restarting VPS.
You can use DHCP daemon to assign IP addresses for VPSes.

I tried a bit and I used the config start filed <VEID>.start to handle this problem. The file has to be located in /etc/vz/conf (just latest version of vzctl)

In the file i used:
ifconfig eth0 0
ip addr add 192.168.0.1/32 dev eth0


Andrey Mirkin wrote on Thu, 07 September 2006 11:04


chinaman wrote on Thu, 07 September 2006 09:37

3. After restarting the VPS the veth dev in HW was down. I had to do the whole procedure (adding to bridge ...) manually again. Is it possible to do this automatically?
Unfortunately it is not yet automated. But you can add necessary commands to <VEID>.start script, so veth device will be configured on VPS start.



I tried, but the configuration of the veth device in HW isn't working with <VEID>.start. It seems this file is running inside the starting VPS. So i used it to set the IP. (see above)


It would be nice if there would be a script running inside the HW like <VEID>.start is running inside the VPS.

Thanks for all the help!
I would say the problem is solved.

[Updated on: Thu, 07 September 2006 17:12]

Report message to a moderator

Previous Topic: IPV6 Support in VPS
Next Topic: Setting up VZ Partitions?
Goto Forum:
  


Current Time: Sun Jul 21 15:22:03 GMT 2024

Total time taken to generate the page: 0.02463 seconds