A
A
alexei_lukhanin2016-06-08 14:03:11
openvpn
alexei_lukhanin, 2016-06-08 14:03:11

How to prohibit traffic bypassing the VPN (in case of a break)?

There is a program OPENVPN Portable. Through the Firewall I do not want to configure. Tried to do it via command line:
route delete 0.0.0.0 mask 0.0.0.0
//delete all routes
route add -p ip(VPN gateway "Main Gateway") mask 255.255.255.255 ip(Internet Gateway "IP Address")
//allow access to internet vpn
route add 0.0.0.0 mask 0.0.0.0 ip(VPN of "Main Gateway" gateway)
//add default vpn route
After deleting all routes, the "Main Gateway" VPN connection disappears.
As a result, when I write the command route add -p (ip address of the Main VPN gateway) (VPN mask) (IP address of the VPN) - then it gives an error in the IP address of the "Internet Gateway", or that the "Main Gateway" does not lie in this network ...
Please tell me, maybe I'm not entering the data correctly?
Explain step by step.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexei_lukhanin, 2016-06-08
@alexei_lukhanin

Solution found.
The essence is as follows:
1. connect the VPN
2. write route print on the command line
We are looking for addresses 0.0.0.0 there
The address of the gateway with metric 1 is VPN
The address of the gateway with metric 25 is our Internet We
write down the Addresses of the gateways
3. on the command line we write route add - p ip (VPN gateway) mask 255.255.255.255 ip (Internet gateway)
4. in the command line, write route add 0.0.0.0 mask 0.0.0.0 ip (VPN gateway)
Done. All traffic goes through the VPN, and when the VPN breaks, the traffic does not go anywhere.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question