Vultr服务器搭建
Vultr服务器搭建见 https://www.hostpingce.com/vultr-vps-install-ss-ssr, 然后通过 IPIP 查询ping的结果, 或者本机ping,查看ping的延迟和丢包率,找到最快的线路,一般东京、洛杉矶的线路比较快。
- Superbensh脚本测试。
linux终端用 ssh root@ip
登录,用superbensh脚本测试。
wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
申请域名,并绑定
在 namecheap 购买域名,并绑定到 vultr 服务器ip,将主域名绑定到博客地址,将vps二级域名绑定到服务器ip。
服务器安装V2ray/SSR
SSR安装
用Shadowsocks一键安装脚本(shodowsocksall),安装之后再客户端正常填入地址、密码、端口号使用即可。
V2ray安装
用一键安装脚本进行vray安装(V2Ray_ws-tls_bash_onekey),依次安装v2ray(nginx+ws+tls)和bbrplus。
v2ray提供了很多很多传输方式,目前 nginx+ws+tls
方式最安全,穿墙效果最好。
客户端安装
Android用V2rayN,Linux版直接安装V2ray,按照服务端配置 /etc/v2ray/config.json
,设置开机启动 sudo systemctl enable v2ray.service
,chrome安装 switchomega
,配置socks5代理。
linux v2ray客户端配置文件
|
|
使用 proxychains 代理程序
终端可以用 proxychains program
让程序使用代理。
|
|
透明代理
树莓派设置
- 开启ipv4转发
命令为 echo net.ipv4.ip_forward=1 >> /etc/sysctl.conf && sysctl -p。执行后将出现 net.ipv4.ip_forward=1 的提示。
设置固定ip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
sudo vim /etc/dhcpcd.conf # Example static IP configuration: interface eth0 static ip_address=ip/24 static ip6_address=ip6/64 static routers=192.168.0.1 static domain_name_servers=114.114.114.114 # It is possible to fall back to a static IP if DHCP fails: define static profile profile static_eth0 static ip_address=ip static routers=192.168.0.1 static domain_name_servers=114.114.114.114
- 手动配置 PC 的网络,将默认网关指向树莓派的地址。
浏览器输入
192.168.0.1
进入网关,选择 DHCP 服务器,设置网关为ip
。安装v2ray
wget https://install.direct/go.sh
bash go.sh
,开机启动。配置文件如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
{ "log": { "access": "/var/log/v2ray/access.log", "error": "/var/log/v2ray/error.log", "loglevel": "info" }, "inbounds": [ { "tag":"transparent", "port": 12345, "protocol": "dokodemo-door", "settings": { "network": "tcp,udp", "followRedirect": true }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] }, "streamSettings": { "sockopt": { "tproxy": "tproxy" } } }, { "port": 1080, "protocol": "socks", "sniffing": { "enabled": true, "destOverride": ["http", "tls"] }, "settings": { "auth": "noauth" } } ], "outbounds": [ { "protocol": "vmess", "settings": { "vnext": [ { "address": "", # web "port": 443, "users": [ { "email": "user@v2ray.com", "id": "", # your id "alterId": 99, "security": "auto" } ] } ] }, "streamSettings": { "sockopt": { "mark": 255 }, "network": "ws", "security": "tls", "tlsSettings": { "allowInsecure": true, "serverName": "" }, "wsSettings": { "connectionReuse": true, "path": "", "headers": { "Host": "" } } }, "mux": { "enabled": true }, "tag": "proxy" }, { "protocol": "freedom", "tag": "direct", "settings": { "domainStrategy": "UseIP" }, "streamSettings": { "sockopt": { "mark": 255 } } }, { "tag": "block", "protocol": "blackhole", "settings": { "response": { "type": "http" } } }, { "tag": "dns-out", "protocol": "dns", "streamSettings": { "sockopt": { "mark": 255 } } } ], "dns": { "servers": [ "8.8.8.8", "1.1.1.1", "114.114.114.114", "119.29.29.29", { "address": "223.5.5.5", "port": 53, "domains": [ "geosite:cn", "ntp.org", "vps.lengyueyang.com" ] } ] }, "routing": { "domainStrategy": "IPOnDemand", "rules":[ { "type": "field", "inboundTag": [ "transparent" ], "port": 53, "network": "udp", "outboundTag": "dns-out" }, { "type": "field", "inboundTag": [ "transparent" ], "port": 123, "network": "udp", "outboundTag": "direct" }, { "type": "field", "ip": [ "223.5.5.5", "119.29.29.29", "114.114.114.114" ], "outboundTag": "direct" }, { "type": "field", "ip": [ "8.8.8.8", "1.1.1.1" ], "outboundTag": "proxy" }, { "type": "field", "outboundTag": "block", "domain": [ "ext:h2y.dat:ad", "geosite:category-ads-all" ] }, { "type": "field", "protocol":["bittorrent"], "outboundTag": "direct" }, { "type": "field", "outboundTag": "direct", "domain": [ "geosite:cn" ] }, { "type": "field", "outboundTag": "direct", "ip": [ "geoip:private", "geoip:cn" ] } ] } }
设置透明代理规则转发
|
|