目錄
- Install on Rocky8
- run with su
Install on Rocky8
* 這是 30 試用版
過期後連線時
FortiClient SSLVPN is unavailable: FortiClient VPN trial has expired. Please contact your administrator or connect to EMS for license activation.
dnf config-manager --add-repo https://repo.fortinet.com/repo/forticlient/7.2/centos/8/os/x86_64/fortin...
dnf install forticlient
/opt/forticlient/forticlient-cli version
FortiClient Version: 7.2.1.0700 FortiClient Serial: FC... FortiClient UID: 51...
FortiClient VPN only
* 這 Version 不會過期
https://www.fortinet.com/support/product-downloads#vpn
run with su
* 沒有設定 XDG_RUNTIME_DIR 係執行唔到 fortivpn
su -l fortivpn
declare -x XDG_RUNTIME_DIR="/tmp/user/$(id -u)"
mkdir -p $XDG_RUNTIME_DIR
/opt/forticlient/fortivpn status
Notes: XDG_RUNTIME_DIR
- It is an environment variable that is set automatically when you log in.
- It tells any program you run where to find a user-specific directory in which it can store small temporary files.
- Note that XDG_RUNTIME_DIR is set by pam_systemd(8)
建立 VPN
1) 建立 Profile
./fortivpn edit "VPNProfileName"
2) connect SSLVPN
./fortivpn connect <VPNProfileName> -u <username>
3) status
./forticlient/fortivpn status
3) disconnecting SSLVPN
./fortivpn disconnect <VPNProfileName>
i.e.
./fortivpn edit OFFICE
./fortivpn connect -u MyUser
Checking
forticlient vpn list
VPNs: Personal VPNs: OFFICE
fortivpn view OFFICE
VPN: OFFICE Remote Gateway: x.x.x.x:443 Client Certificate: None Authentication: Username: YOUR_USERNAME Single Sign On (SSO) for VPN Tunnel: Disabled Auto Connect: Disabled Always Up: Disabled Save Password: Enabled
forticlient vpn status
Status: Connected VPN name: OFFICE Username: YOUR_USERNAME IP: 192.168.88.200 Sent bytes: 4482 Recv bytes: 8833 Duration: 00:16:08
"connect" with More Settings
fortivpn connect <vpn_name> --user=username --password --save-password --always-up --auto-connect
Notes
--save-password
Allows the user to save the VPN connection password in FortiClient
--auto-connect
When FortiClient launches, the VPN connection automatically connects.
--always-up
If the connection fails, possibly due to network errors, FortiClient attempts to reconnect.
Remove VPN connection
/opt/forticlient/fortivpn status
Status: Connected VPN name: OFFICE Username: ... IP: 192.168.X.X ...
# 因為 remove 時不會 disconnect, 所以要另外 disconnect
/opt/forticlient/fortivpn disconnect
Status: Disconnected DONE.
/opt/forticlient/fortivpn remove OFFICE
Remove VPN: OFFICE DONE.