V
V
Vladimir Ainov2020-12-03 15:36:46
Mikrotik
Vladimir Ainov, 2020-12-03 15:36:46

DNS and VPN provider in Mikrotik. Why won't VPN reconnect after a line break?

Hello.
Tell me why, after a disconnection, the VPN provider through which the Internet is accessed does not connect again?
Structure - a local area network of the city at the provider. In it, I launch a VPN connection with the provider. After that, Internet access is provided through this VPN connection. The VPN has a static address.
Mikrotik's DNS contains the DNS of the local network provider (172.22.0.1). The VPN specifies the domain address for the connection (vpn.local), not the IP. The IP of this address can take on the values ​​172.22.0.230 - 254. Any of this range.
I got the impression that after the break, the VPN does not see the IP of the vpn.local domain through DNS. VPN hits it is not clear where in the cycle.
What is the reason? There is no ping to vpn.local from Mikrotik. It is also not visible from the computers on my network. I registered in Route exactly where the network with vpn.local and DNS (172.22.0.0/24) is located, behind which gateway (172.30.94.1). Zero sense. Prescribed there Pref. Source - my IP in the provider's local network (172.30.94.38). Bestolku.

After lengthy experiments, I came to the following conclusion:

In general, I tried to disable the VPN.
From the beginning, the VPN is disabled. Then the route switches to the backup line. It works.
There is a main line. The route is switched. Then the VPN is turned on.
Zero effect. VPN in a cycle beats it is not known where.

There is the following suspicion - the domain name for the vpn.local connection is specified in the VPN provider.
By this name, the provider's DNS issues an IP for connection in the range 172.22.230 - 172.22.0.254. Any of them can be.
The VPN provider in Mikrotik gets this IP and makes a connection and seems to remember it tightly.
Those. after a line break, the provider's DNS disappears, and when it appears, it suggests using a different IP for connection and it looks like the provider somehow reserves that I can only connect to this IP, and in Mikrotik VPN remembers the IP to which it connected last time and beats into it, and it is forbidden to connect again. This is where the VPN cycle comes in.
When you restart the IP in the VPN, it seems to be reset and re-queries it from the DNS, so the connection occurs immediately. Remembers the VPN IP, most likely so that in the event of a break, the connection is restored faster. But this works fine only if the IP for connection is always the same.
Such thoughts came after I watched the restoration of the main line. Sometimes (but rarely) the switch works fine. This is the situation when the IP given by DNS matches the IP to which the VPN was connected earlier.
The question is how to force the VPN to request an IP from the DNS provider every time when it breaks before connecting?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
Diman89, 2020-12-04
@avi

This can happen if in the vpn settings the old session after the break is still listed as alive, and it does not accept the same login again. After the break, try to disable on the vpn interface, wait 5-10 minutes and enable. If it connects, then it is so

D
Drno, 2020-12-03
@Drno

Well, because dns is unavailable and mikr cannot translate the address into ip

V
Vladimir Ainov, 2020-12-04
@avi

After the restoration of the DNS line is available. Pings. But the VPN cycled connect-disconnect, and continued to do so. Waited 10 minutes for nothing.
Could it be better to describe the whole connection?

I
Internet, 2020-12-05
@geniuscomposervsevolodpus

NAT provider is most often to blame.

G
gracecat, 2021-06-05
@gracecat

Since I work in China, I have used Nordvpn before. I found that Nordvpn was banned in China in 2021. I want to talk to my wife and kid using FB or Line, so I need to find a good VPN to connect to. I checked several websites and checked my friend in China.
I was given this:
expressvpn

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question