]> code.ossystems Code Review - openembedded-core.git/commitdiff
poky-qemu-ifup: added NAT setup
authorMarcin Juszkiewicz <hrw@openedhand.com>
Thu, 8 May 2008 10:56:40 +0000 (10:56 +0000)
committerMarcin Juszkiewicz <hrw@openedhand.com>
Thu, 8 May 2008 10:56:40 +0000 (10:56 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4457 311d38ba-8fff-0310-9ca6-ca027cbcb966

scripts/poky-qemu-ifup

index 5cf48d7b8cabc17c39df605f8f37071b43e1b91d..d68e64c2812f789a73f57039e1d1845fe230aaf0 100755 (executable)
@@ -25,3 +25,8 @@ if [ "x$IFCONFIG" = "x" ]; then
 fi
 
 $IFCONFIG tap0 192.168.7.1
+
+# setup NAT for tap0 interface to have internet access in QEMU
+iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24
+echo 1 > /proc/sys/net/ipv4/ip_forward
+iptables -P FORWARD ACCEPT