OpenVPN云免流服务器搭建

寒假的时候博主用上了4G手机了,开学来发现以前开的18元300M的流量经常不够用,想到初中时就已经有的免流,于是查了下资料,发现现在主流免流用的是OpenVPN方式了,这里做下记录搭建OpenVPN云免流服务器的过程

使用的系统:CentOS 7.1 x64

注:此方法中使用的免流代码已失效

一、搭建过程

  1. 添加拓展包源

    yum install epel-release

  2. 安装OpenVPN

    yum install openvpn easy-rsa -y

  3. 配置OpenVPN

    cp /usr/share/doc/openvpn-*/sample/sample-config-files/server.conf /etc/openvpn
    vi /etc/openvpn/server.conf

这里是我修改后的

#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients <-> one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine <-> single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 443

# TCP or UDP server?
proto tcp
;proto udp

# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one.  On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
#   openssl dhparam -out dh2048.pem 2048
dh dh2048.pem

# Network topology
# Should be subnet (addressing via IP)
# unless Windows clients v2.0.9 and lower have to
# be supported (then net30, i.e. a /30 per client)
# Defaults to net30 (not recommended)
;topology subnet

# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0

# Maintain a record of client <-> virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt

# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface.  Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0.  Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients.  Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
;push "route 192.168.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
#   iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN.  This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients.  There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
#     group, and firewall the TUN/TAP interface
#     for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
#     modify the firewall in response to access
#     from different clients.  See man
#     page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
push "dhcp-option DNS 114.114.114.114"
push "dhcp-option DNS 114.114.115.115"

# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names.  This is recommended
# only for testing purposes.  For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120

# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
#   openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
;tls-auth ta.key 0 # This file is secret

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC        # Blowfish (default)
;cipher AES-128-CBC   # AES
;cipher DES-EDE3-CBC  # Triple-DES

# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo

# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
user nobody
group nobody

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it.  Use one
# or the other (but not both).
;log         openvpn.log
;log-append  openvpn.log

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3

