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
