0

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.

2
  • 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, 2018 at 15:20
  • If you just need IP level packets you can just use the loopback interface and open it in raw mode on the receiving side. For other raw protocols you need a specialized driver. So unless you're virtualizing a physical network you can use the built-in driver. Apr 22, 2019 at 9:38

2 Answers 2

1

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.

0

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:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .