OpenVZ Forum


Home » Mailing lists » Users » Network configuration
Re: Network configuration [message #24984 is a reply to message #24977] Wed, 12 December 2007 17:57 Go to previous message
Yoann Moulin is currently offline  Yoann Moulin
Messages: 16
Registered: December 2007
Junior Member
> 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 :

---- BEGIN SCRIPT ----
#!/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
Read Message
Previous Topic: Dns resolution failure..
Next Topic: strange problem with nagios nrpe server
Goto Forum:
  


Current Time: Tue Sep 09 11:45:45 GMT 2025

Total time taken to generate the page: 0.14092 seconds