翻墙新工具v2ray
2020-10-02 更新,原方式失效
参照:https://ssrvps.org/archives/9376
上链接中的 安装v2ray 方式也失效了 更新为:
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
之后可以使用 service v2ray start|stop|status|reload|restart|force-reload 控制 V2Ray 的运行。
安装完毕后会提示如下字样:
installed: /usr/local/bin/v2ray
installed: /usr/local/bin/v2ctl
installed: /usr/local/share/v2ray/geoip.dat
installed: /usr/local/share/v2ray/geosite.dat
installed: /usr/local/etc/v2ray/config.json
installed: /var/log/v2ray/
installed: /var/log/v2ray/access.log
installed: /var/log/v2ray/error.log
installed: /etc/systemd/system/v2ray.service
installed: /etc/systemd/system/v2ray@.service
编辑 /usr/local/etc/v2ray/config.json:
{
"log" : {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 9000, //(此端口与nginx配置相关)
"listen": "127.0.0.1",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "6e554efc-f97a-467f-b944-7cd28927faae", //你的UUID, 此ID需与客户端保持一致
"level": 1,
"alterId": 64 //此ID也需与客户端保持一致
}
]
},
"streamSettings":{
"network": "ws",
"wsSettings": {
"path": "/2xxx" //与nginx配置相关
}
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "blocked"
}
]
}
}
}
注意上面的端口
随便网上找个UUID生成个 UUID 就可以了
修改好了 配置一下nginx:
server {
# SSL configuration
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl_certificate /ssl.pem; #你的ssl证书, 如果第一次,可能还需要自签一下,
ssl_certificate_key /ssl.key; #你的ssl key
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name test.v2ray.com; #你的服务器域名
location /2xxx { #/ray 路径需要和v2ray服务器端,客户端保持一致
proxy_redirect off;
proxy_pass http://127.0.0.1:9000; #此IP地址和端口需要和v2ray服务器保持一致,
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
}
宝塔中申请一个 ssl证书, 修改 ssl_certificate 和ssl_certificate_key 的证书路径
宝塔默认安装的证书路径为:/www/server/panel/vhost/ssl/
然后强制ssl
客户端配置:
{
"policy": null,
"log": {
"access": "",
"error": "",
"loglevel": "warning"
},
"inbounds": [
{
"tag": "proxy",
"port": 10808,
"listen": "0.0.0.0",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"auth": "noauth",
"udp": true,
"ip": null,
"address": null,
"clients": null,
"decryption": null
},
"streamSettings": null
}
],
"outbounds": [
{
"tag": "proxy",
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "bwh.anhm1024.xyz",
"port": 443,
"users": [
{
"id": "6e554efc-f97a-467f-b944-7cd28927faae",
"alterId": 64,
"email": "t@t.tt",
"security": "aes-128-gcm",
"encryption": null
}
]
}
],
"servers": null,
"response": null
},
"streamSettings": {
"network": "ws",
"security": "tls",
"tlsSettings": {
"allowInsecure": false,
"serverName": null
},
"tcpSettings": null,
"kcpSettings": null,
"wsSettings": {
"connectionReuse": true,
"path": "/2xxx",
"headers": null
},
"httpSettings": null,
"quicSettings": null
},
"mux": {
"enabled": true,
"concurrency": 8
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"vnext": null,
"servers": null,
"response": null
},
"streamSettings": null,
"mux": null
},
{
"tag": "block",
"protocol": "blackhole",
"settings": {
"vnext": null,
"servers": null,
"response": {
"type": "http"
}
},
"streamSettings": null,
"mux": null
}
],
"stats": null,
"api": null,
"dns": null,
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"port": null,
"inboundTag": [
"api"
],
"outboundTag": "api",
"ip": null,
"domain": null
}
]
}
}
重启下v2ray: ervice v2ray restart
就可以访问了
参考:
- https://gitlab.com/Alvin9999/free/wikis/%E8%87%AA%E5%BB%BAv2ray%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%95%99%E7%A8%8B
- https://www.echoteen.com/v2ray-new-webui.html
- http://zshttp.com/1310.html
- https://www.codercto.com/a/22204.html
- https://mrhee.com/v2ray.html
- https://www.4spaces.org/digitalocean-build-v2ray-0-1/
- https://atrandys.com/2019/1579.html [参照了这个]
- https://atrandys.com/2018/216.html
一键脚本: wget -N –no-check-certificate https://raw.githubusercontent.com/YLWS-4617/V2ray.Fun/master/install.sh && bash install.sh
VPS商家:
- https://billing.virmach.com/cart.php?a=checkout anaf@163.com
- k0TJw46Ct9mzUOO83w 107.172.82.146
- x0Wos91ZJM4Ncb85Qg 107.172.207.26
yum -y install wget
yum install zip unzip
wget https://install.direct/go.sh
bash go.sh
#启动
systemctl start v2ray
## 停止
sudo systemctl stop v2ray
## 重启
sudo systemctl restart v2ray
#继续
https://www.4spaces.org/v2ray-nginx-tls-websocket/
#加速
https://www.4spaces.org/speed-up-your-vps-with-bbr-plus/
===========配置参数============
地址:virmach.anaf.cn
端口:443
uuid:757b8bbc-6ced-4b6f-86e0-392abc431a0e
额外id:64
加密方式:aes-128-gcm
传输协议:ws
别名:myws
路径:c67b
底层传输:tls
===========配置参数============
地址:virmach1.anaf.cn
端口:443
uuid:65c59714-68da-4314-8c44-128d3a86b466
额外id:64
加密方式:aes-128-gcm
传输协议:ws
别名:myws
路径:cccf
底层传输:tls
v2ray+ws+tls一键脚本(CentOS7版):
注意:务必保证域名解析已经成功了,再使用下面的脚本安装。
打开电脑命令行,ping 你的域名,如果显示VPS的IP地址,则解析生效了。
一键脚本::
curl -O https://raw.githubusercontent.com/atrandys/v2ray-ws-tls/master/v2ray_ws_tls.sh && chmod +x v2ray_ws_tls.sh && ./v2ray_ws_tls.sh
等待脚本执行,过程中会提示需要输入域名,输入解析到本VPS的域名,然后回车
等待安装完成,你可以看到配置参数,客户端配置时用到。
4、安装BBR加速,指向下面命令::
cd /usr/src && wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
5、注意在弹出的安装界面首先选择1,安装BBR内核,安装过程可能时间较长,耐心等待。
6、安装完成后会提示重启VPS,输入Y,然后回车,确认重启。然后等待几分钟,再使用xshell连接vps(连接方法是点软件上打开,找到之前保存的连接,然后点连接)登陆后执行下列命令::
cd /usr/src && ./tcp.sh
7、在弹出安装界面,输入5,然后回车,使用BBR魔改版加速,等待安装完成提示bbr启动成功即可。
1、下载v2ray客户端
v2ray各平台客户端:https://www.v2ray.com/awesome/tools.html
2、将参数对应填写到客户端
这里大概说明一下参数怎么填写:
地址:你的域名,例如google.com
端口:443
用户ID:就是一长串uuid
加密方式:aes-128-gcm
传输协议:ws
path:就填路径这个参数
底层传输:tls
3、开启上网即可
telegram交流群:https://t.me/atrandys
4、关于移动端说明
目前有小伙伴反映,这个方案下,有的客户端可用有的不可用,那么需要你在保证配置正确的情况下,多试几个客户端。
个人现在主要用justmysocks,开头推荐的那个瓦工机场,主要是省心,所以关于这个方案的移动客户端使用情况,我给不了什么参考意见。
复活被墙IP
免费域名:https://my.freenom.com/cart.php?a=confdomains&language=english
使用了国外的DNS解析就行了 cloudflare.com
主机综合地址:www.zhujiceping.com
主机综合评测等:www.freehao123.com
新加坡域名商:sg.godaddy.com
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 anaf@163.com