TAP is basically at Ethernet level (layer 2) and acts like a switch where as TUN works at network level (layer 3) and routes packets on the VPN. TAP is bridging whereas TUN is routing. From the OpenVPN Wiki: TAP benefits: behaves like a real network adapter (except it is a virtual network adapter)

To put the matter more simply, the TUN/TAP driver creates a virtual network interface on your Linux box. This interface works just like any other; you can assign IP addresses, route to it, and so on. But when you send traffic to that interface, the traffic is routed to your program instead of to a real network. Mar 20, 2017 · The tun_alloc() function takes two parameters, dev is the name of the virtual device (empty if we want the kernel to decide for us) and flags contains some options about the interface (including whether it’s a TUN or a TAP interface). Mar 20, 2008 · Little late with this but what the hey. You must be careful using ifconfig ethx:x down. If you run more than one virtual interface on a network card taking one out of the middle will move the list up. Say if you have 4 virtual interfaces of which the first is the real eth1. So if you take out eth1:2 then eth1:3 becomes eth1:2 and eth1:4 becomes Aug 03, 2018 · Basic Properties->IPv4 Interface->vnet0 Basic Properties->IPv4 Default Router-> Network Properties->vnet_default_interface->bridge0 I restarted the jail, ran ifconfig tun create and then service openvpn start. The above seems to work, for now.

Code: Select all client dev tun port 1194 proto udp remote 5.199.x.x nobind resolv-retry infinite user nobody group nogroup persist-key persist-tun ns-cert-type server comp-lzo verb 5 pull #auth-user-pass #ifconfig-push 10.0.0.166 10.0.0.167

# simplified routing table target/netmask - gw - interface internet - wan # internet network client1/24 - client1.1 - lan # internal network (client1.1 is this gateway itself) vpnC/24 - vpnC.1 - tun0 A/24 - vpnC.1 - tun0 vpnA/24 - vpnC.1 - tun0 B/24 - vpnC.1 - tun0 vpnB/24 - vpnC.1 - tun0 # the pushed routes by the definition of vpnC Article Number: 640 | Rating: 3/5 from 2 votes | Last Updated: Mar 22, 2017 at 5:03 PM

How to create a bridge / tun tap under linux inside /etc

The tun interface is a software loopback mechanism that can be loosely described as the network interface analog of the pty (4), that is, tun does for network interfaces what the pty (4) driver does for terminals. This socat documentation page does a good job of showing how they could be used. excerpt from socat doc