6,534
edits
Changes
→method for vzctl version <= 3.0.22: CTID -> VEID
2. Now to create that "custom script". The following helper script will check the configuration file for the bridge interface name and for the veth interface, and add the interface to the bridge. Create the script /usr/sbin/vznetaddbr to have the following, and then <code>chmod 0500 /usr/sbin/vznetaddbr</code> to make it executable.
<pre>
# a script to add virtual network interfaces (veth's) in a CT to a bridge on CT0
CONFIGFILE=/etc/vz/conf/$CTIDVEID.conf
. $CONFIGFILE
VZHOSTIF=`echo $NETIF |sed 's/^.*host_ifname=\(.*\),.*$/\1/g'`