返回列表 發帖

Raspberry Pi 2 as VPN server - In progess

本帖最後由 ckleea 於 2017-4-16 19:45 編輯

All in one PPTP, OPENVPN, IPSec, SSTP-Server, Shadowsocks in a Raspberry Pi2

Software to be updated via scripts

第一版

user:root
password:raspbian

Softethervpn: vpnmgr port:8443


第二版

本帖最後由 ckleea 於 2017-5-6 07:28 編輯

Scripts to create SoftetherVPN, OCServ and Shadowsocks-libev
  1. apt-get -y update
  2. apt-get -y install git subversion aptitude build-essential dh-autoreconf libncurses5-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev libev-dev libwrap0-dev libpam0g-dev liblz4-dev libreadline-dev libnl-route-3-dev libprotobuf-c-dev libtalloc-dev libhttp-parser-dev libpcl1-dev libopts25-dev autogen protobuf-c-compiler gperf liblockfile-bin nuttcp lcov libuid-wrapper libpam-oath libghc-bloomfilter-dev corkscrew libipset-dev
  3. apt-get -y install autoconf libtool libssl-dev gawk debhelper dh-systemd init-system-helpers pkg-config asciidoc xmlto apg libpcre3-dev zlib1g-dev libudns-dev

  4. ## Prepare, configure and install SoftetherVPN from sources
  5. cd /opt
  6. git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
  7. cd /opt/SoftEtherVPN
  8. ./configure
  9. make
  10. make install

  11. ## Prepare, configure and install OCServ from sources
  12. cd /opt
  13. git clone https://gitlab.com/ocserv/ocserv.git
  14. cd /opt/ocserv
  15. autoreconf -fvi
  16. ./configure --disable-seccomp && make

  17. ## Prepare, configure and install shadowsocks-libev from sources
  18. cd /opt
  19. git clone https://github.com/shadowsocks/shadowsocks-libev.git
  20. cd /opt/shadowsocks-libev
  21. git submodule update --init --recursive

  22. # Installation of Libsodium
  23. git clone https://github.com/jedisct1/libsodium.git
  24. cd libsodium
  25. ./configure
  26. make
  27. make install


  28. # Installation of MbedTLS
  29. cd /opt/shadowsocks-libev
  30. export MBEDTLS_VER=2.4.2
  31. wget https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz
  32. tar xvf mbedtls-$MBEDTLS_VER-gpl.tgz
  33. pushd mbedtls-$MBEDTLS_VER
  34. make SHARED=1 CFLAGS=-fPIC
  35. make DESTDIR=/usr install
  36. popd
  37. ldconfig

  38. cd /opt/shadowsocks-libev
  39. ./autogen.sh && ./configure && make
  40. make install
複製代碼

TOP

回復 3# homeinns


其實差不多完成,欠shadowsocks multi ports multi users 和 samples config
ocserv + softethervpn => ok

TOP

回復 3# homeinns


你可以下載試試。

用16GB SD card

Raspberry Pi 2 based on the latest raspbian image

TOP

設定:
Network: 用DHCP取內網地址
OCServ: 設定和密碼檔案在/etc/ocserv
預設vpn full tunnel和ip 10.10.0.1/24
Softether:預設IPSec, OpenVPN and SSTP 全開,SSTP 用8443 port
Shadowsocks: 設定檔案在/etc/shadowsocks 內,它是10個用戶用10個ports
SSTP server: 密碼在/etc/ppp/chap.secrets,預設20443 port


上面的4個服務都經systemd 起動,如果要改起動設定,檔案在/etc/systemd/system 內

pptpd 已經加入但未做任何設定

TOP

返回列表