ShadowVPN

网络 by 神秘人 at 2016-09-24

shadowvwvpn服务端设置

Debian & Ubuntu

For Debian 7 and Ubuntu 12+

vim /etc/apt/sources.list

添加

deb http://shadowvpn.org/debian wheezy main

Then

apt-get update 
apt-get install shadowvpn

修改server.conf

vim /etc/shadowvpn/server.conf

修正如下

# ShadowVPN config example
# Notice: do not put space before or after "="
# Server listen address
server=0.0.0.0          #无须改动
# Server listen port
port=1123               #此处修改为自己想要的监听端口

# Users allowed. Each must be HEX of 8 bytes. You can generate on by running:
#     xxd -l 8 -p /dev/random
# See `net` for more information.
# user_token=7e335d67f1dc2c01,ff593b9e6abeb2a5,e3c7b8db40a96105

# Password to encrypt traffic. You can generate one by running:
#     dd if=/dev/urandom bs=64 count=1 | md5sum
password=my_password    #此处改为自己想要的连接密码

# Server or client mode
mode=server             #此处确保为‘server’

# Max source ports. Must be the SAME with client or it won't work properly.
concurrency=1           #此处确保为1

# MTU of VPN tunnel device. Use the following formula to calculate:
#     1492 (Ethernet) - 20 (IPv4, or 40 for IPv6) - 8 (UDP) - 32 (ShadowVPN)
mtu=1432

# Tunnel device name. tunX for Linux or BSD, utunX for Darwin.
intf=tun0

# Local IP and subnet of the VPN tunnel.
# 
# If user_token is specified, NAT mode will be enabled on server side, and
# the client does not need to have the same network with the server.
# In NAT mode, each user will be assigned an IP automatically.
# for example:
#     tun0 is 10.7.0.1
#     client IPs will be 10.7.0.2, 10.7.0.3, 10.7.0.4, etc
# You'll see them in the log when ShadowVPN starts with -v:
#     assigning 10.7.0.2 to user 7e335d67f1dc2c01
#     assigning 10.7.0.3 to user ff593b9e6abeb2a5
#     assigning 10.7.0.4 to user e3c7b8db40a96105
#     VPN started

net=10.7.0.1/16

# Script to run after VPN is created. All key-value pairs (except password) in
# this file will be passed to the script as environment variables. Use this
# script to set up routes, turn on NAT, etc.
up=/etc/shadowvpn/server_up.sh

# Script to run before stopping VPN. All key-value pairs (except password) in
# this file will be passed to the script as environment variables. Use this
# script to restore routes, turn off NAT, etc.
down=/etc/shadowvpn/server_down.sh

# PID file path
pidfile=/var/run/shadowvpn.pid

# Log file path
logfile=/var/log/shadowvpn.log

启动服务端

service shadowvpn restart

IOS客户端Alice

001