From c4ff5f303882a4dfbf37ddf835755b5df5fe881e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 10 Sep 2010 10:43:06 +0100 Subject: scripts/poky-qemu-ifup: Ensure the host has a route to it Signed-off-by: Richard Purdie --- scripts/poky-qemu-ifup | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/poky-qemu-ifup b/scripts/poky-qemu-ifup index e248a27106..5ae6c6aefb 100755 --- a/scripts/poky-qemu-ifup +++ b/scripts/poky-qemu-ifup @@ -92,9 +92,18 @@ if [ "x$IFCONFIG" = "x" ]; then IFCONFIG=/sbin/ifconfig fi +ROUTE=`which route` +if [ "x$ROUTE" = "x" ]; then + # better than nothing... + ROUTE=/sbin/route +fi + n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] $IFCONFIG $TAP 192.168.7.$n +dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] +$ROUTE add -host 192.168.7.$dest $TAP + # setup NAT for tap0 interface to have internet access in QEMU IPTABLES=`which iptables` if [ "x$IPTABLES" = "x" ]; then -- cgit 1.2.3-korg