[OE-core] [PATCH 1/1] runqemu-ifup: enable ip masquerading for QEMU NAT addresses

Scott Garman scott.a.garman at intel.com
Wed Apr 25 00:11:26 UTC 2012


Fix the IP masquerading settings so that networked QEMU sessions can
reach external networks.

This is a partial fix for [YOCTO #2329].

Signed-off-by: Scott Garman <scott.a.garman at intel.com>
---
 scripts/runqemu-ifup |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index 3bd9980..f80538f 100755
--- a/scripts/runqemu-ifup
+++ b/scripts/runqemu-ifup
@@ -100,7 +100,8 @@ 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 -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24
+$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$n/32
+$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$dest/32
 echo 1 > /proc/sys/net/ipv4/ip_forward
 $IPTABLES -P FORWARD ACCEPT
 
-- 
1.7.5.4





More information about the Openembedded-core mailing list