HanG321 Blog

Add route after VPN

For some business reasons, company provides FortiGate SSL VPN to connect office network, but some subnet cannot be accessed due to route did not add automatically.

here is a PowerShell script to find the gateway and interface of VPN connection then add route. It will be great if I can find out how to run script automatically after VPN connection made.

let say office VPN subnet is 10.50.10.0/24, add 2 new subnet by following

FortiGate SSL VPN client is based on PPP, different to Cisco or others as normal network adapter.

ref:
http://serverfault.com/questions/145259/powershell-win32-networkadapterconfiguration-not-seeing-ppp-adapter
http://stackoverflow.com/questions/3293629/script-for-add-route

photo credit: Brent Hensarling
cc