怎样在ipv6 only 的vps上安装v2ray+ws+TLS+CDN?
怎样在ipv6 only 的vps上安装v2ray+ws+TLS+CDN?
本地网络没有ipv6但是有台免费的ipv6 only vps怎么使用啊,这里介绍使用cloudflare的cdn让你的本地可以使用这种ipv6 only vps的网络。
~~不过我发现这种方法仍然不能正常访问只用ipv4的网站。~~用下面的方法可以解决,但是ipv4可能是黑名单吧!?
1echo "
2nameserver 2001:67c:2b0::4
3nameserver 2001:67c:2b0::6 " > /etc/resolv.conf
4
5# 随便选一个
6
7echo "
8nameserver 2001:67c:27e4:15::6411
9nameserver 2001:67c:27e4::64 " > /etc/resolv.conf
事先将域名添加一个AAAA解析指向自己的ipv6地址,这里以scaleya.xyz为例
ssh连接到ipv6 only vps
- 如果没有ipv6环境可以使用双栈vps做跳板连接到
1ssh root@2001:19f0:5401:1741:5400:02ff:fea2:2783
ipv6 only 一键安装v2ray脚本
- 输入以下命令 记住uuid 和 port
1wget scaleya.com/v2ray.sh
2bash v2ray.sh
3# PORT:20097 后面要改成443
4# UUID:972ddc4e-522c-4d66-8616-358c1aa5d132
修改v2ray配置文件
- 套用cf的cdn让ipv6 only 也能用在ipv4上
1nano /etc/v2ray/config.json
2# 修改使用ws并配置tls
ws+tls配置示例
1"streamSettings": {
2 "network":"ws",
3 "wsSettings": {
4 "path": "/"
5 },
6 "security": "tls",
7 "tlsSettings":{
8 "certificates": [{
9 "certificateFile": "/etc/v2ray/v2ray.crt",
10 "keyFile": "/etc/v2ray/v2ray.key"
11 }]
12 }
13 }
证书
- 证书来自cloudflare的15年免费证书
- 类型 ECDSA
- 分别存储为 /etc/v2ray/v2ray.crt
- /etc/v2ray/v2ray.key
ws+tls 完整配置示例
line 3 端口必须 443 line 13 尾巴要加上一个 ,
1{
2 "inbounds": [{
3 "port": 443,
4 "protocol": "vmess",
5 "settings": {
6 "clients": [
7 {
8 "id": "972ddc4e-522c-4d66-8616-358c1aa5d132",
9 "level": 1,
10 "alterId": 64
11 }
12 ]
13 },
14 "streamSettings": {
15 "network":"ws",
16 "wsSettings": {
17 "path": "/"
18 },
19 "security": "tls",
20 "tlsSettings":{
21 "certificates": [{
22 "certificateFile": "/etc/v2ray/v2ray.crt",
23 "keyFile": "/etc/v2ray/v2ray.key"
24 }]
25 }
26 }
27 }],
28 "outbounds": [{
29 "protocol": "freedom",
30 "settings": {}
31 },{
32 "protocol": "blackhole",
33 "settings": {},
34 "tag": "blocked"
35 }],
36 "routing": {
37 "rules": [
38 {
39 "type": "field",
40 "ip": ["geoip:private"],
41 "outboundTag": "blocked"
42 }
43 ]
44 }
45}
没有伪装站,无法使用
1"headers": {
2 "Host": "v2ray.com"
3 }
开启自启 启动 状态
1service v2ray start
2service v2ray status