I'm looking for a way to emulate a network adapter on windows and be able to use the packets in a program. The program will then send them over alternate means. I just need to create a virtual network adapter that gives me access to packets. Is there a pre-written custom driver for this or would I need to write my own? I read something about TAP driver for windows, but I'm not sure if it is what I need.

  • The TAP driver creates a virtual network interface with its “cable” connected to the program opening the interface. That program is responsible for doing something sensible with the Ethernet frames it receives. Sounds like that could be what you want. – Daniel B Dec 7 at 15:20

Yes, for a standalone virtual interface, the most common method is indeed the TAP driver – originally made by OpenVPN to imitate the Linux built-in 'tap' interface type. It's open-source, but you'll probably want to use the official distribution as it's digitally-signed (a requirement nowadays).

The other approach is to build a custom driver doing the same thing. I believe that's what VirtualBox does for its "Host-only networking" feature (which is, also, a virtual interface sending all packets to software).

If all you need is layer3 (IP) packets, you can also try implementing the app as a Windows VPN provider, although this is only available for UWP apps – but doesn't require a driver.

You don't need to emulate anything.

You already have an adapter in your computer that you may use. This is the Microsoft Loopback Adapter, also known under the name of localhost.

If you are writing a program, here are a couple of references to get you started:

  • Does someone think it's easy to implement a TAP or a driver, all in order to send messages? – harrymc Dec 7 at 20:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.