S
S
Sinot2020-12-26 12:16:39
Windows
Sinot, 2020-12-26 12:16:39

How to make a permanent route work on Windows 10?

Hello.

5fe6fd891e395629768192.png

We have a local network 192.168.0.0/21, the default gateway is 192.168.0.1.
MikroTik (192.168.0.104) is on the same network and distributes VPN (10.10.1.0/28), its IP in VPN is 10.10.1.1.

Remotely behind NAT we have a PC with Windows 10 Pro. The user logs into the system through "Connecting to the corporate network using VPN", when the VPN is immediately connected to the login / password on the welcome screen and logs into the system with the same data (his IP in the VPN is issued dynamically, let it be 10.10.1.11).

Everything works, but the network 192.168.0.0/21 is not available for Windows 10.

On the gateway 192.168.0.1 we add a route (10.10.1.1/28 192.168.0.104) to the remote PC via MikroTik. On the remote PC, add a permanentroute (192.168.0.0/24 10.10.1.1) to the network 192.168.0.0/24 through the same MikroTik, only from the VPN side.

Now the remote PC and the local network see each other (I checked this for sure).

And now the actual question: If you add a permanent
route (192.168.0.0/24 10.10.1.1) to the VPN connection on Windows 10 , then it is ignored by the system and works out the default route. That is, we prescribe a permanent route, reboot / log out of the system, log into the system through "Connecting to the corporate network using VPN", there is a connection, there is a route and it is ignored. We delete and create a route on a new one - it works until the VPN is rebooted / restarted / reconnected. How to cure it? Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2020-12-26
@Sinot

powershell "Add-VpnConnectionRoute -ConnectionName 'MyVPN' -DestinationPrefix '192.168.0.0/21'" -PassThru

C
CooLikoFF, 2021-06-22
@CooLikoFF

At the end we add the interface ID. IF ID
Example:
route add 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 1 IF 58 -p

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question