Connecting a Linux to a Fortigate SSL VPN

In this post we will see how easy it is to install the Fortigate VPN client for Linux and how to connect, I'm not a friend of VPNs, But sometimes it's time… So if you have a Fortigate VPN-SSL already created and want to connect, This is your post!

Well, very simple, Once we have our Linux updated, with your network name, IP address and NTP, we can start building the Fortigate VPN client for you now, better known as FortiClient. Here are the steps I used on a CentOS / AlmaLinux:

dnf install epel-release dnf makecache --refresh dnf -y install openfortivpn openfortivpn DIRECCION_IP_PUBLICA_FORTIGATE:8443 -u USERNAME -p PASSWORD --trusted-cert ID_CERTIFICADO

If your OS is based on Debian, I understand that substituting 'dnf’ by 'apt’ you would have it anyway.

We can create a script with 'nano /home/user/conecta_vpn.sh’ to run when your computer starts up and connects automatically, as well as if the VPN connection drops so that it lifts itself, with the following content we would have it:

while true do OpenFortiVPN DIRECCION_IP_PUBLICA_FORTIGATE:8443 -u USERNAME -p PASSWORD --trusted-cert ID_CERTIFICADO done

Remember to make the script executable with 'chmod +x /home/user/conecta_vpn.sh’ and we can put it in the cron so that it runs every time the computer restarts, from 'crontab -e', we add:

# m h dom mon dow command @reboot sleep 10 && /home/user/conecta_vpn.sh

And chimpanzeum! Short and to the point! VPN Connected Client… Valid for a Rasberry Pi, for a virtual machine, anything running Linux and you want to connect to a Fortigate SSL VPN.

Recommended Posts

Author

nheobug@bujarra.com
Autor del blog Bujarra.com Cualquier necesidad que tengas, Do not hesitate to contact me, I will try to help you whenever I can, Sharing is living ;) . Enjoy documents!!!