qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qemu and TUN/TAP; a conceptual overview and instruction


From: Joe Menola
Subject: Re: [Qemu-devel] qemu and TUN/TAP; a conceptual overview and instructions for use.
Date: Mon, 9 Aug 2004 08:25:55 -0500
User-agent: KMail/1.6.82

On Mon August 9 2004 8:01 am, Darryl Dixon wrote:

> #!/bin/bash
> iptables --flush          #Clear out all previous rules
> ('/etc/init.d/iptables stop' may also work)
> echo 1 >/proc/sys/net/ipv4/ip_forward     #Enable IP forwarding for the
> host OS
> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE   #Enable
> masquerading on your real NIC so tun0 can get in and out
> ifconfig $1 10.0.0.1   #Bring up tun0 on a different subnet from the
> host
> --------8<--------snip

This should work as far as tun0 goes, but this kills all preset iptables 
rules. Which is fine if you're not using iptables. To preserve other iptables 
I've added Masquerade to my saved rules via:

From terminal as root
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 
#/etc/rc.d/init.d/iptables save

And eliminated the  "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE " 
command from my qemu-ifup script. Of course iptables must be set to start on 
boot.

Hope this helps more then it confuses.

-jm





reply via email to

[Prev in Thread] Current Thread [Next in Thread]