[vbox-dev] Source code for bridging interfaces

Ivo Smits Ivo at UFO-Net.nl
Fri Jul 29 15:27:01 PDT 2011

Hello Tom,

You should probably take a look at libpcap. It can attach to a network 
interface and send/receive arbitrary packets. I don't think it is 
exactly what VirtualBox uses (VirtualBox uses some kernel interface), 
but libpcap can do pretty much the same thing, although perhaps with 
lower performance, but without kernel hacking. This should work on both 
Windows and Linux.

The manual at http://linux.die.net/man/3/pcap shows how to use libpcap. 
You will probably need the pcap_open_live and pcap_sendpacket functions. 
Another option is to use a tun/tap device (some example code: 
http://oss.ucis.nl/hg/quicktun/file/7c5e5be876bb/src/common.c#l145) and 
use a bridge to connect this to the real interface.

Best regards,

Ivo Smits

Op 29-7-2011 15:53, Tom Tasche schreef:
> Hello,
> Some colleagues and I are working on a networking related software
>   for our diploma thesis.
> Basically we want to connect Cisco's PacketTracer to a real network
>   (that's actually not our diploma thesis, but it's one part of it)
>   and therefore need to bridge a physical interface
>   for receiving and sending ethernet packets with different mac addresses.
> We have tried to use the socket library on linux,
>   but it doesn't work on every NIC to fake the MAC address.
> Now we want to extract that code out of VirtualBox.
> However, we couldn't find that pieces of code
>   in VirtualBox's 270MB of awesome source sauce.
> Would you guys be so kind and help us?
> Oh, and sorry if this isn't the right place for this kind of question.
> The forum looked like it's for users only...
> Thank you and have a great day
> Tom
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev

More information about the vbox-dev mailing list