My clients connect to my VPN server so they could connect to a database sever behind it using an application. Manually I add a static/permanent route:
route -p -4 add 22.214.171.124 mask 255.255.255.255 172.23.0.0 metric 2 if 18
The rule above works every time as expected the application successfully connects to the database server, but if some new interface is being added, maybe some internet dongle or something the app will not connect because the interface may change from 18 to 19 and the other reason is that I want to automate the VPN connection with CMAK
If I simply add this rule: route -p -4 add 126.96.36.199 mask 255.255.255.255 172.23.0.0
..the application will connect but as soon as I disconnect the VPN connection and reconnect it back again again the app will not connect. Why does this happen? What rule will work in any cases ? What I'm doing wrong?
I need any IP from 172.23.0.0 to be able to reach 188.8.131.52
Why do I add 172.23.0.0 ? because clients receive an IP randomly.
Edited by Eugen, 23 February 2017 - 04:39 AM.