OpenVZ Forum


Home » General » Support » howto auto add VE veth to a HN bridge upon VE startup?[Solved]
Re: howto auto add VE veth to a HN bridge upon VE startup? [message #16471 is a reply to message #16447] Fri, 07 September 2007 18:29 Go to previous messageGo to previous message
piavlo is currently offline  piavlo
Messages: 159
Registered: January 2007
Senior Member
Maybe one of the devs has an idea what might be wrong?
This the only problem preventing me on putting the system in poroduction.

piavlo wrote on Thu, 06 September 2007 21:26

/etc/vz/vznet.conf
#!/bin/bash
EXTERNAL_SCRIPT="/etc/vz/veth.bridge.addif"

/etc/vz/veth.bridge.addif
#!/bin/bash

CONFIGFILE=/etc/vz/conf/$VEID.conf
. $CONFIGFILE
VZHOSTIF=`echo $NETIF |sed 's/^.*host_ifname=\(.*\),.*$/\1/g'`

if [ "$VEID" == "101" ]; then

        if [ ! -n "$VZHOSTIF" ]; then
                echo "According to $CONFIGFILE VE$VEID has no veth interface configured."
                exit 1
        fi

        brctl addif dmzbr0 veth${VEID}.0
        exit $?
fi

exit 0


After the VE 101 is started the bridge has veth101.0
# brctl show
bridge name     bridge id               STP enabled     interfaces
dmzbr0          8000.00123456789a       no              eth2
                                                        veth101.0


The commands netstat -rn & ifconfig -a both in VE and HN return identical output in both cases (then veth is added to bridge by vznet.conf & then instead it is added manually after VE startup with vznet.conf disabled)
But the networking works only in the latter case with vznet.conf disabled Shocked
Which is very strange and the only reason i can think of is that then the vznet.conf is enabled some internal vz net setup functionality gets disabled.

ps. by the way i tried vznet.conf without EXTERNAL_SCRIPT
like this
#!/bin/bash

CONFIGFILE=/etc/vz/conf/$VEID.conf
. $CONFIGFILE
VZHOSTIF=`echo $NETIF |sed 's/^.*host_ifname=\(.*\),.*$/\1/g'`

if [ "$VEID" == "101" ]; then

        if [ ! -n "$VZHOSTIF" ]; then
                echo "According to $CONFIGFILE VE$VEID has no veth interface configured."
                exit 1
        fi

        brctl addif dmzbr0 veth${VEID}.0
        exit $?
fi

exit 0
Which gives the same result as with EXTERNAL_SCRIPT
So i wonder why is there a need for EXTERNAL_SCRIPT in vznet.conf
if the device setup can be done just directly in vznet.conf
without any EXTERNAL_SCRIPT indirection script?

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Audit issues
Next Topic: private vs root
Goto Forum:
  


Current Time: Mon Oct 21 06:31:35 GMT 2024

Total time taken to generate the page: 0.06154 seconds