Fortinet SSL VPN Client in Ubuntu


It is intereting that the Fortinet SSL VPN client works fine in my Windows machine, but does not work in my Ubuntu laptop. I have found the reason is that a few routes are missed in the routing table. To make it work, I wrote a script to manually add those routes after VPN is connected.

Create an executable file named VPN under /usr/local/bin. Next time just run the command VPN to connect vpn and add routes.

#!/bin/bash

# Start VPN
/home/jchen/Downloads/forticlientsslvpn/forticlientsslvpn&

# Check if ppp0 is ready
while ! ifconfig  | grep ppp0 >/dev/null 2>&1
do
echo VPN is connecting…
sleep 3
done

# Add routes
IP=`ifconfig ppp0 | grep ‘inet addr’ | awk ‘{print $2}’ | cut -d’:’ -f2`
sudo route add -net 1.1.1.0/24 gw $IP dev ppp0
sudo route add -net 2.2.2.0/24 gw $IP dev ppp0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s