On Fri, 30 Sep 2005, Don Kitchen wrote:
I have some questions about the networking that I hope someone can answer. Qemu is able to use tun & tap devices. I've taken the tundev.c program, which opens a tun device and passes the fd to qemu, and compared it to the tapdev.c program (which qemu is also able to use) and there's very little difference to how it's opened. According to the little tun/tap documentation I understand, the tap descriptor should be providing ethernet frames instead of the IP packets [ethernet payloads] that tun should be providing. But qemu does not seem to differentiate between the two types of file descriptors passed by tundev and tapdev respectively, so I am a little confused how qemu can work with both types of fd's.
Both are TAP type devices, just using different device drivers in the host kernel (tundev uses the new TUN/TAP driver, tapdev uses the obsolete TAP driver)
I'm interested in the handling of ethernet frames because I haven't been able to get the bridge to pass packets between added interfaces (yes, they're all up and promisc) and I'm not too thrilled with networking being bridged anyway, and it seems to me that if an fd were hooked up to a BPF capturing everything from the real ethernet device in promiscuous mode, and pushing out any raw frames it receives, that I could bypass the bridge and make it as if the emulator's virtual ethernet device is a real one. Or is there some reason this won't work? (after all, other products don't have this, there must be a reason right?)
Look for vde_pcap. Does exacly this (via vde, but trivial to modify to be used much in the same manner as tundev). The problem is that you can't talk to the host itself using this technique, only the LAN the host is connected to.
bridgeing is the best setup if you want QEMU to be able to reach both the LAN and the host as if it was another station on the same LAN, but requires a bit of reconfiguring of the host to set things up.. (but not much).
Regards Henrik _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel