Mainos / Advertisement:

Softether

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun

Ohje on keskeneräinen

Asennus

Asenna paketit:

 apt-get install -y build-essential

Seuraavaksi:

 mkdir /softvpn
 cd /softvpn/
 wget http://www.softether-download.com/files/softether/v4.15-9546-beta-2015.04.05-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.15-9546-beta-2015.04.05-linux-x64-64bit.tar.gz

Pura paketti:

  tar -xzvf softether-vpnserver-v4.15-9546-beta-2015.04.05-linux-x64-64bit.tar.gz

Navigoi kohteeseen:

 cd vpnserver/
 
 make

Asennuksen jälkeen suojaa kansiosi:


 chmod 600 *
 chmod 700 vpnserver
 chmod 700 vpncmd

Luo vielä tämä kansio:

 mkdir /var/lock/subsys

Siirry kansioon:

cd /softvpn/
mv vpnserver /usr/local/
 

Valmistellaan aloitusskripti:

 cd /etc/init.d/

Luo editorilla tiedosto:

 nano vpnserver

Lisää alla oleva teksti "vpnserver" tiedostoon:

#!/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

Tämän jälkeen määritä käyttöoikeudet ja käynnistä vpnserver

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

Päivitä skripti listaan:

 update-rc.d vpnserver defaults

Käynnistetään vpncmd:

 cd /usr/local/vpnserver
 ./vpncmd

Softether kysyy seuraavia asioita:


vpncmd command - SoftEther VPN Command Line Management Utility
SoftEther VPN Command Line Management Utility (vpncmd command)
Version 4.15 Build 9546   (English)
Compiled 2015/04/05 03:13:47 by yagi at pc30
Copyright (c) SoftEther VPN Project. All Rights Reserved.

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 Network Traffic Speed Test Tool)

Select 1, 2 or 3:

Valitse 1.

Specify the host name or IP address of the computer that the destination VPN Server or VPN Bridge is operating on.
By specifying according to the format 'host name:port number', you can also specify the port number.
(When the port number is unspecified, 443 is used.)
If nothing is input and the Enter key is pressed, the connection will be made to the port number 8888 of localhost (this computer).
Hostname of IP Address of Destination:

Jätä tyhjäksi(paina enteriä).

If connecting to the server by Virtual Hub Admin Mode, please input the Virtual Hub name.
If connecting by server admin mode, please press Enter without inputting anything.
Specify Virtual Hub Name:
Connection has been established with VPN Server "localhost" (port 443).

Jätä tämä myös tyhjäksi.


Sitten päästään käsiksi asetuksiin ja ensimmäiseksi annetaan salasana VPN-palvelulle:

 ServerPasswordSet 

Luodaan Hub, jonka nimi on "VPN":

 HubCreate VPN

Sitten siirrymme konfiguroimaan kyseistä hubia:

 Hub VPN

Käytämme SecureNAT funktiota eli emme siltaa VPN käyttäjiä samaan verkkoon palvelimen kanssa.

 SecureNatEnable

Luomme käyttäjän. Huomaa, että käyttäjä tulee toimimaan vain tässä hubissa eli "VPN" hubissa.

 UserCreate minh

Annamme käyttäjälle minh salasanan:

UserPasswordSet minh

Laitamme L2TP/IPSec protokollan käyttöön:

 IPsecEnable

Tämän jälkeen sinulta kysytään seuraavia asioita:


VPN Server/VPN>IPsecEnable
IPsecEnable command - Enable or Disable IPsec VPN Server Function
Enable L2TP over IPsec Server Function (yes / no): yes

Enable Raw L2TP Server Function (yes / no): yes

Enable EtherIP / L2TPv3 over IPsec Server Function (yes / no): no

Pre Shared Key for IPsec (Recommended: 9 letters at maximum): taisto
Default Virtual HUB in a case of omitting the HUB on the Username: VPN

The command completed successfully.

Voit laittaa haluamasi, maksimissaan yhdeksän merkkiä pitkän, esijaetun VPN-avaimen. Me käytimme avainta: "taisto"

Sitten poistumme komennolla:

 exit

Luomme uuden kansion:

 mkdir sertifikaatit

Siirrymme kansioon:

 cd sertifikaatit

Tänne teemme itsekirjoitetun SSL-sertifikaatin Openssl paketilla, joka yleensä tulee mukana Linux pohjaisissa jakeluissa. Voit katsoa taiston ohjeen tästä: Openssl Teemme silti pikaisen ohjeen tähän:

 openssl genrsa -des3 -out rootsoftether.key 4096
 
 openssl req -x509 -new -nodes -key rootsoftether.key -days 3650 -out rootsoftether.crt
 

Tämän jälkeen siirrytään takaisin softether komentoriville:

 cd .. 
 ./vpncmd


Lisätään sertifikaatti SSTP:tä varten:

 ServerCertSet 
 
ServerCertSet command - Set SSL Certificate and Private Key of VPN Server
Read X.509 certificate from file name: ./sertifikaatit/rootsoftether.crt

Read private key from file name: ./sertifikaatit/rootsoftether.key

The specified private key file is protected by a passphrase.
Please enter the passphrase: ********
The command completed successfully.

Lisätään SSTP protokolla:

VPN Server>SstpEnable
SstpEnable command - Enable / Disable Microsoft SSTP VPN Clone Server Function
Enables SSTP VPN Clone Server Function (yes / no): yes

The command completed successfully.

Olet nyt valmis käyttämään VPN-palvelinta SSTP- tai L2TP/Ipsec protokollalla. Muista myös avata portit 443(SSTP(tcp)), 500(L2TP(udp)) ja 4500(L2TP(udp))



Lähteet

https://www.digitalocean.com/community/tutorials/how-to-setup-a-multi-protocol-vpn-server-using-softether

Mainos / Advertisement: