K
K
Karafen2020-04-21 22:02:47
Computer networks
Karafen, 2020-04-21 22:02:47

How to configure access via external ip vps with vpn only to a web server on the local network so that all other traffic goes through the provider?

Hello, please do not judge strictly as just a beginner, in general, the essence of the question is this: there is a local network with a server and subnet 192.168. provider via pppoe connection, the provider issues only a gray ip (provider gateway 10.10.1.1), there is basically no white ip service and there is only one provider, so the question arose of connecting to the local server on which the web server is running on a specific port, the server address in the local network is 192.168. 1.1, in connection with which a VPS with ubuntu OS was rented for an external ip on which softether server vpn was raised, softether server subnet 10.8.0.0 accordingly forwarded the desired port from the external IP vps to the interface address that the softether client installed on the router with openwert (10.8. when connecting vpn on the client, the corresponding routes (0.0.0.0 mask 0.0.0.0 gw 10.8.0.1) went up and the entire local network accesses the Internet through an external ip vps, so I apologize for being very long, how to make it so that you can connect via external ip vps only to the web server from it grew, and the whole network went along the provider's routes, bypassing the vpn?when connecting vpn on the client, the corresponding routes (0.0.0.0 mask 0.0.0.0 gw 10.8.0.1) went up and the entire local network accesses the Internet through an external ip vps, so I apologize for being very long, how to make it so that you can connect via external ip vps only to the web server from it grew, and the whole network went along the provider's routes, bypassing the vpn?when connecting vpn on the client, the corresponding routes (0.0.0.0 mask 0.0.0.0 gw 10.8.0.1) went up and the entire local network accesses the Internet through an external ip vps, so I apologize for being very long, how to make it so that you can connect via external ip vps only to the web server from it grew, and the whole network went along the provider's routes, bypassing the vpn?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Drno, 2020-04-21
@Drno

Remove the setting in the vpn client - use it as the default gateway
In ovpn, this is indicated directly in the config.
If the vpn client is on the router, set the metric to be greater than the Internet connection. For example 5

K
Karafen, 2020-04-21
@Karafen

Thank you, but alas, I tried this, when I remove the setting on the client to use the default gateway, indeed all packets start to go through the provider's gateway, but the route 0.0.0.0 mask 0.0.0.0 gw 10.8.0.1 disappears and communication, ping from the vps vpn server to the client 10.8.0.41 disappear, the appointment of a statistical route leads to the fact that everything again goes through vpn (

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question