OpenVZ Forum


Home » General » Support » multiple veth Network configuration with vlan and bridge
Re: multiple veth Network configuration with vlan and bridge [message #24983 is a reply to message #24978] Wed, 12 December 2007 17:56 Go to previous message
mistur is currently offline  mistur
Messages: 18
Registered: December 2007
Location: Paris
Junior Member

mistur wrote on Wed, 12 December 2007 18:16

is it possible to know in the EXTERNAL_SCRIPT, for which interface, the script is execute ?



Well, I gave a look to the source code and got my answer ($3)... it's working perfectly.

NETIF still the same :

NETIF="ifname=eth1.10,mac=00:16:3E:00:00:1E,host_ifname=veth10.10,host_mac=00:E0:81:4B:2F:DB;ifname=eth1.19,mac=00:16:3E:00:00:1E,host_ifname=veth10.19,host_mac=00:E0:81:4B:2F:DB"


and the script begin :

#!/bin/bash
# /usr/sbin/vznetaddroute
# a script to bring up virtual network interfaces (veth's) in a VE
CONFIGFILE=/etc/vz/conf/$VEID.conf
. $CONFIGFILE
VETH=$3
VZHOSTIF=`echo ${VETH} | cut -f1 -d"."`
VLAN=`echo ${VETH} | cut -f2 -d"."`
VETH_BRIDGE=brvlan${VLAN}

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

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

echo "Adding interface ${VZHOSTIF}.${VLAN} to VETH_BRIDGE ${VETH_BRIDGE} on VE0"

if [ -z "`/usr/sbin/brctl show | /bin/grep ${VETH_BRIDGE}`" ]; then
   /usr/sbin/brctl addbr ${VETH_BRIDGE}
   /usr/sbin/brctl addif ${VETH_BRIDGE} eth1.${VLAN}
   /sbin/ip link set ${VETH_BRIDGE} up
fi

/usr/sbin/brctl addif ${VETH_BRIDGE} ${VZHOSTIF}.${VLAN}
/sbin/ip link set ${VZHOSTIF}.${VLAN} up
exit 0
---- END SCRIPT ----


sorry for the noise

Yoann
 
Read Message icon5.gif
Read Message
Previous Topic: Updated VPS will not start
Next Topic: *SOLVED* How ican hidden real ram for a server
Goto Forum:
  


Current Time: Thu Jul 31 20:51:14 GMT 2025

Total time taken to generate the page: 0.25676 seconds