Site icon GRIP.News

Fortinet VPN Client CLI 설치

업무에 사용 중인 VPN 서버가 “임시”로 Fortinet 제품으로 변경됐다. 대게 FortiVPN Client는 GUI용으로 제공되다 보니, EC2로 운영 중인 Ubuntu에 무거운 GDE을 설치해야 하는 불합리성이 존재한다.

위 URL에서 받은 패키지는 GUI 용이기 때문에 설치해도 CLI에서 사용할 수 없다. 구글 검색 결과 대부분 GUI용으로 설치되는 글이 대부분이라, CLI로 연결하는 방법을 정리해 봤다. 귀찮은 일이지만 xterm을 설치해야 하는데, FortiClient에서 라이센스를 물어보는 경우가 있기 때문.

 

UBuntu 계열
$ sudo apt-get update && apt-get upgrade -y
& sudo apt-get install xterm libgtk2.0-0 -y

Febora 계열
$ sudo yum install xterm glibc.i686 libgcc.i686 libstdc++.i686 glibc-devel.i686 gtk2.i686 libSM.i686

 

얼마 전까지만 해도 Fortinet Customer Service & Support web portal에서 소스파일을 받을 수 있었지만, 소프트웨어를 구입하지 않았다면 더 이상 다운로드 받을 수 없게 됐다.

 

다행이 누군가의 미러를 발견!

$ sudo mkdir /opt/bin/ -p && cd /opt/bin/
$ wget http://www.niser.ac.in/docs/forticlientsslvpn_linux_4.4.2332.tar.gz && tar -xzf forticlientsslvpn_linux_4.4.2332.tar.gz

위 링크가 사용할 수 없다면 다음 파일을 받아도 무관하다. OS 에 따라 호환성 이슈가 있기 때문에 4.4를 받아 먼저 설치하고, 문제가 있으면 4.0으로 받아 압축을 풀자.

–  forticlientsslvpn_linux_4.4.2332.tar
–  forticlientsslvpn_linux_4-0-2281-tar

32/64bit 실행 파일이 구분되어 있기 때문에 자신의 운영체제에 맞는 디렉터리로 이동하자.

$ uname -a
Linux ip-10-10-102-199 5.11.0-1020-aws #21~20.04.2-Ubuntu SMP Fri Oct 1 13:03:59 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$tree -d -L 2 ./forticlientsslvpn
./forticlientsslvpn
├── 32bit
│   └── helper
└── 64bit
    └── helper

4 directories

$ cd /opt/bin/forticlientsslvpn/64bit/

 

실행 방법은 간단하다.  서버 주소와 포트를 기록하고 user 값을 입력하면 된다.

$ sudo ./forticlientsslvpn_cli --server [server]:[port] --vpnuser [user]

$ root@ip-10-10-102-240:/opt/bin/forticlientsslvpn/64bit# ./forticlientsslvpn_cli --server 1.50.7.200:10443 --vpnuser vpnuser01
Password for VPN:
STATUS::Setting up the tunnel
STATUS::Connecting...
Certificate:Certificate:
Data:
Version: 3 (0x2)
Serial Number: 2255677 (0x226b3d)
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=US, ST=California, L=Sunnyvale, O=Fortinet, OU=Certificate Authority, CN=support/emailAddress=support@fortinet.com
.
.
.
The certificate for the SSLVPN server is invalid.
You are connecting to an untrusted server. which could put your confidential information at risk.
Would you like to connect to this server? (Y/N)
Y
STATUS::Login succeed
STATUS::Starting PPPd
STATUS::Initializing tunnel
STATUS::Connecting to server
STATUS::Connected
STATUS::Tunnel running
Press Ctrl-C to quit

 

접속 후 라우팅 테이블이 변경 되었음을 확인할 수 있다.

# VPN 연결 전
$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.10.102.1     0.0.0.0         UG        0 0          0 ens5
10.10.102.0     0.0.0.0         255.255.255.0   U         0 0          0 ens5
10.10.102.1     0.0.0.0         255.255.255.255 UH        0 0          0 ens5

# VPN 연결 후
$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.10.102.1     0.0.0.0         UG        0 0          0 ens5
10.10.102.0     0.0.0.0         255.255.255.0   U         0 0          0 ens5
10.10.102.1     0.0.0.0         255.255.255.255 UH        0 0          0 ens5
1.50.7.128      192.168.140.8   255.255.255.128 UG        0 0          0 ppp0
1.50.7.200      10.10.102.1     255.255.255.255 UGH       0 0          0 ens5
1.50.7.64       192.168.140.8   255.255.255.224 UG        0 0          0 ppp0
192.168.20.0    192.168.140.8   255.255.255.0   UG        0 0          0 ppp0
192.168.50.0    192.168.140.8   255.255.255.0   UG        0 0          0 ppp0
210.15.20.8     192.168.140.8   255.255.255.224 UG        0 0          0 ppp0
210.209.150.0   192.168.140.8   255.255.255.192 UG        0 0          0 ppp0

 

 

Exit mobile version