Understanding Routes and Gateway for a TUN VPN in OPENVPN

0

I am trying to understand the network setup that gets configured in my machine everytime I connect to an OpenVPN (Tun mode).

My OpenVPN client creates the following Routes:

Destination        Gateway            Flags        Refs      Use   Netif Expire
10                 10.240.0.5         UGSc            1        1   utun1
10.128.16/24       10.240.0.5         UGSc            1        0   utun1
10.240.0.1/32      10.240.0.5         UGSc            0        2   utun1
10.240.0.5         10.240.0.6         UH              5     1442   utun1

As I understand this '10.240.0.5' is the gateway for accessing VPN resources. However, the gateway for '10.240.0.5' is '10.240.0.6' which is my local IP in this VPN. So the gateway for my gateway is my local IP? I am not following it, for me it seems like a 'loop', but I am clearly missing something.

Another thing is that '10.240.0.5' is a non-pingable address. I find it weird when I cannot ping my gateway (I know in some circumstances icmp might be blocked, but seems not to be the case here).

This is the network interface that gets configured by OpenVPN:

utun1: flags=8151<UP,POINTOPOINT,RUNNING,PROMISC,MULTICAST> mtu 1500
    inet 10.240.0.6 --> 10.240.0.5 netmask 0xffffffff

I am not following this thing: '10.240.0.6 --> 10.240.0.5' either, but I assume it has something to do with my confusion with gateway above.

Anyway, this setup works, can anyone please explain how my packages can departure from my machine to the VPN with above mysterious gateway '10.240.0.5'. Is it a hidden virtual IP that OpenVPN configures for TUN VPNs? Any additional material that would help me to gather more deep knowledge about it?

linux
networking
vpn
openvpn
mac-osx
asked on Server Fault May 30, 2019 by vinicius.olifer • edited May 30, 2019 by vinicius.olifer

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0