qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] tun interface


From: Joe Menola
Subject: Re: [Qemu-devel] tun interface
Date: Sat, 28 Aug 2004 00:37:50 -0500
User-agent: KMail/1.7

On Fri August 27 2004 6:15 pm, Andrej wrote:
> On Fri, 27 Aug 2004 12:02, Joe Menola wrote:
> > My /etc/qemu-ifup
> >
> > #!/bin/sh
> > sudo /sbin/ifconfig $1 <ip address>
> >
> > script also needs to be executable.
> >
> > This is only my understanding of the tun concept, and it
> > works. :)
>
> That's quite odd ... when there was no qemu-ifup my virtual
> Slackware install had a network interface that it brought
> up ... with tun and NATing I don't seem to get eth0 anymore.
>
>
I believe Qemu defaults to user-net if no ifup is found. My guess is your tun 
device isn't setup properly.

You must setup iptables, I start iptables via init, so I add MASQ rule
 
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/etc/rc.d/init.d/iptables save

(this way I don't have to worry about nat after each boot)


And after Qemu is running, root must setup ip_forward. This cannot be done 
with iptables running. I do this via a script called by qemu-ifup>

#!/bin/sh
/etc/rc.d/init.d/iptables stop
echo "1" >&/proc/sys/net/ipv4/ip_forward
/etc/rc.d/init.d/iptables start

-jm




reply via email to

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