Connect to Packetix VPN from CentOS 7 minimal.

Connect to Packetix VPN from CentOS 7 minimal.

This section describes the procedure for operating using Packetix VPN Client on CentOS7.

Basically all you have to do is run the code part of this article in the CLI.

Premise

Work content

Install the required packages

Use yum to install the required packages.

sudo yum groupinstall "development tools"
sudo yum install bzip2-devel gdbm-devel libffi-devel \
  libuuid-devel ncurses-devel openssl-devel readline-devel \
  sqlite-devel tk-devel wget xz-devel zlib-devel

Packetix VPN Client

Download Packetix VPN from the official website. Use wget.

Download and unzip

yum install wget
wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.32-9731-beta/softether-vpnclient-v4.32-9731-beta-2020.01.01-linux-x64-64bit.tar.gz
tar xfz softether-vpnclient-*-linux-x64-64bit.tar.gz

Installation

cd vpnclient
make
#Enter 1 of Yes 3 times
#Move to the original directory
cd ../
#Delete the downloaded one
rm softether-vpnclient-*-linux-x64-64bit.tar.gz

Move software and change permissions

#Directory move
sudo mv vpnclient /usr/local/.
#Change permissions
chmod 600 /usr/local/vpnclient/*
chmod 700 /usr/local/vpnclient/vpncmd
chmod 700 /usr/local/vpnclient/vpnclient
#Run vpncmd to check health
/usr/local/vpnclient/vpncmd
#Press 3.
#Health check
VPN Tools>check
#End of setting screen
VPN Tools>exit

Firewall settings

sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
sudo firewall-cmd --zone=public --add-port=992/tcp --permanent
sudo firewall-cmd --zone=public --add-port=5555/tcp --permanent
sudo firewall-cmd --reload

Launch VPN Client

Start vpnclient to use vpncmd.

sudo /usr/local/vpnclient/vpnclient start

https://www.itcore.jp/tips/softether_client.php Service conversion, etc. http://harukarium.sblo.jp/article/184766762.html

Set in VPN Client

Make a NIC card with vpncmd. Also, set the connection destination of vpn. Please correct XXX as appropriate.

#Create Nic
sudo /usr/local/vpnclient/vpncmd /client localhost /cmd NicCreate vpns
#SERVER settings
sudo /usr/local/vpnclient/vpncmd /client localhost /cmd AccountCreate vpn_th /SERVER:XXX.XXX.XXX.XXX:XXXX /HUB:VPN-Hub /USERNAME:user_name /NICNAME:vpns
#Enter the password to connect to the SERVER
sudo /usr/local/vpnclient/vpncmd /client localhost /cmd AccountPasswordSet vpn_th /TYPE:standard

Interface settings

https://qiita.com/Daisuke-Otaka/items/b9d99c9dcbb84cf813d7

http://mzgkworks.com/post/linux-centos7-network-setting/

Do the following to create a file for your network adapter:

#Stop vpnclient once
#The file naming convention is/etc/sysconfig/network-scripts/ifcfg-vpn_Name you set
# NM_CONTROLLED=Error if not set to "no"
# http://frym.jp/?p=1377
sudo cat << '_EOT_' | sudo tee /etc/sysconfig/network-scripts/ifcfg-vpn_vpns
BOOTPROTO=none
PEERDNS=no
DEVICE=vpn_vpns
ONBOOT=yes
USERCTL=no
NM_CONTROLLED=no
IPADDR=192.168.XXX.XXX
NETMASK=255.255.255.0
_EOT_

Network restart and confirmation

#Network restart
sudo systemctl restart network
#View status
sudo systemctl status network
#Device down
# sudo ifdown vpn_vpns
#Device up
# sudo ifup vpn_vpns
#Check network log
sudo journalctl -xe

Service conversion

Service start and stop of vpnclient.

sudo cat << '_EOT_' | sudo tee /etc/systemd/system/vpnclient.service
[Unit]
Description=SoftEther VPN Server
Before=network.target

[Service]
Type=forking
ExecStart=/usr/local/vpnclient/vpnclient start
ExecStop=/usr/local/vpnclient/vpnclient stop
_EOT_
sudo systemctl start vpnclient
sudo systemctl enable vpnclient
sudo systemctl status vpnclient

Start and end

start

#Network restart
sudo systemctl restart network
#Launch client(Manual)
# sudo /usr/local/vpnclient/vpnclient start
#vpn connection
sudo /usr/local/vpnclient/vpncmd /client localhost /cmd AccountConnect vpn_th

Verification

#View devices that are working or booting
sudo nmcli device show vpn_vpns
#Check with the connected Ping
ping 192.168.XXX.XXX

End

#Disconnect
sudo /usr/local/vpnclient/vpncmd /client localhost /cmd AccountDisconnect vpn_th
#Stop(Manual)
# sudo /usr/local/vpnclient/vpnclient stop

Recommended Posts

Connect to Packetix VPN from CentOS 7 minimal.
Switch from python2.7 to python3.6 (centos7)
Connect to sqlite from python
Connect to centos6 on virtualbox with ssh connection from Mac
Connect to KUINS-III (Kyoto University VPN) from Linux using PPTP
Connect to KUINS-III (Kyoto University VPN) from Linux using IKEv2
Connect to utf8mb4 database from python
Ssh connect to GCP from Windows
Connect to Docker's MySQL container from Flask
Connecting from python to MySQL on CentOS 6.4
Connect to coincheck's Websocket API from Python
I want to connect to PostgreSQL from various languages
Easy script migration from CentOS to Oracle Linux
Sum from 1 to 10
Connect to Supercomputer ITO Jupyter from client browser
Connect to mysql
Connect to a serial console via Bluetooth (CentOS 7)
Use Tor to connect from urllib2 [Python] [Mac]
Changes from Python 3.0 to Python 3.5
Changes from Python 2 to Python 3.0
Transition from WSL1 to WSL2
Introducing Python 2.7 to CentOS 6.6
Connect python to mysql
From editing to execution
[CentOS 7.7] From desktop environment installation to remote desktop connection possible (from minimum installation)
Compile Tesseract for Tess4J to transcribe from images using CentOS
How to connect to various DBs from Python (PEP 249) and SQLAlchemy