We have a Personal VPN that we create from within our app. The app will first attempt to connect to a server on the local wifi. If the sever is available and we are on that network then we do not start the VPN. If the server is not available then we will start up the Personal VPN and then we can connect to our server via the VPN. This all works fine unless we hve the situation that the local network IP schema is the same IP address as our server that we want to reach via the VPN.
If our server is on a LAN network of 192.168.1.100 and we are on a Wifi netwok that is also setup to be 192.168.1.x then while our server is not on the local wifi network and we start the VPN then we find that the traffic to our desired server is not being routed over the VPN but going to the local wifi where of course we already know the server does not exist.
Is there a way programmatically to force a route so that iOS will route traffic for this specific IP address down our VPN tunnel and not route it to the local network?