# type read to determine if the device is ioemu
#============================================================================
-
dir=$(dirname "$0")
. "$dir/vif-common.sh"
# If we've been given a list of IP addresses, then add routes from dom0 to
# the guest using those addresses.
for addr in ${ip} ; do
- ${cmdprefix} ip route ${ipcmd} ${addr} dev ${dev} src ${main_ip}
+ if [ $ipcmd == "add" ]; then
+ case $dev in
+ vif*)
+ metric="metric 2"
+ ;;
+ tap*)
+ metric="metric 1"
+ ;;
+ esac
+ fi
+ ${cmdprefix} ip route ${ipcmd} ${addr} dev ${dev} src ${main_ip} $metric
case "$command" in
online|add)
arpspoof -i $(invirt-getconf xen.iface) -t 18.181.0.1 ${addr}&