인디노트

CentOS SoftEther VPN Client Install 본문

개발 플랫폼 및 언어

CentOS SoftEther VPN Client Install

인디개발자 2021. 8. 23. 09:29

softether-vpnclient

install

$ cd /usr/local/src
$ wget https://www.softether-download.com/files/softether/v4.38-9760-rtm-2021.08.17-tree/Linux/SoftEther_VPN_Client/64bit_-_Intel_x64_or_AMD64/softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz
$ tar xvfz softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz

$ cd vpnclient
$ make

start

$ ./vpnclient start
The SoftEther VPN Client service has been started.

$ ps -ef | grep -v grep | grep vpn
root     17129     1  0 07:59 ?        00:00:00 /usr/local/src/vpnclient/vpnclient execsvc
root     17130 17129  0 07:59 ?        00:00:00 /usr/local/src/vpnclient/vpnclient execsvc

 

setting

$ ./vpncmd /client localhost
vpncmd command - SoftEther VPN Command Line Management Utility
SoftEther VPN Command Line Management Utility (vpncmd command)
Version 4.34 Build 9745   (English)
Compiled 2020/04/05 23:39:56 by buildsan at crosswin
Copyright (c) SoftEther VPN Project. All Rights Reserved.

Connected to VPN Client "localhost".


## Nic 리스트 확인 (아직 Nic 가 없는 경우)

VPN Client>NicList
NicList command - Get List of Virtual Network Adapters
Item|Value
----+-----
The command completed successfully.


## tun0 가 없으면 생성한다.

VPN Client>NicCreate tun0
NicCreate command - Create New Virtual Network Adapter
The command completed successfully.


## Nic 리스트 확인 (생성된 Nic 확인)

VPN Client>NicList
NicList command - Get List of Virtual Network Adapters
Item                        |Value
----------------------------+-----------------------------------
Virtual Network Adapter Name|tun0
Status                      |Enabled
MAC Address                 |5EF6C698C5B6
Version                     |Version 4.38 Build 9760   (English)
The command completed successfully.


## Account 리스트 확인 (아직 Account 가 없는 경우)

VPN Client>AccountList
AccountList command - Get List of VPN Connection Settings
Item|Value
----+-----
The command completed successfully.


## Account 생성

VPN Client>AccountCreate
AccountCreate command - Create New VPN Connection Setting
Name of VPN Connection Setting: my_vpn

Destination VPN Server Host Name and Port Number: vpn.server.com:443

Destination Virtual Hub Name: vpn

Connecting User Name: vpnuser

Used Virtual Network Adapter Name: tun0

The command completed successfully.


## Account 확인 (생성된 Account 가 표시됨)

VPN Client>AccountList
AccountList command - Get List of VPN Connection Settings
Item                        |Value
----------------------------+---------------------------------------------
VPN Connection Setting Name |my_vpn
Status                      |Offline
VPN Server Hostname         |vpn.server.com:443 (Direct TCP/IP Connection)
Virtual Hub                 |vpn
Virtual Network Adapter Name|tun0
The command completed successfully.



## Account Password

VPN Client>AccountPassword vpnuser
AccountPasswordSet command - Set User Authentication Type of VPN Connection Setting to Password Authentication
Please enter the password. To cancel press the Ctrl+D key.

Password: **********
Confirm input: **********


Specify standard or radius: standard

Error occurred. (Error code: 36)
The specified VPN Connection Setting does not exist.



## Account Connect

VPN Client>AccountConnect my_vpn
AccountConnect command - Start Connection to VPN Server using VPN Connection Setting
The command completed successfully.




## Account List

VPN Client>AccountList
AccountList command - Get List of VPN Connection Settings
Item                        |Value
----------------------------+---------------------------------------------
VPN Connection Setting Name |my_vpn
Status                      |Connecting
VPN Server Hostname         |vpn.server.com:443 (Direct TCP/IP Connection)
Virtual Hub                 |vpn
Virtual Network Adapter Name|tun0
The command completed successfully.


Status 가 Connecting 이라고 나오면 서버에 해당 User 가 없든지 Password 가 다르던지 한 것이다.
정상적으로 연결되면 다음과 같이 Connected 가 된다.

VPN Client>AccountList
AccountList command - Get List of VPN Connection Settings
Item                        |Value
----------------------------+---------------------------------------------
VPN Connection Setting Name |my_vpn
Status                      |Connected
VPN Server Hostname         |vpn.server.dev:443 (Direct TCP/IP Connection)
Virtual Hub                 |vpn
Virtual Network Adapter Name|tun0
The command completed successfully.



## 설정 종료

VPN Client>quit

 

DHCP 요청

dhclient vpn_tun0

 

vpn_tun0 확인

연결이 안된 경우

[root@centos7 vpnclient]# ifconfig vpn_tun0
vpn_tun0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5cf6:c6ff:fe98:c5b6  prefixlen 64  scopeid 0x20<link>
        ether 5e:f6:c6:98:c5:b6  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        
        
연결이 된 경우 inet 과 같이 IP 가 할당된다.

vpn_tun0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.30.13  netmask 255.255.255.0  broadcast 192.168.30.255
        inet6 fe80::5cf6:c6ff:fe98:c5b6  prefixlen 64  scopeid 0x20<link>
        ether 5e:f6:c6:98:c5:b6  txqueuelen 1000  (Ethernet)
        RX packets 149  bytes 16976 (16.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 125  bytes 12902 (12.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

 

시스템 시작시 자동으로 VPN 접속하기 위해서 /etc/rc.local 파일에 다음과 같은 형식을 추가해 준다.

적용 파일 : /etc/rc.local
다음의 내용은 vpnclient 가 /usr/local/src/vpnclient 에 설치 되어 있는 경우이며
192.168.30.200 으로 IP 를 설정하는 경우이다.


/usr/local/src/vpnclient/vpnclient start
/usr/local/src/vpnclient/vpncmd /CLIENT localhost /CMD accountconnect my_vpn
dhclient vpn_tun0
route del default vpn_tun0
ifconfig vpn_tun0 192.168.30.200

 

추가적으로 rc.local 에 대한 내용은 다음 링크를 참고 바란다.

https://indienote.tistory.com/635?category=645749 

 

rc.local 실행하기

# vi /usr/lib/systemd/system/rc-local.service [Unit] Description=/etc/rc.d/rc.local Compatibility ConditionFileIsExecutable=/etc/rc.d/rc.local After=network.target [Service] Type=forking ExecStart=/..

indienote.tistory.com

 

반응형

'개발 플랫폼 및 언어' 카테고리의 다른 글

resolv.conf 파일이 자꾸 초기화 될때  (0) 2021.08.23
rc.local 실행하기  (0) 2021.08.23
my eclipse colors and keymaps  (0) 2021.08.06
Microsoft Q# 관련 프로젝트 생성  (0) 2021.07.27
C# 을 배워보자.  (0) 2021.07.15
Comments