# Silence repeating messages.  At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20
  1. 生成证书

    mkdir -p /etc/openvpn/easy-rsa/keys
    cp -rf /usr/share/easy-rsa/2.0/* /etc/openvpn/easy-rsa
    vi /etc/openvpn/easy-rsa/vars

这是我修改后的

# easy-rsa parameter settings

# NOTE: If you installed from an RPM,
# don't edit this file in place in
# /usr/share/openvpn/easy-rsa --
# instead, you should copy the whole
# easy-rsa directory to another location
# (such as /etc/openvpn) so that your
# edits will not be wiped out by a future
# OpenVPN package upgrade.

# This variable should point to
# the top level of the easy-rsa
# tree.
export EASY_RSA="`pwd`"

#
# This variable should point to
# the requested executables
#
export OPENSSL="openssl"
export PKCS11TOOL="pkcs11-tool"
export GREP="grep"


# This variable should point to
# the openssl.cnf file included
# with easy-rsa.
export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`

# Edit this variable to point to
# your soon-to-be-created key
# directory.
#
# WARNING: clean-all will do
# a rm -rf on this directory
# so make sure you define
# it correctly!
export KEY_DIR="$EASY_RSA/keys"

# Issue rm -rf warning
echo NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR

# PKCS11 fixes
export PKCS11_MODULE_PATH="dummy"
export PKCS11_PIN="dummy"

# Increase this to 2048 if you
# are paranoid.  This will slow
# down TLS negotiation performance
# as well as the one-time DH parms
# generation process.
export KEY_SIZE=2048

# In how many days should the root CA key expire?
export CA_EXPIRE=3650

# In how many days should certificates expire?
export KEY_EXPIRE=3650

# These are the default values for fields
# which will be placed in the certificate.
# Don't leave any of these fields blank.
export KEY_COUNTRY="US"
export KEY_PROVINCE="CA"
export KEY_CITY="SanFrancisco"
export KEY_ORG="Fort-Funston"
export KEY_EMAIL="lanyu19950316@gmail.com"
export KEY_OU="MyOrganizationalUnit"

# X509 Subject Field
export KEY_NAME="server"

# PKCS11 Smart Card
# export PKCS11_MODULE_PATH="/usr/lib/changeme.so"
# export PKCS11_PIN=1234

# If you'd like to sign all keys with the same Common Name, uncomment the KEY_CN export below
# You will also need to make sure your OpenVPN server config has the duplicate-cn option set
export KEY_CN="openvpn.lanyus.com"

继续执行命令

cp /etc/openvpn/easy-rsa/openssl-1.0.0.cnf /etc/openvpn/easy-rsa/openssl.cnf
cd /etc/openvpn/easy-rsa
source ./vars
./clean-all
./build-ca
./build-key-server server
./build-dh
cd /etc/openvpn/easy-rsa/keys
cp dh2048.pem ca.crt server.crt server.key /etc/openvpn
cd /etc/openvpn/easy-rsa
./build-key client
./build-key client1
这里注意下,如果你的服务器只有你一个用户,那么可以不执行./build-key client1,如果是2个用户,则需要执行./build-key client1,3个用户则需要执行./build-key client2,依次类推,这样为每个用户生成1个证书
  1. 路由

    yum install iptables-services -y
    systemctl mask firewalld
    systemctl enable iptables
    systemctl stop firewalld
    systemctl start iptables
    iptables --flush
    iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
    iptables-save > /etc/sysconfig/iptables
    vi /etc/sysctl.conf
    添加net.ipv4.ip_forward = 1到文件顶部
    systemctl restart network.service

  2. 启动OpenVPN

    systemctl -f enable openvpn@server.service
    systemctl start openvpn@server.service

  3. 配置客户端

复制这三个文件到电脑中
/etc/openvpn/easy-rsa/keys/ca.crt
/etc/openvpn/easy-rsa/keys/client.crt
/etc/openvpn/easy-rsa/keys/client.key
新建client.ovpn,内容为

client
dev tun
proto tcp
remote 服务器IP 443
resolv-retry infinite
nobind
persist-key
persist-tun
comp-lzo
verb 3

########免流代码########
http-proxy-option EXT1 "POST http://rd.go.10086.cn"
http-proxy-option EXT1 "GET http://rd.go.10086.cn"
http-proxy-option EXT1 "X-Online-Host: rd.go.10086.cn"
http-proxy-option EXT1 "POST http://rd.go.10086.cn"
http-proxy-option EXT1 "X-Online-Host: rd.go.10086.cn"
http-proxy-option EXT1 "POST http://rd.go.10086.cn"
http-proxy-option EXT1 "Host: rd.go.10086.cn"
http-proxy-option EXT1 "GET http://rd.go.10086.cn"
http-proxy-option EXT1 "Host: rd.go.10086.cn"
http-proxy 10.0.0.172 80
########免流代码########

<ca>
ca.crt的内容粘贴到这里
</ca>

<cert>
client.crt的内容粘贴到这里
</cert>

<key>
client.key的内容粘贴到这里
</key>

注意:需要修改服务器IP为自己的服务器,ca、cert、key的内容需要按里面要求粘贴进去
默认的免流代码为移动的代码
可以修改为其他的

联通

http-proxy-retry
http-proxy 10.0.0.172 80
http-proxy-option EXT1 "X-Online-Host: wap.10010.com"
http-proxy-option EXT2 "Host: wap.10010.com"
电信

http-proxy-retry
http-proxy 10.0.0.200 80
http-proxy-option EXT1 "X-Online-Host: ltetp.tv189.com"
http-proxy-option EXT2 "Host: ltetp.tv189.com"
移动-默认

http-proxy-retry
http-proxy 10.0.0.172 80
http-proxy-option EXT1 "POST http://rd.go.10086.cn"
http-proxy-option EXT1 "GET http://rd.go.10086.cn"
http-proxy-option EXT1 "X-Online-Host: rd.go.10086.cn"
http-proxy-option EXT1 "POST http://rd.go.10086.cn"
http-proxy-option EXT1 "X-Online-Host: rd.go.10086.cn"
http-proxy-option EXT1 "POST http://rd.go.10086.cn"
http-proxy-option EXT1 "Host: rd.go.10086.cn"
http-proxy-option EXT1 "GET http://rd.go.10086.cn"
http-proxy-option EXT1 "Host: rd.go.10086.cn"
移动-彩信

http-proxy-retry
http-proxy 10.0.0.172 80
http-proxy-option EXT1 "POST http://mmsc.monternet.com"
http-proxy-option EXT1 "GET http://mmsc.monternet.com"
http-proxy-option EXT1 "X-Online-Host: mmsc.monternet.com"
http-proxy-option EXT1 "CMCC: mmsc.monternet.com"

使用时需要手机修改接入点为wap接入点,并把里面填写的代理服务器及端口删除掉,wap接入点有时会修改网页信息,可以考虑自己搭建HTTP代理,以使用net接入点

  1. 安装Android OpenVPN客户端

下载地址在这里:http://www.coolapk.com/apk/net.openvpn.openvpn

然后点击右上角,选择 Import Profile from SD card,导入刚才修改好的client.ovpn

点击Connect即可


二、免流原理

移动公司为了用户方便,设置了浏览部分移动的网站不需要花流量,而移动公司识别访问的网址是否为这部分网址时,出现了问题,导致识别错误,主要是这个X-Online-Host字段上的问题。OpenVPN免流时,实际会先通过HTTP代理,然后再建立VPN,在建立HTTP代理时,让移动公司识别我们是和移动的免流网站建立的代理,这样就能免流了。

标签: none

已有 80 条评论

  1. yang yang

    作者你好,我现在是在国外,有人在卖这个免流包,我花钱买了一个账号密码,然后看到他是用open VPN来免流,所以我想问下,只有.ovpn的文件的情况下,能不能自己做个免流服务器? 我把他的.ovpn的文件用记事本打开后有一段IP地址和端口号。 我的QQ是721193142, 如果可以的话请加我。

    1. @yang
      其实到处都有卖,免流要有一台服务器才行

      1. Yang Yang

        @ilanyu
        我知道要租服务器,我是在问免流代码可以从那个配置文件中找到吗?
        谢谢你

  2. Yang Yang

    你好,我租了一个网易蜂窝,然后修改了服务器地址,可还是连不上,能帮我看下吗?

    “client dev tunproto tcp remote apps.mtnplay.mobi.xyunaa.publicvm.com 443
    http-proxy 196.11.240.251 8080resolv-retry infinite nobind
    persist-keypersist-tunauth-user-passns-cert-type serverredirect-gatewaykeepalive 20 60comp-lzoverb 3mute 20route-method exeroute-delay 2”

    这是我买的那份配置文件

    这是我现在用的

    “client dev tun
    proto tcpremote 59.111.96.148 443http-proxy 196.11.240.251 8080resolv-retry infinitenobindpersist-keypersist-tunauth-user-passns-cert-type serverredirect-gatewaykeepalive 20 60comp-lzoverb 3mute 20route-method exeroute-delay 2
    ########免流代码########

    sbwml
    admin

    remote 59.111.96.148 3389 tcp-clientresolv-retry infinitenobindpersist-keypersist-tunpush route 8.8.8.8 8.8.4.4”

    是网易蜂巢现在不能用了还是我代码出错了?
    谢谢了

    1. @Yang
      我记得之前在哪看到说网易的封了那几个端口的,我用的腾讯的,没问题

  3. Yang Yang

    我又回来了,还是没弄好。。。

    2016-08-16 07:08:00 EVENT: RESOLVE
    2016-08-16 07:08:00 Contacting 196.11.240.251:8080 via HTTP Proxy
    2016-08-16 07:08:00 EVENT: WAIT_PROXY
    2016-08-16 07:08:00 SetTunnelSocket returned 1
    2016-08-16 07:08:00 EVENT: WAIT
    2016-08-16 07:08:00 TO PROXY: CONNECT apps.mtnplay.mobi.thetop5.tk:443 HTTP/1.0
    kangml: 127.0.0.1:440
    POST apps.mtnplay.mobi.thetop5.tk
    Host: apps.mtnplay.mobi.thetop5.tk / HTTP/1.1

    2016-08-16 07:08:02 FROM PROXY: HTTP/1.0 503 Service Unavailable
    Content-Type: text/html
    Proxy-Connection: close
    Connection: close
    Content-Length: 212

    2016-08-16 07:08:02 TCP recv EOF
    2016-08-16 07:08:02 Proxy Error: on 196.11.240.251:8080: HTTP proxy server could not connect to OpenVPN server
    2016-08-16 07:08:02 Client terminated, restarting in 2...
    2016-08-16 07:08:03 EVENT: DISCONNECTED
    2016-08-16 07:08:03 Raw stats on disconnect:
    BYTES_OUT : 158
    PACKETS_OUT : 1
    2016-08-16 07:08:03 Performance stats on disconnect:
    CPU usage (microseconds): 11784
    Network bytes per CPU second: 13408
    Tunnel bytes per CPU second: 0
    2016-08-16 07:08:03 ----- OpenVPN Stop -----
    这是我新弄的openvpn的配置文件的连接日志

  4. Yang Yang

    另外我买的配置文件里remote后面是个域名,要是把那个域名改成配套的IP地址就不行了,所以我现在也注册了个免费域名

  5. Yang Yang

    这是我现在在用的配置
    可以用的

    client
    dev tun
    proto tcp
    remote apps.mtnplay.mobi.vpn.mybeyond.top 443 这个是他的服务器,前面那段apps.mtnplay.mobi 是个免流网站
    http-proxy 196.11.240.251 8080 这是那个运营商的一个dns 服务器
    resolv-retry infinite
    nobind
    persist-key
    persist-tun
    auth-user-pass
    ns-cert-type server
    redirect-gateway
    keepalive 20 60
    comp-lzo
    verb 3
    mute 20
    route-method exe
    route-delay 2

  6. Yang Yang

    这是我自己写的配置文件
    client
    dev tun
    proto tcp
    remote apps.mtnplay.mobi.thetop5.tk 443

    ########免流代码########
    http-proxy 196.11.240.251 8080

    http-proxy-option EXT1 kangml 127.0.0.1:440
    http-proxy-option EXT1 "POST http://apps.mtnplay.mobi.thetop5.tk" 我试了把“http://”删了,也没用
    http-proxy-option EXT1 "Host: http://apps.mtnplay.mobi.thetop5.tk / HTTP/1.1
    ########免流代码########
    resolv-retry infinite
    nobind
    persist-key
    persist-tun
    setenv IV_GUI_VER "de.blinkt.openvpn 0.6.17"
    push route 114.114.114.144 114.114.115.115
    machine-readable-output
    connect-retry-max 5
    connect-retry 5
    resolv-retry 60
    auth-user-pass
    ns-cert-type server
    comp-lzo
    verb 3

    那个openvpn界面是提示说等待服务器,可是一直连不上。打开日志就是刚刚那个

  7. Yang Yang

    这是他的配置文件的连接日志
    2016-08-16 07:23:24 ----- OpenVPN Start -----
    OpenVPN core 3.0.11 ios arm64 64-bit built on Apr 15 2016 14:13:50
    2016-08-16 07:23:24 Frame=512/2048/512 mssfix-ctrl=1250
    2016-08-16 07:23:24 UNUSED OPTIONS
    5 [resolv-retry] [infinite]
    6 [nobind]
    7 [persist-key]
    8 [persist-tun]
    14 [verb] [3]
    15 [mute] [20]
    16 [route-method] [exe]
    17 [route-delay] [2]

    2016-08-16 07:23:24 EVENT: RESOLVE
    2016-08-16 07:23:24 Contacting 196.11.240.251:8080 via HTTP Proxy
    2016-08-16 07:23:24 EVENT: WAIT_PROXY
    2016-08-16 07:23:24 SetTunnelSocket returned 1
    2016-08-16 07:23:24 EVENT: WAIT
    2016-08-16 07:23:24 TO PROXY: CONNECT apps.mtnplay.mobi.vpn.mybeyond.top:443 HTTP/1.0
    Host: apps.mtnplay.mobi.vpn.mybeyond.top

    2016-08-16 07:23:24 FROM PROXY: HTTP/1.1 200 Connection established

    2016-08-16 07:23:24 Connecting to [apps.mtnplay.mobi.vpn.mybeyond.top]:443 (196.11.240.251) via TCPv4-via-HTTP
    2016-08-16 07:23:24 EVENT: CONNECTING
    2016-08-16 07:23:24 Tunnel Options:V4,dev-type tun,link-mtu 1544,tun-mtu 1500,proto TCPv4_CLIENT,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-client
    2016-08-16 07:23:24 Creds: Username/Password
    2016-08-16 07:23:24 Peer Info:
    IV_GUI_VER=net.openvpn.connect.ios 1.0.7-199
    IV_VER=3.0.11
    IV_PLAT=ios
    IV_NCP=2
    IV_TCPNL=1
    IV_PROTO=2
    IV_LZO=1

    2016-08-16 07:23:25 VERIFY OK: depth=1
    cert. version : 3
    serial number : 92:25:D8:7D:E7:B6:42:A3
    issuer name : C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=changeme, ??=changeme, emailAddress=mail@host.domain
    subject name : C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=changeme, ??=changeme, emailAddress=mail@host.domain
    issued on : 2016-04-06 15:25:44
    expires on : 2026-04-04 15:25:44
    signed using : RSA with SHA1
    RSA key size : 1024 bits
    basic constraints : CA=true

    2016-08-16 07:23:25 VERIFY OK: depth=0
    cert. version : 3
    serial number : 01
    issuer name : C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=changeme, ??=changeme, emailAddress=mail@host.domain
    subject name : C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=server, ??=changeme, emailAddress=mail@host.domain
    issued on : 2016-04-06 15:25:49
    expires on : 2026-04-04 15:25:49
    signed using : RSA with SHA1
    RSA key size : 1024 bits
    basic constraints : CA=false
    cert. type : SSL Server
    key usage : Digital Signature, Key Encipherment
    ext key usage : TLS Web Server Authentication

    2016-08-16 07:23:25 SSL Handshake: TLSv1.0/TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA
    2016-08-16 07:23:25 Session is ACTIVE
    2016-08-16 07:23:25 EVENT: GET_CONFIG
    2016-08-16 07:23:25 Sending PUSH_REQUEST to server...
    2016-08-16 07:23:25 OPTIONS:
    0 [redirect-gateway]
    1 [redirect-gateway]
    2 [dhcp-option] [DNS] [114.114.114.114]
    3 [dhcp-option] [DNS] [114.114.115.115]
    4 [route] [192.1.0.1]
    5 [topology] [net30]
    6 [ping] [10]
    7 [ping-restart] [120]
    8 [ifconfig] [192.1.1.142] [192.1.1.141]

    2016-08-16 07:23:25 PROTOCOL OPTIONS:
    cipher: BF-CBC
    digest: SHA1
    compress: LZO
    peer ID: -1
    2016-08-16 07:23:25 EVENT: ASSIGN_IP
    2016-08-16 07:23:25 Connected via tun
    2016-08-16 07:23:25 EVENT: CONNECTED ya605@apps.mtnplay.mobi.vpn.mybeyond.top:443 (196.11.240.251) via /TCPv4-via-HTTP on tun/192.1.1.142/
    2016-08-16 07:23:25 LZO-ASYM init swap=0 asym=0
    2016-08-16 07:23:25 SetStatus Connected

  8. Yang Yang

    拜托帮我看一下吧,是哪里出错了。。

    1. @Yang
      http-proxy 196.11.240.251 8080这个表示HTTP代理服务器及端口好吧,cmwap接入点的话,就应该是10.0.0.172 80,或者你也可以自己搭建个HTTP代理服务器

      1. Yang Yang

        @ilanyu
        我已经租了一个腾讯服务器了, 是用康师傅搭建的。
        我现在是真不知道哪里出错了

        我在的国家没有分cmWAP和cmnet
        那个配置文件是我基于康师傅自动生成的联通免流配置文件改的。

  9. Yang Yang

    http-proxy 196.11.240.251 8080这个表示HTTP代理服务器及端口

    这个IP地址,是从运营商发来的接入点设置里dns代理的默认设置。所以我也不懂。

    我之前找了一个人帮忙,他把这个http-proxy后面的IP地址改成我的服务器IP地址,我用wifi时可以连接但是空卡(这边都是预付费的,先充钱再用)就不行了。 而我买的那个配置文件我用空卡可以连,wifi就连不上了……

    1. @Yang
      建议你先百度学学怎么用openvpn搭建翻墙vpn吧,免流是在这个的基础上来的,这个搞不懂的话,也不会搞懂免流的

  10. barry barry

    博主,修改配置的时候复制你的可以吗

    1. @barry
      在我的基础上也要做做修改的

  11. ad ad

    按照你写的一步步做,最后client.crt内容为空

  12. 乐宝 乐宝

    我其他都成功了只是最后的免流文件有问题,现在也可以连接VPN,但不能实现免流,如果,知道某个网站流量不计费怎么如何把它配置到免流文件里

    1. @乐宝
      成都移动表示已失效

  13. bruce bruce

    @ilanyu 大神,你好

    我按照你的教程,手机能正常连接到openvpn server 也有流量。

    但是手机就是打不开任何网页,我已经将免流代码修改成自己区域的运营商网站

    请问如何拍错,谢谢

    1. killua killua

      @bruce我觉得你可能是vpn server iptables 设置问题

      1. bruce bruce

        @killua iptables 是复制你的代码,然后我也试过关掉防火墙,还是不行呀。

        1. killua killua

          @bruce不是我的代码。。。

  14. killua killua

    博主你好有几个问题想请教一下
    1、remote的地址是openvpn的地址端口吗?
    2、proxy-option 是vps的http 代理服务器的地址和端口?
    3、想了解一下手机消息的流程是
    app->openvpnclient->httpproxy->openvpnserver->目标web吗?计费系统是在哪儿阶段生效的?openvpnclient ->httpproxy是这个阶段吗?
    自己搭了一个 没成功,没找到什么原因。

  15. Xushengxian Xushengxian

    您好,按照您的方法,我已搭建openvpn成功,我觉得在这个的过程中,最主要的还是配置文件中,免流host的地址。请问您是如何找到免流host的呢?

    1. @Xushengxian
      主要的是模拟, 不是免流host, 只要用浏览器打开能免流的, 就能用来搞免流

  16. tony tony

    请教这里有高手知道怎么在美国装使用免流服务器服务吗?如有请联系我,收费没问题

  17. lenin lenin

    Hy there, every thing is in chinies here. I am not able to read and understand. I am from south africa. looking for free vpn settings for mtn network. Please if there any one can assist me.
    qimcspk@gmail.com (we can talk in pm too)

  18. zchazc zchazc

    非常感谢你的分享,另外我想问下这个是否会负法律责任?

  19. nero nero

    照着设置了,根本连不上

添加新评论