用cloudflare拯救被墙的vps
这段时间封ip封的厉害,简直到了丧心病狂的程度。好几台机器装了v2ra后,一用就被封。可能是装的v2ra没有伪装的缘故。看到一个帖子,https://v2xtls.org/v2ra%E4%BD%BF%E7%94%A8cloudflare%E4%B8%AD%E8%BD%AC%E6%B5%81%E9%87%8F%EF%BC%8C%E6%8B%AF%E6%95%91%E8%A2%AB%E5%A2%99ip/,于是也打算用cloudflare绕过封锁。
由于要重新安装带伪装的v2ra,第一个遇到的问题就是如何登陆被封的机器。由于cloudflare不支持端口22和ssh协议,所以靠域名无法做到。在Oracle Cloud里的文档研究了半天,因为一开始没有设置用户密码,所以还是登不上。后来看到一个
Oracle Cloud中进入实例的维护模式的方法(https://blog.csdn.net/centralunit/article/details/113108783)
终于重新设置了opc的密码进去了(前提是Oracle Linux 7.x, Oracle 8.x的还是没进去)。重新安装了带伪装的v2ra。
接下来就是痛苦的解决连不上问题的阶段。
问题1
failed to dial WebSocket > v2瑞.com/core/transport/internet/websocket: failed to dial to (wss://kor1.hugaoxiang.com/vf5q93): 301 Moved Permanently > websocket: bad handshake
这个问题是因为cloudflare没有开启ssl的full模式
问题2
v2ra客户端日志
v2瑞
400 Bad Request > websocket: bad handshake
这个问题是客户端没有开启tls
问题3
客户端v2ra的日志:
v2瑞 525 Origin SSL Handshake Error > websocket: bad handshake
这个问题是因为服务端没有安装cloudflare的ssl证书,一定要cloudflare的才行,跟随v2ra一起安装的证书不行。 记得修改nginx的ssl配置正确的ssl证书
问题4
服务端v2ra的日志:
rejected proxy/vless/encoding: invalid request version
这个问题是安装了VLESS+WS+TLS,基于websocket的v2ra伪装VLESS版本,而客户端却不支持。Mac好像只有Qv2瑞支持VLESS。
问题5
服务端v2ra的日志:
proxy/vmess/encoding: invalid user: VMessAEAD is enforced and a non VMessAEAD connection is received. You can still disable this security feature with environment variable v2瑞.vmess.aead.forced = false
根据一个帖子,https://tofu.icu/archives/13,
After 2022.1.1, v2ra disables compatibility with MD5 authentication by default and forces VMESS AEAD encryption.
So, if your V2Ra client's version is lower than v4.28.1, you probably will get this error in your V2Ra's logs (if you set the log level to info or debug):
proxy/vmess/encoding: invalid user: VMessAEAD is enforced and a non VMessAEAD connection is received. You can still disable this security feature with environment variable v2瑞.vmess.aead.forced = false . You will not be able to enable legacy header workaround in the future.
You have two choices to fix this problem:
- Update your client's core version to
v4.28.1or newer - edit
/etc/systemd/system/v2瑞.service, add the lineEnvironment="V2瑞_VMESS_AEAD_FORCED=false"beforeExecStart, so your service file should look like this:
问题6 nginx在配置ssl证书 nginx -s reload 有个warning "ssl_stapling" ignored, issuer certificate not found for certificate解决方法
这个问题先忽略,可能是cloudflare证书的问题。
弄了整整两天半的时间终于搞定。
问题7: 用了一段时间后,us2.hugaoxiang.com的机器突然连不上了,找了一下发现cloudflare连不上机器了,登上去一看,发现nginx挂了。

浙公网安备 33010602011771号