qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Setting up tun/tap network doesn't work


From: Marco Matthies
Subject: Re: [Qemu-devel] Setting up tun/tap network doesn't work
Date: Sat, 15 Oct 2005 00:28:53 +0200
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051014)

Hi Alexander,

as I also struggled hard to get qemu networking running, so i will post my notes that i made when i finally managed to get it going. But first a resource that might help you:

faq in the unofficial qemu wiki:
http://lilly.csoft.net/~jeffryj/cgi-bin/moin.cgi/FrequentlyAskedQuestions

My setup below might be braindamaged, i simply kept going till I had it running, there might be things that i did too complicated.. YMMV.

the info to get it running was scraped from various websites like the abovementioned one:
-------------------------
1) install vde (http://vde.sourceforge.net/)
2) compile kernel with tun/tap and ipv4 masquerading, forwarding, ... i don't remember anymore, i believe masquerading and forwarding was enough.

my network:
--------
host:                   192.168.2.189   [assigned via dhcp]
gateway host/guest:     192.168.254.254 [guest sees host as this ip]
guest:                  192.168.254.1
nameserver of isp       1.2.3.4

Host, as root:
------------------------------------------------
vde_switch -tap tap0 -daemon
ifconfig tap0 192.168.254.254 [netmask 255.255.255.0]
chmod 777 /tmp/vde.ctl # 755 is supposed to work as well
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

Host, as user (example):
------------------------
vdeq qemu-system-x86_64 -boot d -cdrom knoppix.iso

Guest, as root (this is for linux/bsd):
---------------------------------------
ifconfig eth0 192.168.254.1 [netmask 255.255.255.0]
route add default gw 192.168.254.254
echo "nameserver 1.2.3.4" >> /etc/resolv.conf

Obviously you'll have to replace the addresses with the appropriate ones on your network. This setup should then allow the guest to communicate with the host and the guest to also reach the internet.

Hope this helps,

Marco




reply via email to

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