diff options
author | Scott Garman <scott.a.garman@intel.com> | 2012-04-24 17:11:26 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-04-26 10:05:17 +0100 |
commit | 0f95925b4cdc39a40969f7e496c3924fa91f61c6 (patch) | |
tree | 308fb6bd5634da0b9b5076863ae50efe70b8f14f /scripts | |
parent | 2874efa132b4a77c8d9fb2bd565a89d98159ae54 (diff) | |
download | poky-0f95925b4cdc39a40969f7e496c3924fa91f61c6.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: 14c4ce77b5c3738a8a9ea7d724de7ce9efff18c4)
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-x | scripts/runqemu-ifup | 3 |
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 | ||
104 | echo 1 > /proc/sys/net/ipv4/ip_forward | 105 | echo 1 > /proc/sys/net/ipv4/ip_forward |
105 | $IPTABLES -P FORWARD ACCEPT | 106 | $IPTABLES -P FORWARD ACCEPT |
106 | 107 | ||