Question about tun/tap networking
I recommend using vde by Renzo Davoli instead of the default tuntap. I am able to network 2 instances of windows 98 (in separate qemu's) and minix 2.0.4 (in a hand-modified bochs). It worked without a hitch, and all the machines are on the same subnet.
You still need forwarding to let the virtual machines see the lan or the internet, however. The plus with vde is that you don't need to set up routing for all these different tunN devices. (I use the Shorewall firewall, and using tun was a pain...vde means I just have to set up routing and masquerading for tap0, instead of for tun0, tun1, tun2, ...)
Available here btw: http://sourceforge.net/projects/vde/
Quoted 31 lines · On Mon, May 03, 2004 at 11:35:32AM +1000, [email protected] wrote:
Quoting Arne Bernin <[email protected]>:
Quoted 12 lines
Hi,
i am trying to set up two virtual machines with qemu 0.5.4. I have them running, both with 2 network cards. I am able to ping all 4 interfaces from the host they are running from but am not able to ping between both virtual machines...
If i do a tcpdump on the corrsponding tun interfaces while trying to ping i see a lot of arp who-has 172.16.0.254 tell 172.16.0.1 messages (172.16.0.1 is the one machine, the other is 172.16.0.254). Is there something i have to do to get the arp responses right ?? Or am i totally wrong ?You've stuck both virtual machines on the same subnet, so they think they're on the same physical LAN. That's why they're doing ARPs and expecting replies. But you're actually running two QEMU instances on two seperate TUN interfaces and they *aren't* bridged. So the ARP on tun0 never gets seen on tun1 (and vice-versa).
Set the second TUN interface to a different subnet (eg, 172.16.1.x) and enable ipv4 forwarding. Linux will then forward packets between tun0 and tun1.
You could also muck about with proxyarp or bridging but honestly, I wouldn't bother with that. Routing is a lot easier to understand.
_______________________________________________
Qemu-devel mailing list
[email protected]
http://mail.nongnu.org/mailman/listinfo/qemu-devel
Signature · 2 lines
Infinite complexity begets infinite beauty. Infinite precision begets infinite perfection.
On Mon, 2004-05-03 at 05:09, Jim C. Brown wrote:
Hi Jim,
Quoted 11 lines
I recommend using vde by Renzo Davoli instead of the default tuntap. I am able to network 2 instances of windows 98 (in separate qemu's) and minix 2.0.4 (in a hand-modified bochs). It worked without a hitch, and all the machines are on the same subnet.
You still need forwarding to let the virtual machines see the lan or the internet, however. The plus with vde is that you don't need to set up routing for all these different tunN devices. (I use the Shorewall firewall, and using tun was a pain...vde means I just have to set up routing and masquerading for tap0, instead of for tun0, tun1, tun2, ...)
may you tell me how you set up your vde network ? I downloaded vde, installed it, bootet 2 qemus (on the same subnet) and tried to ping each other... I does not work, but i can ping the host they run on using a tap0 device, and see the who-has... arp stuff while running tcpdump on tap0. So it would be very interesting how you configured your vde_switch qemu setup for multiple machines on the same vde_switch.
thanks,
arne
Quoted 7 lines · Arne Bernin
On Mon, 2004-05-03 at 05:09, Jim C. Brown wrote:
Hi Jim,Quoted 4 lines
I recommend using vde by Renzo Davoli instead of the default tuntap. I am able to network 2 instances of windows 98 (in separate qemu's) and minix 2.0.4 (in a hand-modified bochs). It worked without a hitch, and all the machines are on the same subnet.
Thank you for the advertisement ;-)
Quoted 7 lines
Quoted 7 lines
You still need forwarding to let the virtual machines see the lan or the internet, however. The plus with vde is that you don't need to set up routing for all these different tunN devices. (I use the Shorewall firewall, and using tun was a pain...vde means I just have to set up routing and masquerading for tap0, instead of for tun0, tun1, tun2, ...)
Quoted 6 lines
may you tell me how you set up your vde network ? I downloaded vde, installed it, bootet 2 qemus (on the same subnet) and tried to ping each other... I does not work, but i can ping the host they run on using a tap0 device, and see the who-has... arp stuff while running tcpdump on tap0. So it would be very interesting how you configured your
vde_switchqemu setup for multiple machines on the samevde_switch.
start your vde_switch
% vde_switch -daemon
to run qemu with vde you need to compile and install also the vdeq utility (inside the qemu subdir of vde source code). Then run
% vdeq qemu ......
use all the other parameters for qemu at the end .... (but -n or user-net obvsly). vdeq sets -tun-fd automatically.
I have coded also a shortcut to run qemu.
If you make a symbolic link of vdeq to vdesomething it runs "something" so a symlink to vdeqemu let you write
% vdeqemu .....
instead of the previous command.
(if you have several versions of vde as I do, you can have several symlinks with several suffixes).
Quoted 1 line
Just a final comment to say that I have just released the vde 1.5 with a bugfix for qemu support (it missed some packets on very fast networks) and slirp support for the entire vde network.
Fabrice, I have included your bootp mangement (with copyright and thanks in the man page and in the README, GPL compliant).
ciao
renzo
Errata-Corrige
Quoted 2 lines
(if you have several versions of vde as I do, you can have several symlinks with several suffixes).
(if you have several versions of *qemu* as I do, you can have several symlinks with several suffixes).
just for the sake of readability.
renzo
Quoted 2 lines
start your
vde_switch
%vde_switch-daemon
If you want a vde_switch connected to a tun interface the command is:
(you must be root!)
# vde_switch -daemon -tap tap0 # chmod 777 /tmp/vde.ctl
renzo
Sorry to be a bit OT, but this tool is used to run qemu....
Quoted 22 lines · Arne Bernin
On Mon, 2004-05-03 at 05:09, Jim C. Brown wrote:
Hi Jim,
Quoted 11 lines
I recommend using vde by Renzo Davoli instead of the default tuntap. I am able to network 2 instances of windows 98 (in separate qemu's) and minix 2.0.4 (in a hand-modified bochs). It worked without a hitch, and all the machines are on the same subnet.
You still need forwarding to let the virtual machines see the lan or the internet, however. The plus with vde is that you don't need to set up routing for all these different tunN devices. (I use the Shorewall firewall, and using tun was a pain...vde means I just have to set up routing and masquerading for tap0, instead of for tun0, tun1, tun2, ...)
may you tell me how you set up your vde network ? I downloaded vde, installed it, bootet 2 qemus (on the same subnet) and tried to ping each other... I does not work, but i can ping the host they run on using a tap0 device, and see the who-has... arp stuff while running tcpdump on tap0. So it would be very interesting how you configured your
vde_switchqemu setup for multiple machines on the samevde_switch.
Quoted 4 lines
thanks,
arne
[/space/qemu/qemu-0.5.4/ $] su root [/space/qemu/qemu-0.5.4/ #] vde_switch -daemon -tap tap0 [/space/qemu/qemu-0.5.4/ #] ifconfig tap0 192.168.1.254 [/space/qemu/qemu-0.5.4/ #] chmod 777 /tmp/vde.ctl [/space/qemu/qemu-0.5.4/ #] exit [/space/qemu/qemu-0.5.4/ $] vdeq qemu -hda disk1.img
This works, not only can I ping 2 different machines on the vde, I can also ping the LAN from the vde, and vice versa. (ifconfig seems to set up routing automagicly. Or was it something I put into shorewall...)
Note that for teh guest OS, you need to set up 192.168.1.254 as the default gateway for just about everything.
Quoted 8 lines
_______________________________________________
Qemu-devel mailing list
[email protected]
http://mail.nongnu.org/mailman/listinfo/qemu-devel
Signature · 2 lines
Infinite complexity begets infinite beauty. Infinite precision begets infinite perfection.
Quoted 7 lines · Jim C. Brown
[/space/qemu/qemu-0.5.4/ $] su root [/space/qemu/qemu-0.5.4/ #]
vde_switch-daemon -tap tap0 [/space/qemu/qemu-0.5.4/ #] ifconfig tap0 192.168.1.254 [/space/qemu/qemu-0.5.4/ #] chmod 777/tmp/vde.ctl[/space/qemu/qemu-0.5.4/ #] exit [/space/qemu/qemu-0.5.4/ $] vdeq qemu -hda disk1.img
Quoted 7 lines
This works, not only can I ping 2 different machines on the vde, I can also ping the LAN from the vde, and vice versa. (ifconfig seems to set up routing automagicly. Or was it something I put into shorewall...)
Note that for teh guest OS, you need to set up 192.168.1.254 as the default gateway for just about everything.
thanks, it is working now, just had some wrong firewall settings on the guest OS linux boxes....
--arne