Linux

Softether VPN

techapi 2025. 3. 11. 22:45
반응형

SoftEther VPN은 강력하고 다양한 기능을 제공하는 오픈 소스 VPN (가상 사설망) 소프트웨어

 

이 프로그램의 주요 특징:

  1. 다목적 VPN 솔루션: SoftEther VPN은 VPN 클라이언트와 서버 소프트웨어로 모두 기능합니다.
  2. 크로스 플랫폼 지원: Windows, Linux, macOS, Android, iOS 등 다양한 운영 체제에서 사용할 수 있습니다.
  3. 다양한 프로토콜 지원: OpenVPN, L2TP/IPsec, SSTP, EtherIP 등 여러 VPN 프로토콜을 지원하여 유연성을 제공합니다.
  4. 강력한 보안: SSL-VPN을 통해 높은 수준의 암호화와 보안 기능을 제공합니다.
  5. NAT 통과 기능: NAT traversal을 지원하여 가정용 게이트웨이나 기업용 방화벽 뒤에서도 VPN 서버를 쉽게 구동할 수 있습니다.
  6. 고성능: 풀 이더넷 프레임 활용, 병렬 전송, 클러스터링 등을 통해 성능을 최적화하고 레이턴시를 줄입니다.
  7. 무료 및 오픈 소스: GNU 일반 공중 사용권 라이선스로 제공되어 무료로 사용 가능하며, 소스 코드가 공개되어 있습니다.
  8. 유연한 네트워크 구성: '가상 허브' 기능을 통해 여러 VPN 네트워크를 한 서버에서 관리할 수 있습니다.
  9. 관리 용이성: 간편한 설치와 관리 기능을 제공하여 사용자 친화적입니다.

 

1. 설치 참고 사이트

http://damoa-nawa.tistory.com/88

http://qiita.com/showwin/items/92861057a8b62611444d

https://www.softether.org/4-docs/1-manual/7._Installing_SoftEther_VPN_Server/7.3_Install_on_Linux_and_Initial_Configurations

 

2. 다운로드 설치

wget http://www.softether-download.com/files/softether/v4.22-9634-beta-2016.11.27-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.22-9634-beta-2016.11.27-linux-x64-64bit.tar.gz

 

tar xzvf vpnserver-5070-rtm-linux-x86.tar.g

 

[root@machine vpnserver]# make

./.install.sh

Do you want to read the License Agreement for this software ?

1. Yes

2. No

Please choose one of above number:

1

 

EULA

 

Did you read and understand the License Agreement ?

(If you couldn't read above text, Please read License_ReadMe.txt

file with any text editor.)

1. Yes

2. No

Please choose one of above number:

1

 

Did you agree the License Agreement ?

1. Agree

2. Do Not Agree

Please choose one of above number:

1

 

3. 설치 - 2

[root@machine vpnserver]# cd ..

[root@machine root]# mv vpnserver /usr/local/src

 

[root@machine root]# cd /usr/local/vpnserver/src

[root@machine vpnserver]# chmod 600 *

[root@machine vpnserver]# chmod 700 vpncmd

[root@machine vpnserver]# chmod 700 vpnserver

 

 

 

4. 최초 셋팅 체크

[root@machine vpnserver]# ./vpncmd

vpncmd command - SoftEther VPN Command Line Management Utility

SoftEther VPN Command Line Management Utility (vpncmd command)

 

By using vpncmd program, the following can be achieved.

 

1. Management of VPN Server or VPN Bridge

2. Management of VPN Client

3. Use of VPN Tools (certificate creation and communication speed measurement)

 

Select 1, 2 or 3: 3

 

VPN Tools was launched. By inputting HELP, you can view a list of the commands t

hat can be used.

 

VPN Tools>check

Check command - Check if SoftEther VPN Operation is Possible

---------------------------------------------------

SoftEther VPN Operation Environment Check Tool

 

If this operation environment check tool is run on a system and that system pass

es, it is highly likely that SoftEther VPN software can operate on that system. T

his check may take a while. Please wait...

 

Checking 'Kernel System'...

[Pass]

Checking 'Memory Operation System'...

[Pass]

Checking 'ANSI / Unicode string processing system'...

[Pass]

Checking 'File system'...

[Pass]

Checking 'Thread processing system'...

[Pass]

Checking 'Network system'...

[Pass]

 

All checks passed. It is highly likely that SoftEther VPN Server / Bridge can ope

