summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-ifup
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/runqemu-ifup')
-rwxr-xr-xscripts/runqemu-ifup16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index 237bf2a07b..bbd624596e 100755
--- a/scripts/runqemu-ifup
+++ b/scripts/runqemu-ifup
@@ -47,13 +47,13 @@ if [ -z $TAP ]; then
47 exit 1 47 exit 1
48fi 48fi
49 49
50IFCONFIG=`which ip 2> /dev/null` 50IPTOOL=`which ip 2> /dev/null`
51if [ "x$IFCONFIG" = "x" ]; then 51if [ "x$IPTOOL" = "x" ]; then
52 # better than nothing... 52 # better than nothing...
53 IFCONFIG=/sbin/ip 53 IPTOOL=/sbin/ip
54fi 54fi
55if [ ! -x "$IFCONFIG" ]; then 55if [ ! -x "$IPTOOL" ]; then
56 echo "$IFCONFIG cannot be executed" 56 echo "$IPTOOL cannot be executed"
57 exit 1 57 exit 1
58fi 58fi
59 59
@@ -67,13 +67,13 @@ if [ ! -x "$IPTABLES" ]; then
67fi 67fi
68 68
69n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] 69n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
70$IFCONFIG addr add 192.168.7.$n/32 broadcast 192.168.7.255 dev $TAP 70$IPTOOL addr add 192.168.7.$n/32 broadcast 192.168.7.255 dev $TAP
71STATUS=$? 71STATUS=$?
72if [ $STATUS -ne 0 ]; then 72if [ $STATUS -ne 0 ]; then
73 echo "Failed to set up IP addressing on $TAP" 73 echo "Failed to set up IP addressing on $TAP"
74 exit 1 74 exit 1
75fi 75fi
76$IFCONFIG link set dev $TAP up 76$IPTOOL link set dev $TAP up
77STATUS=$? 77STATUS=$?
78if [ $STATUS -ne 0 ]; then 78if [ $STATUS -ne 0 ]; then
79 echo "Failed to bring up $TAP" 79 echo "Failed to bring up $TAP"
@@ -81,7 +81,7 @@ if [ $STATUS -ne 0 ]; then
81fi 81fi
82 82
83dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] 83dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
84$IFCONFIG route add to 192.168.7.$dest dev $TAP 84$IPTOOL route add to 192.168.7.$dest dev $TAP
85STATUS=$? 85STATUS=$?
86if [ $STATUS -ne 0 ]; then 86if [ $STATUS -ne 0 ]; then
87 echo "Failed to add route to 192.168.7.$dest using $TAP" 87 echo "Failed to add route to 192.168.7.$dest using $TAP"