we have received assignment at work which includes porting some product from windows to linux. Part of that product functionality is an NDIS6 miniport network adapter, which apparently only passes through network buffers. It has an identifier and MAC address. Separate service application activates that network driver and starts IP services that pass network traffic through this adapter.
My question is what would be functional replacement of such 'dummy' network driver on Linux?
Best Answer
"Miniport network adapter" does not explain much – miniport driver is something rather specific to the Windows driver model, and describes how the driver was written, but not what it does.
If your goal is to create a network interface that is controlled by software (i.e. packets sent through the interface are received by a program through a filehandle, and vice versa), then you should use a
tap
ortun
interface. (The former carries packets with a layer-2 Ethernet header, the latter without, but otherwise they're the same.)Official documentation:
https://www.kernel.org/doc/Documentation/networking/tuntap.txt
(This documentation is quite old; in all modern Linux distributions you do not need to create device nodes by hand, nor load kernel modules manually. However, section 3 "Program interface" and the ioctl-based API is still accurate.)
TUN/TAP interfaces are used by most VPN and VM software on Linux; indeed the "TAP-Windows" and "Wintun" NDIS drivers that are available on Windows were written to imitate them.
It is also possible to write your own network interface driver which does the same (such as 'vboxnetadp' used by VirtualBox and 'sheep_net' used by the SheepShaver Mac emulator), but most sysadmins will thank you for not doing so and for using the standard tun/tap instead.