rate normally on this system.

 

The command terminated normally.

VPN Tools>exit

[root@machine vpnserver]#

 

5. Run script 등록

vi /etc/init.d/vpnserver

 

#!/bin/sh

# chkconfig: 2345 99 01

# description: SoftEther VPN Server

DAEMON=/usr/local/src/vpnserver/vpnserver

LOCK=/var/lock/subsys/vpnserver

test -x $DAEMON || exit 0

case "$1" in

start)

$DAEMON start

touch $LOCK

;;

stop)

$DAEMON stop

rm $LOCK

;;

restart)

$DAEMON stop

sleep 3

$DAEMON start

;;

*)

echo "Usage: $0 {start|stop|restart}"

exit 1

esac

exit 0

 

chmod 755 /etc/init.d/vpnserver

/sbin/chkconfig --add vpnserver

 

6. 서비스 시작 / 중지

/etc/init.d/vpnserver start

/etc/init.d/vpnserver stop

 

7. VPN hub  / user 생성

VPN Server> HubList

 

VPN Server> HubCreate

HubCreate 명령 - 새로운 가상 HUB 작성

만드는 가상 HUB 이름 : ECP

 

암호를 입력하십시오. 취소하려면 Ctrl + D 누르십시오.

 

암호 : ********

확인 입력 : ********

 

## 사용자  생성 ##

 

VPN Server> HUB ECP

 

 

 

VPN Server / ECP > GroupCreate

VPN Server / ECP > UserList

VPN Server / ECP > UserCreate

VPN Server / ECP > UserPasswordSet

 

 

 

8. VPN IPSec / L2TP 설정

 

VPN Server / example> IPsecEnable

IPsecEnable 명령 - IPsec VPN 서버 기능의 활성화 / 비활성화

L2TP over IPsec 서버 기능을 활성화 (yes / no) : yes

 

Raw L2TP 서버 기능을 활성화 (yes / no) : no

 

EtherIP / L2TPv3 over IPsec 서버 기능을 활성화 (yes / no) : no

 

IPsec 사전 공유 문자열 (9 이하 권장) : ********

 

VPN 연결시 가상 HUB 이름이 생략 경우 기본 가상 HUB 이름 : ECP

 

명령이 성공적으로 완료되었습니다.

 

## NAT활성화  ##

VPN Server / ECP > SecureNatEnable

 

## IPsec 활성화  ##

VPN Server / ECP > IPsecEnable

 

 

9. VPN 클라이언트 다운로드

http://www.softether-download.com/files/softether/v4.22-9634-beta-2016.11.27-tree/Windows/SoftEther_VPN_Client/softether-vpnclient-v4.22-9634-beta-2016.11.27-windows-x86_x64-intel.exe

 

10. Softether 설명 사이트

https://enesto7.wordpress.com/2016/07/05/softether-linux-vpn-server/

 

서버 시작시 vpn 서버 자동 실행 설정하기

cd ..
mv vpnserver /usr/local
cd /usr/local/vpnserver/
chmod 600 *
chmod 700 vpnserver
chmod 700 vpncmd
vi /etc/init.d/vpnserver

파일 생성 아래 내용을 넣고 저장하고 종료한다.

#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

 

아래 폴더가 없으면 생성해준다.

mkdir /var/lock/subsys

 

서비스 시작 권한 설정

chmod 755 /etc/init.d/vpnserver && /etc/init.d/vpnserver start

 

vpn 서버 자동시작

update-rc.d vpnserver defaults

 

vpn 서버 정상 작동 확인

cd /usr/local/vpnserver
 
./vpncmd

 

이후 3 선택한

check

 

check 명령어를 입력하면 위와 같이 화면이 출력된다. 모두 Pass 나왔다면 VPN 서버가 정상 작동하고 있다는 의미이다. exit 입력하면 vpn 툴에서 빠져 나올 있다.

exit

 

Admin 비밀번호 변경하기

./vpncmd

 

이후 1번을 선택한다. 아무것도 입력하지 말고 그냥 엔터를 친다.

ServerPasswordSet

 

이후 사용할 Admin 패스워드를 입력한다.

Virtual Hub 생성

VPN이라는 Hub 생성한다. 다른 이름으로 생성해도 상관없다.

HubCreate VPN

 

VPN 허브에 사용할 패스워드를 입력해준다.

