summaryrefslogtreecommitdiffstats
path: root/scripts
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-05-31 21:15:11 +0100
commit7c7ac8548d4469abf359fbbe08e1c5cfea2700be (patch)
treeee8e9304d3dc537454ac0e1e17c521d354200347 /scripts
parentbbf95cae4c009d967fee545d94f809452c215c3f (diff)
downloadpoky-7c7ac8548d4469abf359fbbe08e1c5cfea2700be.tar.gz
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]. (From OE-Core rev: 78c7a82a2e3214eaec3c559269e3cc6c219759c0) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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 ]
100$ROUTE add -host 192.168.7.$dest $TAP 100$ROUTE add -host 192.168.7.$dest $TAP
101 101
102# setup NAT for tap0 interface to have internet access in QEMU 102# setup NAT for tap0 interface to have internet access in QEMU
103$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24 103$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$n/32
104$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$dest/32
104echo 1 > /proc/sys/net/ipv4/ip_forward 105echo 1 > /proc/sys/net/ipv4/ip_forward
105$IPTABLES -P FORWARD ACCEPT 106$IPTABLES -P FORWARD ACCEPT
106 107