summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-ifup
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2012-04-24 17:11:26 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-25 09:21:48 +0100
commit14c4ce77b5c3738a8a9ea7d724de7ce9efff18c4 (patch)
tree66f80ef814e84eb7929dc3103285e457a0c3a636 /scripts/runqemu-ifup
parent88d17caf6d0eb241f54b1af1704405d5f47eadc5 (diff)
downloadopenembedded-core-14c4ce77b5c3738a8a9ea7d724de7ce9efff18c4.tar.gz
openembedded-core-14c4ce77b5c3738a8a9ea7d724de7ce9efff18c4.tar.bz2
openembedded-core-14c4ce77b5c3738a8a9ea7d724de7ce9efff18c4.zip
runqemu-ifup: enable ip masquerading for QEMU NAT addresses
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@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-ifup')
-rwxr-xr-xscripts/runqemu-ifup3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index 3bd9980ad0..f80538f53c 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