OpenVZ Forum


Home » General » Support » [Answered] Multiple VETH's and only 1 NIC (eth0) .....
[Answered] Multiple VETH's and only 1 NIC (eth0) ..... [message #34873] Mon, 09 February 2009 21:43 Go to next message
schjeall is currently offline  schjeall
Messages: 27
Registered: February 2009
Location: Denmark
Junior Member
Hello,

I was wondering how to create multiple VETH's with only one NIC (e.g. eth0). I'm able to create veth101.0, but when I duplicate the process for additional VETH's on eth0 I don't succeed. Get errors like device does not exists

Here's what I want:

Some bridge (eth0)
|-- veth101.0
|-- veth101.1
|-- veth101.2
|-- veth101.3


Is this possible at all with only one NIC (eth0)?

[Updated on: Thu, 12 February 2009 10:36]

Report message to a moderator

Re: Multiple VETH's and only 1 NIC (eth0) ..... [message #34880 is a reply to message #34873] Tue, 10 February 2009 18:12 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

of course it should be possible:

# brctl addbr br0
# brctl addif br0 eth0
# ifconfig veth101.0 0
# brctl addif br0 veth101.0
...
Re: Multiple VETH's and only 1 NIC (eth0) ..... [message #34881 is a reply to message #34880] Tue, 10 February 2009 21:48 Go to previous messageGo to next message
schjeall is currently offline  schjeall
Messages: 27
Registered: February 2009
Location: Denmark
Junior Member
Ok, when I read my forum post I can see that the explanation could be better, sorry.

I want a number of veth's available for my CT101 (e.g. veth101.0 and veth101.1), only using eth0.

Executing the command below gives me the first veth101.0

vzctl set 101 --netif_add eth0
Configure veth devices: veth101.0 

Adding the next veth101.1 gives me problems. I was hoping the option --netif_add worked incremental just like --ipadd.

I came up with this attempt:

vzctl set 101 --netif_add veth101.1,,eth0,,br0


But I get the following message: Container does not have configured veth: veth101.1, skipped

Please note the first veth101.0 and the bridge is working.


[Updated on: Tue, 10 February 2009 21:49]

Report message to a moderator

Re: Multiple VETH's and only 1 NIC (eth0) ..... [message #34888 is a reply to message #34881] Wed, 11 February 2009 10:07 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

Quote:


I want a number of veth's available for my CT101 (e.g. veth101.0 and veth101.1), only using eth0.


It's not a correct desire.
Look, vzctl allows you to create eth0 interface inside VE.
vzctl --netif_add creates eth0 inside VE and gives a possibility
to reach it from the HN through veth101.0. Then if you create eth1 interface inside VE veth101.1 interface shoud be created on the HN etc. That's why your desire looks a little bit strange. Could you please explain what are you going to do?
Re: Multiple VETH's and only 1 NIC (eth0) ..... [message #34916 is a reply to message #34888] Thu, 12 February 2009 08:16 Go to previous messageGo to next message
schjeall is currently offline  schjeall
Messages: 27
Registered: February 2009
Location: Denmark
Junior Member
I have more reasons, why I wanna do this. One of them are.

I want to do a proof of concept, moving an old Linux server to a VE. The server uses two network cards (samba, eth0 and ftp, eth1).

The hardware node I'm gonna use only have eth0. Now, I don't want to mess to much with network settings on the old server (it's my enemy at the moment)! Just want to do a "simple" move of the server into a VE.

My idea was to do something like this:

      +-----------------------+
      |         eth0          |
HN    +-----------+-----------+
      | veth101.0 | veth101.1 |
      +=======================+
VE101 |   eth0    |   eth1    |
      +-----------+-----------+

From your answer I guess this is not possible, unless I add an extra NIC to the hardware node?
Re: Multiple VETH's and only 1 NIC (eth0) ..... [message #34920 is a reply to message #34916] Thu, 12 February 2009 09:23 Go to previous message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

Quote:


From your answer I guess this is not possible, unless I add an extra NIC to the hardware node?



No, my answer was about impossibility having two veth* interfaces on the HN with single eth interface inside VE.

The picture you've shown may be realized by two commands:

# vzctl set 101 --netif_add eth0 --save
# vzctl set 101 --netif_add eth1 --save
Previous Topic: [SOLVED] HD quota incorrect
Next Topic: Networking Problems.
Goto Forum:
  


Current Time: Fri Nov 08 22:58:01 GMT 2024

Total time taken to generate the page: 0.04327 seconds