My Mikrotik’s public IP is 185.5.5.5, my Linux VPS server’s public IP is 212.2.2.2.
Mikrotik is running an OVPN server operating in ethernet mode (I need the tap interface), I can connect to it using a windows PC (outside the physical LAN), no issue so far.
I set up a secret that has ‘local address’ of 172.16.5.1 and ‘remote address’ 172.16.5.3.
Before any openvpn connection, ip route
gives the following output:
default via 169.254.0.1 dev ens3
10.0.0.0/8 dev ens3 proto kernel scope link src 10.24.101.219
169.254.0.1 dev ens3 scope link
212.5.5.5 via 169.254.0.1 dev ens3 src 212.2.2.2
Now if I set the redirect-gateway option in mikrotik OVPN server options, the linux server fully loses internet access. Here are resulting routes
0.0.0.0/1 via 172.16.5.1 dev tap0
default via 169.254.0.1 dev ens3
10.0.0.0/8 dev ens3 proto kernel scope link src 10.24.101.219
128.0.0.0/1 via 172.16.5.1 dev tap0
169.254.0.1 dev ens3 scope link
172.16.5.0/24 dev tap0 proto kernel scope link src 172.16.5.3
185.215.187.46 via 169.254.0.1 dev ens3
212.5.5.5 via 169.254.0.1 dev ens3 src 212.2.2.2
And if redirect-gateway option is not set, then everything stays the way it was before the connection, though I was able to find out that the tap0 is operational and I can use it in software where I can specify the interface. Openvpn adds only the following route:
185.5.5.5 via 169.254.0.1 dev ens3