아래 명령어를 통해 Hub 선택해준다.

Hub VPN

 

SecureNAT 설정하기

hub 접속하는 방법에는 가지가 있다. 로컬 브릿지를 사용하거나 SecureNAT 이용하는 사용하는 방법인데, 로컬 브릿지를 사용하게 경우 DHCP 서버 설정을 해주어야 하는 부분이 있어 여기서는 간편하게 SecureNAT 사용한다.

SecureNatEnable

 

사용자 생성 관리

VPN 서버에 접속할 사용자 아디를 생성하고 관리할 있다. 여러 가지 다양한 클라이언트 인증 방법이 있는데 여기서는 가장 편하게 사용하고 관리할 있는 비밀번호 인증방법을 사용한다.

test 라는 사용자를 생성한다. 다른 이름으로 생성해도 상관없다.

UserCreate test

이후 그룹, 이름, 설명 등을 입력하라고 나오는데 그냥 엔터를 치면된다.

사용자가 접속 입력하게 비밀번호를 생성한다.

UserPasswordSet test

이후 비밀번호를 입력한다.

이로써 SoftEther VPN 서버 설정이 완료되었다. 윈도우에 SoftEther VPN 클라이언트를 설치하여 사용하는 경우 아래 과정들은 생략하고 클라이언트를 설치하여 사용하면 된다.

L2TP/IPSec 연결 설정

이는 아이폰이나 안드로이드 기기 등을 통해 SoftEther VPN 연결하고자 하는 경우 필요한 설정이다.

L2TP/IPSec 이용한 VPN 사용하고 싶을 경우 다음과 같은 명령어를 입력한다.

IPsecEnable

 

Enable L2TP over IPsec Server Function : L2TP IPsec 암호화를 사용할 것이냐는 질문이다. yes 입력하면 아이폰, 안드로이드, 윈도우 그리고 맥을 통해 VPN 서버에 접속할 있다.

Enable Raw L2TP Server Function : yes 입력하면 클라이언트가 L2TP 연결에 IPSec 암호화 없이도 연결할 있다.

Enable EtherIP / L2TPv3 over IPsec Server Function : yes 선택하면 IPSec 암호화를 사용한 EtherIP/L2TPv3 방식으로 다른 라우터에서 연결 가능하다.

Pre Shared Key for IPsec : L2TP 연결에 사용할 암호키를 입력하면 된다.

Default Virtual HUB in a case of omitting the HUB on the Username : 어떤 Hub 연결할지 설정하는 것이다. 앞서 VPN이란 Hub 생성했으므로 VPN 입력하면 된다. 그리고 L2TP 연결할 때는 계정 부분에 test@VPN(사용자명@허브명) 으로 입력해야한다.

이로써 L2TP 서버 설정이 완료되었다. 이제 안드로이드 기기나 아이폰을 통해 SoftEther VPN 연결할 있다.

SSTP/ OpenVPN 연결 설정

SoftEther VPN에서는 SSTP OpenVPN 연결도 지원한다. 기능을 사용하기에 앞서 우선 SSL 인증서를 생성해야 한다.

아래와 같이 입력한다. 명령어 뒤에는 자신의 서버 주소를 IP 주소나 도메인 네임으로 입력한다.

ServerCertRegenerate 자신의 서버 주소

생성한 인증서를 다운받기 위해 아래와 같이 입력한다.

ServerCertGet ~/cert.cer

이제 SFTP 프로그램을 이용해서 서버에 접속하면 /root 폴더에 cert.cer 이라는 인증서가 생성된 것을 확인 있다. 그것을 클라이언트에 다운로드 받아 사용하면된다.

인증서 체인 설치

sstp 활성화 해준다.

SstpEnable yes

 

openvpn 활성화 한다. 포트는 다른 포트를 설정해도 관계없다.

OpenVpnEnable yes /PORTS:1194

 

OpenVPN 설정 파일을 생성한다.

OpenVpnMakeConfig ~/my_openvpn_config.zip

 

마찬가지로 SFTP 프로그램을 이용하여 /root 폴더에서 다운로드 받아서 사용하면된다.

반응형

'Linux' 카테고리의 다른 글

Log 일일백업 script  (0) 2025.03.11
일일백업 script  (0) 2025.03.11
Xymon client 설치  (0) 2025.03.11
Log rotate 설정  (0) 2025.03.11
systemctl 관련 정리  (0) 2025.03.10