After a successful connection, the VPN clients default route needs to point to the VPN gateway to route all traffic through the established tunnel.
Therefore, scripts need to be in place to manage setting the default route. The process is as follows:
- Prior to connecting, the current default route needs to be saved.
- A new default route through the tunnel needs to be set.
- After the VPN connection terminates, the original default route must be restored.
Following this process, the machine still has network access in case the VPN connection drops and cannot be re-established again.
To simplify the scripts doing the replacement of default routes, pptp.ipredator.se needs to be resolved to an IP address, which is then used throughout the following configuration process.
Because IPredator uses DNS round robin to distribute connecting clients evenly over the available VPN servers, you need to look up an IP address from the currently available pool of VPN machines via dig.
An example of using dig is shown next.
# dig pptp.ipredator.se +short
You receive a list of DNS A records. Run dig on your console and select one single IP from your output.
For this guide 18.104.22.168 was chosen and used throughout this document.
Adjust the following configuration snippets and scripts to resemble the IP you have chosen.