Trying to understand how OVPN client works

New OpenWRT user here. I've got a RPI3 that I'm setting up as a travel router. I've got my VPN provider set up on it as a OVPN client.

Everything works. That's not what I'm trying to figure out. It worked right away. My issue is that all the tutorials say something along the lines of:
1 - install OVPN (ok I understand)
2 - Create interface TUN0 - Ok, I still follow
3 - upload your ovpn config file - gotcha
4 - configure firewall - starting understand how all that works

But, I don't see how the heck it manages to link TUN0 to my OVPN configuration. What is going on here? Like I said, it works fine but I don't see why it works!

In your OpenVPN config file, there is almost certainly directive that will say something like

device tun

or

device tun0

(if it's just tun, the system will make it tun0 (as in the first instance of tun, zero referenced). By linking tun0 to your firewall (option device 'tun0' in the firewall zone), or by creating a network with tun0 (and unamanaged protocol) and then linking that network into the covered networks in the firewall zone, that informs the firewall how to handle and route the tun0 device.

Now, what is tun0? This is simply short for tunnel... all of the traffic that flows between your endpoint and your VPN provider traverses the internet via this tunnel. The tunnel is encrypted and provides a private channel for your data to flow between the two endpoints securely.

Does that answer your questions?

1 Like