Skip to content

Instantly share code, notes, and snippets.

@fredjoseph
Last active June 13, 2024 10:45
Show Gist options
  • Save fredjoseph/a7ea745cc2048abab5afe6e272db011c to your computer and use it in GitHub Desktop.
Save fredjoseph/a7ea745cc2048abab5afe6e272db011c to your computer and use it in GitHub Desktop.
[OpenVPN] Multi-TAP

OpenVPN, by default, installs only one TAP network interface. If you want to connect to multiple VPNs simultaneously you need a TAP interface for each VPN.

Add an additional TAP adapter

  • Open a command prompr with administrative rights
  • Go to the TAP install folder C:\Program Files\TAP-Windows\bin
  • Launch the addtap.bat script, the result will be :
    "devcon.exe" install "C:\Program Files\TAP-Windows\driver\OemWin2k.inf" tap0901
    Device node created. Install is complete when drivers are installed...
    Updating drivers for tap0901 from C:\Program Files\TAP-Windows\driver\OemWin2k.inf.
    Drivers installed successfully.
    
  • Launch the command openvpn --show-adapters for checking the result :
    Available TAP-WIN32 adapters [name, GUID]:
    'Local Area Connection 2' {DD2A53C5-63BD-492A-A7F4-94E724007B2A}
    'Local Area Connection 3' {EF7623C03-542A-34E8-B633-E3B742983E3}
    
  • Put your .ovpn config and certificates files to the OpenVPN config folder and add nobind to each config so that a dynamic (UDP) source port is used for each VPN session.

When a static assignment between a VPN and a specific interface is necessary add the TAP Interface name as parameter of the dev-node option to the openvpn config file.

dev tap
dev-node "Local Area Connection 3"
@RohitRathore1
Copy link

RohitRathore1 commented May 20, 2024

I am using windows 10 and I can't see this TAP-Windows in my Program Files. How can I resolve this issue?

@fredjoseph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment