[Users] Re: Some questions about veth devices in OpenVZ

santi at usansolo.net santi at usansolo.net
Fri Sep 12 05:14:07 EDT 2008


Dear Suno,

On Fri, 12 Sep 2008 07:46:52 +0200, Suno Ano <suno.ano at googlemail.com>
wrote:

> check the URL (Uniform Resource Locator), there is some wikipage about
> setting up such DHCP (Dynamic Host Configuration Protocol) setup
> http://wiki.openvz.org/w/index.php?title=Category:Networking&oldid=1521

Thanks for the link, I have already read it.. but still I have problems to
enable veth inside a CT :-/

The next step will be enable the CT to install the DHCP server, first
configure the veth device ;-) 



>  Santi> - I want to set up a veth for a CT, I need a dedicated NIC for
>  Santi>   each CT?
> 
> no, one NIC (Network Interface Card) might do as well if you configure a
> bridge

OK, thanks for the explanation.



> what you specified below (inside the VE) can be specified with the above
> line already (check out the man page i.e. vzctl --> --netif_add)

There's no info about this in the vzctl man page for OpenVZ, with those
versions:

- CentOS 5.2 i686 with "official" Yum repo from OpenVZ (openvz-kernel-rhel5
+ openvz-utils)
- Running kernel 2.6.18-92.1.1.el5.028stab057.2ent
- RPM package versions:

# rpm -qa | grep -i vz
ovzkernel-ent-2.6.18-92.1.1.el5.028stab057.2
vzquota-3.0.11-1
vzctl-lib-3.0.22-1
vzctl-3.0.22-1

vzctl version is 3.0.22.

I have checked vzctl in a Virtuozzo node and those options are available..
but in OpenVZ there aren't.

I have tried adding it to the NETIF param in the VZ config file for the
CT.. but don't work:

# grep NETIF /etc/vz/conf/3001.conf 
NETIF="ifname=eth0,mac=00:18:51:28:78:32,host_ifname=veth3001.0,host_mac=00:18:51:00:4F:84,gw=x.y.87.1,ip=x.y.87.48/255.255.255.0"

I start the CT:

# vzctl --verbose start 3001
Starting VE ...
VE is mounted
Setting CPU units: 1000
Configure meminfo: 65536
Set hostname: virtual-pxe.example.com
Running VE script: /etc/vz/dists/scripts/debian-set_hostname.sh
Configure veth devices: veth3001.0 
VE start in progress..

# vzctl enter 3001
entered into VE 3001

# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:18:51:28:78:32  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

venet0    Link encap:UNSPEC  HWaddr
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0 
Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Bridged network is not configured automatically..

Also I have the same problem, when enabling the veth device it does not
work, another test:

# /etc/init.d/networking stop
Deconfiguring network interfaces...done.

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface

# ifconfig eth0 x.y.87.48 netmask 255.255.255.0 up
# route add default gw x.y.87.1 eth0

All appears that is OK:

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
x.y.87.0        0.0.0.0         255.255.255.0   U     0      0        0
eth0
0.0.0.0         x.y.87.1        0.0.0.0         UG    0      0        0
eth0

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:18:51:28:78:32  
          inet addr:x.y.87.48  Bcast:x.y.87.255  Mask:255.255.255.0
          inet6 addr: fe80::218:51ff:fe28:7832/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:384 (384.0 b)

But I can ping nothing.. I get "Destination Host Unreachable".. something
it's wrong :-/

When enabling veth into the CT I need to make anymore in CT0? Thanks!

Running Debian Etch (it was a P2V migration) inside the CT.. and CentOS in
CT0.

Regards,

--
Santi Saez
http://woop.es



More information about the Users mailing list