A
A
alex_ak12018-10-26 15:49:47
VPN
alex_ak1, 2018-10-26 15:49:47

How to configure routing when using vpn?

I connect to the client from a computer on windows 7 via a standard VPN, and a second interface appears through which all traffic begins to go.
That is, tracert clientsrv leads to vpn (a route like vpngateway 192.168.20.1 -> clientsrv 192.168.30.123 and the desired server is found on the second hop), tracert ya.ru leads to vpn, which is not good, but tracert mylocalsrv does not lead to vpn and pings the local server.
How to make it so that the output is correctly registered both in vpn and in my regular Internet.
At the same time, route print shows two default routes - one to vpn, the second to my Internet. I tried to change the metrics, nothing changes in terms of traffic routing.
If you uncheck the vpn properties "let all traffic through the gateway to vpn", then all traffic goes through my LAN and clientsrv no longer pings, which is wrong. At the same time, the second route of the form 0.0.0.0/0.0.0.0 disappears, which leads inside the vpn.
You can, of course, register redirection to the network 192.168.30.0/24 through the gateway 192.168.20.1 in the routing, but it is somehow strange to register this every time, in my opinion.
You can, of course, set up permanent routing, but I don’t know how correct this is.
route add 192.168.30.0 masj 255.255.255.0 gw 192.168.20.1 -p
This even works

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
athacker, 2018-10-26
@alex_ak1

You will have to uncheck the "Use default gateway in remote network" checkbox, and manually enter the routes to the networks you need that are accessible via the VPN when connecting to the VPN. Otherwise, these tunnels on Windows do not know how, unfortunately. You can concoct a batch file for this matter, or powershell, but prescribing routes requires privilege escalation, because anyway, some part of the manual work will be saved. If you want to automate route pushing, switch to OpenVPN or IPsec. There it is possible to specify which specific networks are available through the VPN, and the rest, respectively, will go through the default client gateway, i.e. in the usual way.

S
Sergey, 2018-10-26
@SStep

Use CMAK https://habr.com/post/186674/
To prepare a customized exe that creates a connection and prescribes routes when connected

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question