qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] TUN network


From: Darrin Ritter
Subject: Re: [Qemu-devel] TUN network
Date: Wed, 28 Jul 2004 22:52:05 -0400
User-agent: Mozilla Thunderbird 0.7.1 (X11/20040701)

thanks I was able to get the tun0 interface configured
I looked at both scripts and the one written by Joe did the trick for me and now I have the tun0 interface, however i am unable to ping from the VM to the Host and from the Host to the VM so there is no network connection using the -user-net option I am able to access my swat configuration as well as the internet

currently i have the tun0 on the Host configures to 192.168.1.10 and the guest to 192.168.0.11 and the netmask on both to

255.255.255.0

just a note the win98 VM sees a realtek pci network card and not a NE2000 that I was expecting that the Docs talk about

any Ideas on the network will be appreciated

DarR!N



tun0      Link encap:Ethernet  HWaddr 00:FF:CC:26:27:8E
         inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
         inet6 addr: fe80::2ff:ccff:fe26:278e/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)




Joe Menola wrote:

On Tue July 27 2004 4:25 pm, Joe Menola wrote:
I setup tun0 with 2 scripts in /etc.

/etc/q-ifup

#!/bin/sh
sudo /sbin/ifconfig $1 192.168.1.1
sudo /etc/qemu-iptables

/etc/qemu-iptables

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

You cannot set ip_forward with iptables running, hence the stop/start
thing. You must also setup /etc/sudoers file, so that both scripts can run
as root. This is a bit complex...see
http://www.aplawrence.com/Basics/sudo.html for info on how to set this up.

I forgot to mention that iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE must also be set. I have this rule permenant in iptables, which starts on boot. Also the reason for 2 scripts is that with a single script ip_forward was sometimes getting set before ifconfig created $1, and tun0 would fail to get ip_forwarding. Many ways to do this, most probably better then mine, but it works for me. :)

-jm


_______________________________________________
Qemu-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/qemu-devel






reply via email to

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