Hi piavlo,
Thanks for your URL. Performed following test but failed;
[Host]# nano /etc/vz/conf/101.conf
adding following at the end;
CONFIG_CUSTOMIZED="yes"
VZHOSTBR="br0"
[Host]# nano /usr/sbin/vznetaddbr
adding following script;
#!/bin/bash
# /usr/sbin/vznetaddbr
# a script to add virtual network interfaces (veth's) in a CT to a bridge on CT0
CONFIGFILE=/etc/vz/conf/$CTID.conf
. $CONFIGFILE
VZHOSTIF=`echo $NETIF |sed 's/^.*host_ifname=\(.*\),.*$/\1/g'`
if [ ! -n "$VZHOSTIF" ]; then
echo "According to $CONFIGFILE CT$CTID has no veth interface configured."
exit 1
fi
if [ ! -n "$VZHOSTBR" ]; then
echo "According to $CONFIGFILE CT$CTID has no bridge interface configured."
exit 1
fi
echo "Adding interface $VZHOSTIF to bridge $VZHOSTBR on CT0 for CT$CTID"
/sbin/ifconfig $VZHOSTIF 0
echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/forwarding
/usr/sbin/brctl addif $VZHOSTBR $VZHOSTIF
exit 0
[Host]# chmod 0500 -c /usr/sbin/vznetaddbr
mode of `/usr/sbin/vznetaddbr' changed to 0500 (r-x------)
[Host]# nano /etc/vz/vznet.conf
adding following;
#!/bin/bash
EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
[Host]# vzctl stop 101
Stopping VE ...
VE was stopped
VE is unmounted
[Host]# vzctl start 101
Starting VE ...
VE is mounted
Setting CPU units: 1000
Configure meminfo: 65536
Set hostname: satimis-desktop32
File resolv.conf was modified
Configure veth devices: veth101.0
/usr/sbin/vznetcfg: 20: source: not found
VE start in progress...
[Host]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000ea6f9a35b no eth0
[Host]# vzctl exec 101 ping -c3 yahoo.com
ping: unknown host yahoo.com
On googling I found following thread;
http://git.openvz.org/?p=vzctl;a=commit;h=a0805eb9ad354899e002f11507e0e3791cf3909f
http://bugzilla.openvz.org/show_bug.cgi?id=894
# cp -p /usr/sbin/vznetcfg /usr/sbin/vznetcfg.origin.20080824
- [ -f "$VZNETCFG" ] && source "$VZNETCFG" (delete this line)
+ [ -f "$VZNETCFG" ] && ."$VZNETCFG (add this line)
made change according to advice on above thread but still failed.
[Host]# vzctl stop 101
Stopping VE ...
VE was stopped
VE is unmounted
[Host]# vzctl start 101
Starting VE ...
VE is mounted
Setting CPU units: 1000
Configure meminfo: 65536
Set hostname: satimis-desktop32
File resolv.conf was modified
Configure veth devices: veth101.0
/usr/sbin/vznetaddbr: line 6: /etc/vz/conf/.conf: No such file or directory
According to /etc/vz/conf/.conf CT has no veth interface configured.
/usr/sbin/vznetcfg exited with error
VE start failed
Stopping VE ...
VE was stopped
VE is unmounted
Also found following thread;
http://www.proxmox.com/forum/archive/index.php/t-423.html
unfortunately it was discontiued.
Please help. TIA
B.R.
satimis