--- vps-functions.orig 2006-10-10 08:44:41 +1100 +++ vps-functions 2006-11-24 12:24:52 +1000 @@ -171,9 +171,12 @@ if ! ${IP_CMD} route list ${1} | grep "$1 dev venet0" > /dev/null 2>&1; then if [ -n "${VE_ROUTE_SRC_DEV}" ]; then device="dev ${VE_ROUTE_SRC_DEV}" + src_addr=`ip route get ${1} oif ${device} | head -n 1 | awk -F 'src ' '{print $2}'` + else + src_addr=`ip route get ${1} | head -n 1 | awk -F 'src ' '{print $2}'` fi - src_addr=`ip route list table local ${device} | grep '^local' | - cut -d' ' -f2 | grep -v '^127\.' | head -n 1` + #src_addr=`ip route list table local ${device} | grep '^local' | + # cut -d' ' -f2 | grep -v '^127\.' | head -n 1` if [ -z "${src_addr}" ]; then vzerror "Unable to get source ip [${device}]" ${VZ_CANT_ADDIP} fi