mirror of
https://github.com/wangyu-/udp2raw-multiplatform.git
synced 2026-04-18 13:34:05 +02:00
Page:
udp2raw UDPspeeder OpenVPN原生运行在windows macOS上加速全流量
Pages
Acknowledgement
Differences of udp2raw_mp and original udp2raw
Home
How to build
Install pcap and libnet
Quick Start
easy faketcp模式注意事项
macOS用户注意事项
nolibnet版和普通版的区别
udp2raw UDPspeeder OpenVPN Guide
udp2raw UDPspeeder OpenVPN原生运行在windows macOS上加速全流量
udp2raw原生运行在windows macOS上“加速”kcptun
windows用户注意事项
中文文章
安装pcap和libnet
快速入门
跨平台版udp2raw和linux版的区别
No results
16
udp2raw UDPspeeder OpenVPN原生运行在windows macOS上加速全流量
wangyu- edited this page 2018-08-24 20:54:57 +08:00
Table of Contents
原理图
(图本身分辨率很高,如果看不清楚,请单独打开图片查看)
配置OpenVPN
在VPS(linux系统)和本地安装好OpenVPN,并准备好证书和配置文件。 启动OpenVPN server端,Client先不要启动。
OpenVPN配置文件
Server端
local 0.0.0.0
port 7777
proto udp
dev tun
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
server 10.111.2.0 255.255.255.0
ifconfig 10.111.2.1 10.111.2.6
client-to-client
duplicate-cn
keepalive 10 60
max-clients 50
persist-key
persist-tun
status /etc/openvpn/openvpn-status.log
verb 3
mute 20
comp-lzo no #this option is deprecated since openvpn2.4. For 2.4 and above, use "compress" instead
#compress
fragment 1200 ##### very important you can turn it up a bit. but, the lower the safer
mssfix 1200 ##### very important
sndbuf 2000000 ##### important
rcvbuf 2000000 ##### important
txqueuelen 4000 ##### suggested
replay-window 2000 ##### suggested
client端
client
dev tun100
proto udp
remote 127.0.0.1 3333
resolv-retry infinite
nobind
persist-key
persist-tun
ca ./ca.crt
cert ./client.crt
key ./client.key
keepalive 3 20
verb 3
mute 20
comp-lzo no #this option is deprecated since openvpn2.4. For 2.4 and above, use "compress" instead
#compress
fragment 1200 ##### very important you can turn it up a bit. but, the lower the safer
mssfix 1200 ##### very important
sndbuf 2000000 ##### important
rcvbuf 2000000 ##### important
replay-window 2000 ##### suggested
route 44.55.66.77 255.255.255.255 net_gateway
redirect-gateway def1
dhcp-option DNS 8.8.8.8
block-outside-dns ### For non-Windows user delete this line
#route 0.0.0.0 128.0.0.0
#route 128.0.0.0 128.0.0.0
在服务端添加iptables规则 开启ipforward
iptables -t nat -A POSTROUTING -s 10.111.0.0/16 ! -d 10.111.0.0/16 -j MASQUERADE
echo 1 >/proc/sys/net/ipv4/ip_forward
运行udp2raw 和udpspeeder
在vps端运行
./speederv2 -s -l0.0.0.0:20000 -r127.0.0.1:7777 -f10:10 --mode 0
./udp2raw -s -l0.0.0.0:20001 -r 127.0.0.1:20000 --raw-mode faketcp -a -k passwd
在本地运行
udp2raw_mp.exe -c -r44.55.66.77:20001 -l 127.0.0.1:8855 --raw-mode easyfaketcp -k passwd #或者添加防火墙规则后用faketcp模式
speederv2.exe -c -l0.0.0.0:3333 -r127.0.0.1:8855 -f10:10 --mode 0 --report 10
note
本地是linux系统的用户用如下命令运行udp2raw:
./udp2raw_mp -c -r44.55.66.77:20001 -l 127.0.0.1:8855 --raw-mode faketcp -k passwd -a
完成
用openvpn client +前面准备好的配置文件,运行,不出意外即可连上server。本地所有流量tcp/udp/icmp都会被udp2raw和UDPspeeder加速。
(但是注意你本地到VPS的流量默认是不走OpenVPN+udp2raw+UDPspeeder的,如果走了OpenVPN会产生环路)