Question

When I connect to a VPN I am unable to reach my server

Posted March 29, 2021 242 views
VPN

I am connecting vía openfortivpn to a fortinet VPN and after I am able to connect to the VPN, I get kicked off the ssh connection and I am not able to access my site vía http either.

The only way is to reboot my server to gain access again, because on reboot it will drop the VPN connection.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi,

It looks like all your network traffic going outside is sent through VPN server/gateway, when your VPN connection is established. Then, I would consider one of two solutions:

1. If you are an admin of Fortinet VPN server/gateway, you can change the VPN configuration. I believe it is possible to configure routing in the way that the traffic addressed to VPN network goes through VPN server, and the rest of the outside traffic is sent through your default Internet gateway. Unfortunately, I am not familiar with Fortinet products, so I cannot help you with such configuration. I believe there are the dedicated forums for Fortinet products, where you can get an advice.

2. You can add the static routes to the servers you want to get to when VPN connection is established. However, I cannot recommend this solution, if you work from different places using different ISPs.

For example. You work from home and you connect to the Internet through your home ISP’s router that has got an IP address 192.168.1.1. You would like to have an access to your droplet, holding an IP address 111.222.333.444, after VPN connection is establihed. The command to add a static route to this droplet in Ubuntu would look like:

sudo ip route add 111.222.333.444/32 via 192.168.1.1

I hope it helps.

  • Thank you this helps a lot.

    In my case option 2 will work since we are connecting our droplet to the client vpn just to get some information so our network connection won’t be changing.

    If someone else is trying to do what We are, I have found that when connecting over openfortivpn you should add the flags for no dns and no routing on the VPN, in order to avoid the webserver to be unavailable.

    openfortivpn vpn-gateway:8443 -u foo –no-routes –no-dns –pppd-no-peerdns