diff options
author | Joshua Lock <josh@openedhand.com> | 2008-06-26 14:27:31 +0000 |
---|---|---|
committer | Joshua Lock <josh@openedhand.com> | 2008-06-26 14:27:31 +0000 |
commit | 932d0b00dac96893d78218bbd00b4a48e4183e3d (patch) | |
tree | ee7caa5c3f10053e6261c36181938dec53e7c4a2 | |
parent | 41d987a5bed0a0ac8c9d56b45d51ac8cd071fd43 (diff) | |
download | poky-932d0b00dac96893d78218bbd00b4a48e4183e3d.tar.gz |
Use /sbin/iptables if which iptables fails.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4733 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rwxr-xr-x | scripts/poky-qemu-ifup | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/poky-qemu-ifup b/scripts/poky-qemu-ifup index d68e64c281..cb1891e271 100755 --- a/scripts/poky-qemu-ifup +++ b/scripts/poky-qemu-ifup | |||
@@ -27,6 +27,11 @@ fi | |||
27 | $IFCONFIG tap0 192.168.7.1 | 27 | $IFCONFIG tap0 192.168.7.1 |
28 | 28 | ||
29 | # setup NAT for tap0 interface to have internet access in QEMU | 29 | # setup NAT for tap0 interface to have internet access in QEMU |
30 | iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24 | 30 | IPTABLES=`which iptables` |
31 | if [ "x$IPTABLES" = "x" ]; then | ||
32 | IPTABLES=/sbin/iptables | ||
33 | fi | ||
34 | |||
35 | $IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24 | ||
31 | echo 1 > /proc/sys/net/ipv4/ip_forward | 36 | echo 1 > /proc/sys/net/ipv4/ip_forward |
32 | iptables -P FORWARD ACCEPT | 37 | $IPTABLES -P FORWARD ACCEPT |