/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
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?