From 7c7ac8548d4469abf359fbbe08e1c5cfea2700be Mon Sep 17 00:00:00 2001 From: Scott Garman Date: Tue, 24 Apr 2012 17:11:26 -0700 Subject: 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 Signed-off-by: Richard Purdie --- scripts/runqemu-ifup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') 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 -- cgit v1.2.3-54-g00ecf