diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/poky-qemu-ifup | 9 |
1 files changed, 9 insertions, 0 deletions
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 | |||
| 92 | IFCONFIG=/sbin/ifconfig | 92 | IFCONFIG=/sbin/ifconfig |
| 93 | fi | 93 | fi |
| 94 | 94 | ||
| 95 | ROUTE=`which route` | ||
| 96 | if [ "x$ROUTE" = "x" ]; then | ||
| 97 | # better than nothing... | ||
| 98 | ROUTE=/sbin/route | ||
| 99 | fi | ||
| 100 | |||
| 95 | n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] | 101 | n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] |
| 96 | $IFCONFIG $TAP 192.168.7.$n | 102 | $IFCONFIG $TAP 192.168.7.$n |
| 97 | 103 | ||
| 104 | dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] | ||
| 105 | $ROUTE add -host 192.168.7.$dest $TAP | ||
| 106 | |||
| 98 | # setup NAT for tap0 interface to have internet access in QEMU | 107 | # setup NAT for tap0 interface to have internet access in QEMU |
| 99 | IPTABLES=`which iptables` | 108 | IPTABLES=`which iptables` |
| 100 | if [ "x$IPTABLES" = "x" ]; then | 109 | if [ "x$IPTABLES" = "x" ]; then |
