Make a SonicWall SSL VPN connection with the Linux CLI

SonicWall's SSL VPN clients include MobileConnect and NetExtender. NetExtender is available on Linux and has a GUI and CLI.

The GUI version has garbled Japanese and is unexpectedly heavy, so I would like to use the CLI version.

Premise

--Confirmed on Ubuntu 18.04. --Confirmed with NetExtender version 8.6.799 for Linux. --Refer to the SonicWall manual for installation instructions.

manual

The manual is displayed with 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.

Interactive login

To log in interactively, run the netExtender command and enter the connection information.

$ 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...

During the connection, the process runs in the foreground, so it's a good idea to use Ctrl-Z, bg to background it.

^Z
[1]+Stop netExtender
$ bg
[1]+ netExtender &

Specify connection information with command line parameters

Connection information can also be specified with command line parameters.

$ netExtender \
  --username=takeume2 \
  --password=hogehoge \
  --domain=LocalDomain \
  vpn.example.com:4433

However, we do not recommend passwords (--password) as they are visible to other users. To enter only the password interactively, specify:

$ 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: 

Read connection information from a file

If entering the password is also a hassle, redirect the input and read the connection information from the file. Create an arbitrary file and enter the connection information.

As an example, save a file with the following contents in the ~ / vpn file.

$ cat <<EOF > ~/vpn
vpn.example.com:4433
takeume2
hogehoge
LocalDomain
EOF

Make the permissions visible only to the owner, as it would be bad for other users to see.

$ chmod 0600 ~/vpn
$ ls -l ~/vpn
-rw-------1 takeume2 takeume2 51 October 30 23:17 /home/takeume2/vpn

Redirects the input of netExtender and reads it from ~ / vpn. If you run it in the background with &, the Ctrl Z, bg operations are.

$ 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...

Cutting method

To disconnect, use fg to foreground and then type Ctrl-C.

$ fg
netExtender < .config/wts/vpntokyo
^C
Terminating pppd...
SSL VPN logging out...
SSL VPN connection is terminated.
Exiting NetExtender client

Alternatively, kill the process with the SIGTERM signal.

$ pgrep netExtener
1234
$ kill -SIGTERM 1234

pkill makes it easier to kill.

$ pkill -SIGTERM netExtender

Recommended Posts

Make a SonicWall SSL VPN connection with the Linux CLI
Specify the volume on linux and make a sound
Make a breakpoint on the c layer with python
Make a Linux version of OpenSiv3D with find_package a little easier
Make a fortune with Python
Make a BLE thermometer and get the temperature with Pythonista3
Make a fire with kdeplot
How to make a command to read the configuration file with pyramid
Error with pip: There was a problem confirming the ssl certificate
Let's make a GUI with python.
Make a sound with Jupyter notebook
Let's make a breakout with wxPython
[Python] Make the function a lambda function
Make a recommender system with python
Make a filter with a django template
Let's make a graph with python! !!
Let's make a supercomputer with xCAT
Make a model iterator with PySide
Make a nice graph with plotly
Set up a VPN server on AWS so that you can make a VPN connection from your Linux laptop
Make a DNN-CRF with Chainer and recognize the chord progression of music
Make the Python console covered with UNKO
Tweet the weather forecast with a bot
Run the IDCF cloud CLI with Docker
Let's make a shiritori game with Python
Make a rare gacha simulator with Flask
Make a Notebook Pipeline with Kedro + Papermill
A quick overview of the Linux kernel
Make Unity Accelerator a service on Linux
Make a partially zoomed figure with matplotlib
Make a drawing quiz with kivy + PyTorch
Let's make a voice slowly with Python
Make a cascade classifier with google colaboratory
Let's make a simple language with PLY 1
Make a logic circuit with a perceptron (multilayer perceptron)
[Linux] Build a jenkins environment with Docker
Make a Yes No Popup with Kivy
Make a wash-drying timer with a Raspberry Pi
Make a GIF animation with folder monitoring
Let's make a web framework with Python! (1)
Let's make a tic-tac-toe AI with Pylearn 2
Make a desktop app with Python with Electron
Let's make a Twitter Bot with Python!
Let's make a web framework with Python! (2)
SSH connection from Windows via SSL VPN
[Linux] Build a Docker environment with Amazon Linux 2
Make a thermometer with Raspberry Pi and make it visible on the browser Part 3
Get the stock price of a Japanese company with Python and make a graph