openfortivpn使用

VPN客户端和Server之间通过某种VPN协议进行通讯,实现两个私有网络的连通。VPN协议主要有PPTPL2TP/IPSecOpenVPNSSTPIKEv2五种。本工具是fortiClientVPN的开源版本,即VPN的客户端。

商业版VPN产品,其VPN客户端和Server会支持多种VPN协议,然后协商使用其中一种,此时一般安装其对应的客户端才能正常连接。

引自:https://askubuntu.com/a/1226407

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

使用

https://github.com/adrienverge/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
    7
    host = vpn-gateway
    port = 8443
    username = foo
    set-dns = 0
    pppd-use-peerdns = 0
    # X509 certificate sha256 sum, trust only this one!
    trusted-cert = e46d4aff08ba6914e64daa85bc6112a422fa7ce16631bff0b592a28556f993db
  • For the full list of config options, see the CONFIGURATION section of

    1
    man openfortivpn

参考

  1. 五种VPN协议介绍
  2. how to connect ssl vpn on ubuntu

评论