openfortivpn使用
VPN客户端和Server之间通过某种VPN协议进行通讯,实现两个私有网络的连通。VPN协议主要有PPTP,L2TP/IPSec,OpenVPN,SSTP,IKEv2五种。本工具是fortiClientVPN的开源版本,即VPN的客户端。
商业版VPN产品,其VPN客户端和Server会支持多种VPN协议,然后协商使用其中一种,此时一般安装其对应的客户端才能正常连接。
As Fortinet VPN could use several VPN protocols
And as we do not know which one
-> You’d better use the Forticlient Official client for Linux & Ubuntu
Then you could export the vpn client xml configuration file from Windows that you will import to the Ubuntu client.
引自官方文档
安装
1 | sudo apt install openfortivpn |
使用
Simply connect to a VPN:
1
openfortivpn vpn-gateway:8443 --username=foo
Connect to a VPN using an authentication realm:
1
openfortivpn vpn-gateway:8443 --username=foo --realm=bar
Store password securely with a pinentry program:
1
openfortivpn vpn-gateway:8443 --username=foo --pinentry=pinentry-mac
Don’t set IP routes and don’t add VPN nameservers to
/etc/resolv.conf
:1
openfortivpn vpn-gateway:8443 -u foo --no-routes --no-dns --pppd-no-peerdns
Using a configuration file:
1
openfortivpn -c /etc/openfortivpn/my-config
With
/etc/openfortivpn/my-config
containing:1
2
3
4
5
6
7host = vpn-gateway
port = 8443
username = foo
set-dns = 0
pppd-use-peerdns = 0
# X509 certificate sha256 sum, trust only this one!
trusted-cert = e46d4aff08ba6914e64daa85bc6112a422fa7ce16631bff0b592a28556f993dbFor the full list of config options, see the
CONFIGURATION
section of1
man openfortivpn