SonicWall のSSL VPN クライアントは MobileConnect と NetExtender があります。
Linux では NetExtender が使用可能で GUI と CLI があります。
GUI 版は 日本語が化けたり、意外と重かったりしたので CLI 版を使いたいと思います。
前提
- Ubuntu 18.04 で確認しています。
- Linux版 NetExtender version 8.6.799 で確認しています。
- インストール方法は SonicWall のマニュアルを参照してください。
マニュアル
man netExtender
でマニュアルが表示されます。
netExtender LOCAL netExtender
NAME
netExtender — SonicWALL NetExtender command-line client for Mac OS X/Linux
SYNOPSIS
netExtender [-u username] [-p password] [-d domain] [options] [server[:port]]
DESCRIPTION
NetExtender is a client for use with SonicWALL's SRA and UTM appliances. It enables remote
users to securely connect to a remote network.
With NetExtender, remote users can securely run any application on the remote network.
Users can upload and download files, mount network drives, and access resources in the same
way as if they were on the local network. The NetExtender connection uses a Point-to-Point
Protocol (PPP) connection inside a secure SSL tunnel.
対話的ログイン
対話的にログインするには netExtender
コマンドを実行して接続情報を入力します。
$ netExtender
NetExtender for Linux - Version 8.6.799
SonicWall
Copyright (c) 2017 SonicWall
SSL VPN Server: vpn.example.com:4433
User Access Authentication
User: takeume2
Password:
Domain: LocalDomain
Connecting to vpn.example.com:4433...
Connected.
Logging in...
Login successful.
Version header not found
SSL Connection is ready
Using SSL Encryption Cipher 'ECDHE-RSA-AES256-SHA384'
Using new PPP frame encoding mechanism
Using PPP async mode (chosen by server)
Connecting tunnel...
Client IP Address: 10.254.128.12
You now have access to the following 1 remote networks:
10.0.0.0/255.0.0.0
NetExtender connected successfully. Type "Ctrl-c" to disconnect...
接続中、プロセスはフォアグラウンド実行されるので Ctrl-Z
, bg
でバックグランド化すると良いでしょう。
^Z
[1]+ 停止 netExtender
$ bg
[1]+ netExtender &
接続情報を コマンドライン パラメータ で指定する
接続情報は コマンドライン パラメータで指定することも出来ます。
$ netExtender \
--username=takeume2 \
--password=hogehoge \
--domain=LocalDomain \
vpn.example.com:4433
ただし、パスワード (--password
) は 他のユーザから 丸見えになるので、おすすめしません。
パスワードだけ対話的に入力するには次のように指定します。
$ netExtender --username=takeume2 --domain=LocalDomain vpn.example.com:4433
NetExtender for Linux - Version 8.6.799
SonicWall
Copyright (c) 2017 SonicWall
User Access Authentication
Password:
接続情報をファイルから読み込む
パスワード入力も面倒な場合は、入力をリダイレクトしてファイルから接続情報を読み込みます。
任意のファイルを作成して接続情報を入力します。
例として 次の内容のファイルを ~/vpn
ファイルに保存します。
$ cat <<EOF > ~/vpn
vpn.example.com:4433
takeume2
hogehoge
LocalDomain
EOF
他のユーザに見られるとまずいのでパーミッションを オーナーのみ参照可能にします。
$ chmod 0600 ~/vpn
$ ls -l ~/vpn
-rw------- 1 takeume2 takeume2 51 10月 30 23:17 /home/takeume2/vpn
netExtender
の入力を リダイレクトして ~/vpn
から読み込みます。
&
を付けてバックグランド実行すると Ctrl-Z
, bg
操作はです。
$ netExtender <~/vpn &
NetExtender for Linux - Version 8.6.799
SonicWall
Copyright (c) 2017 SonicWall
SSL VPN Server: User Access Authentication
User: Password: stdin is not tty terminal
stdin is not tty terminal
Domain: Connecting to vpn.example.com:4433...
Connected.
Logging in...
切断方法
切断するには fg
でフォアグランドにしてから Ctrl-C
を入力します。
$ fg
netExtender < .config/wts/vpntokyo
^C
Terminating pppd...
SSL VPN logging out...
SSL VPN connection is terminated.
Exiting NetExtender client
または、SIGTERM
シグナルでプロセスを kill
します。
$ pgrep netExtener
1234
$ kill -SIGTERM 1234
pkill
だとより簡単に kill できます。
$ pkill -SIGTERM netExtender