[Users] Creating more permanent veth`s

Gregor Mosheh gregor at hostgis.com
Thu Jun 21 09:21:17 EDT 2007


Macka Radek wrote:
> I have followed how&to in your wiki
> http://wiki.openvz.org/Virtual_Ethernet_device but with no sucess. It
> seems there is problem in script /usr/sbin/vznetaddoute in line
> VZHOSTIF=`echo $NETIF |sed 's/^.*host_ifname=\(.*\),.*$/\1/g'`
> I am not able to resolve what author of the script wants use as
> VZHOSTIF.

Hi, Macka. You're in luck; I wrote that new script, and it works for me. 
This is under FC6, not Debian, but that shouldn't make a difference.

The vznetaddroute script checks the VE's conf file for the NETIF line, 
which should be very similar to this except for the MACS:
NETIF="ifname=eth0,mac=00:18:51:D2:F4:A5,host_ifname=veth12.0,host_mac=00:18:51:1F:70:28"

The VZHOSTIF is the device name given as host_ifname in that string, 
see? In this case, veth12.0 Personally, I've found it a very handy 
practice to always keep the ifname the same as the VEID, e.g. veth1.0 
for VE 1, veth72.0 for VE 72, and so on. But that's up to you.


If your VE's conf is missing tyhat NETIF line line, you probably didn't 
add a veth to it in the first place, so do this:
    vzctl set $VEID --save --netif_add eth0
And then don't forget to add the two new lines to the config, manually:
CONFIG_CUSTOMIZED="yes"
VETH_IP_ADDRESS="12.34.56.78"


Let us know if you need more help!

-- 
Gregor Mosheh / Greg Allensworth
System Administrator, HostGIS cartographic development & hosting services
http://www.HostGIS.com/

"Remember that no one cares if you can back up,
  only if you can restore." - AMANDA


More information about the Users mailing list