v2ray带伪装一键脚本

本文转载自:https://v2raytech.com/v2ray-one-click-script-with-mask/,如文中内容有错误请到原文查看原始版(最新版)

使用过程中遇到问题,欢迎到 网络跳越论坛 或 tg群组https://t.me/hijkclub 交流,或关注Youtube频道:网络跳越

2020.10.26更新:推荐使用 V2ray多合一脚本,支持VMESS+websocket+TLS+Nginx、VLESS+TCP+XTLS、VLESS+TCP+TLS等组合

今天抽空完成了CentOS系统的v2ray带伪装一键安装脚本,代码已上传到 Github。本脚本能让您在服务端一键安装基于Nginx+websocket+tls的v2ray流量伪装和bbr加速模块,接下来就感受稳如狗的体验吧,再也不用担心ip被墙了!

Ubuntu系统请参考:v2ray带伪装一键脚本Ubuntu版

V2ray带伪装一键脚本使用教程

1. 准备一个境外服务器,想服务器速度快请参考 搬瓦工VPS购买教程 或从  CN2 GIA VPS商家推荐 选购,想ip被封后免费换请参考:购买vultr服务器超详细图文教程

伪装的前提是需要一个域名(例如hijk.art),并且域名的某个主机名(例如www.hijk.art)正确解析到服务器的ip。对域名没有要求,国内/国外注册的都可以,不需要备案,不会影响使用,也不会带来安全/隐私上的问题。购买域名可参考:Namesilo购买域名详细教程。不想购买请使用常规版的一键脚本:v2ray一键脚本

值得一提的是本V2ray带伪装一键脚本支持ipv6 only服务器,但是不建议用只有ipv6的VPS用来科学上网。

如果服务器有在运行网站,请联系网站运维再执行脚本,否则可能导致原来网站无法访问,本人不负责!

2. 如果vps运营商开启了防火墙(阿里云、Ucloud、腾讯云、AWS、GCP等商家默认有,搬瓦工/hostdare/vultr等商家默认关闭),请先登录vps管理后台放行80和443端口,否则可能会导致获取证书失败。此外,本脚本支持上传自定义证书,可跳过申请证书这一步,也可用在NAT VPS上。

3. ssh连接到服务器。Windows系统请参考 Bitvise连接Linux服务器教程,mac用户请参考 Mac电脑连接Linux教程

4. 复制(或手动输入)下面命令到终端

yum install -y curl
bash <(curl -sL https://s.hijk.art/centos_install_v2ray2.sh)

按回车键,脚本开始询问你一些信息,请按照提示输入,其中一些问题可直接按回车使用默认值。

接下来脚本会自动疯狂运行,如果安装过程卡住,请耐心等待几分钟;期间网络断开(windows上表现为黑框框中或者顶部标题出现disconnected字样,mac表现为终端出现“closed by remote host”或”broken pipe”),请重新连接后再次执行命令。脚本运行成功会输出配置信息,截图如下:

带伪装v2ray配置

带伪装v2ray配置

到此服务端配置完毕,服务器可能会自动重启(没提示重启则不需要),windows终端出现“disconnected”,mac出现“closed by remote host”说明服务器成功重启了。

打开浏览器输入伪装域名,能正常打开伪装站,说明服务端在正常运行;输入域名加伪装路径,出现”bad request”,则说明服务端已经完全没问题。

V2ray带伪装一键脚本其他事项

1. 查看v2ray运行状态 / 配置:bash <(curl -sL https://s.hijk.art/centos_install_v2ray2.sh) info

2. v2ray管理命令:启动:systemctl start v2ray,停止:systemctl stop v2ray,重启:systemctl restart v2ray

3. nginx管理命令:测试配置文件有无错误:nginx -t,启动:systemctl start nginx,停止:systemct stop nginx,重启:systemctl restart nginx

4. 更新v2ray到最新版:bash <(curl -sL https://s.hijk.art/goV2.sh)(提示“装不上daemon”不用管,systemctl restart v2ray重新启动v2ray就好了)

5. 伪装网站SSL证书放在配置文件的文件夹下,会自动续期;

6. 卸载: bash <(curl -sL https://s.hijk.art/centos_install_v2ray2.sh) uninstall

7. 建站/改伪装网站请参考:v2ray伪装建站教程

8. 搭建TG代理请参考: 一键搭建Telegram的MTProto代理

9. 希望上cdn,请根据本教程操作完后再阅读:v2ray使用cloudflare中转流量,拯救被墙ip

10. 理论上只要流量够、服务器扛得住,同一个配置支持无数人、无限设备使用。如果想为不同的人配置不同的id,请参考:v2ray多用户配置

12. 脚本默认使用BBR技术加速, BBR换成魔改BBR/BBR Plus/锐速清参考:安装魔改BBR/BBR Plus/锐速(Lotserver)

13. 搭建好伪装v2ray后建站/改伪装网站请参考:v2ray伪装建站教程

14. 刚搭建好带伪装的v2ray不要猛上流量,否则可能导致被限速、端口被墙,严重可能ip被墙。

V2ray客户端下载

接下来是科学上网最后一步:下载客户端,并参考页面中的配置教程进行配置:

v2ray windows客户端下载

v2ray安卓客户端下载

v2ray mac客户端下载

v2ray ios客户端下载

下载客户端配置好后,就可以愉快的上外网了!

参考

1.V2ray教程

2. v2ray高级技巧:流量伪装

3. trojan一键脚本

《v2ray带伪装一键脚本》上有104条评论

      1. CentOS Linux 7 (Core) 端口号:443,伪装路径:/AI0Y9OVvAj, v2启动失败,请检查端口是否被占用或伪装 路径是否有特殊字符!!
        端口443,伪装路径直接按回车自动生成的,为什么安装失败啊,,,,求大神解答

          1. 我已安装最新版本的了。暂时可以。请问伪装网址不能打开。还有没证书。暂时可以科学上网。请问有影响吗

  1. 大佬,我的vps ip被墙了,然后用临时节点登上去运行了这个教程的v2ray脚本,再打开伪装域名,可以看到centos官网。但是用这个脚本生成的配置,v2rayn客户端还是连不上谷歌。我也用cloudflare设置过dns,然后把v2rayn里面的ip改成域名,但是还是不行,请问怎么办呀

      1. 已经先把cloudflare的dns proxy配好了。不知道v2ray客户端是不是要改ip,就试了两次。结果如下,请大佬指教:
        这里是配置ip的结果
        2021/03/16 14:18:54 [Warning] v2ray.com/core: V2Ray 4.34.0 started
        2021/03/16 14:19:06 127.0.0.1:2004 accepted //www.google.com:443 [proxy]
        2021/03/16 14:19:36 127.0.0.1:2011 accepted http://www.gstatic.com/generate_204 [proxy]
        2021/03/16 14:19:37 127.0.0.1:2013 accepted //www.google.com:443 [proxy]
        2021/03/16 14:19:39 [Warning] [1166756607] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://144.34.174.101/tmp): > dial tcp 144.34.174.101:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://144.34.174.101/tmp): > dial tcp 144.34.174.101:443: operation was canceled] > v2ray.com/core/common/retry: all retry attempts failed

        把ip改成域名后的结果
        2021/03/16 14:22:28 [Warning] [1999450728] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 10.10.50.118:2081->104.21.84.119:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 10.10.50.118:2087->104.21.84.119:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 10.10.50.118:2091->104.21.84.119:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 10.10.50.118:2095->104.21.84.119:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > dial tcp: operation was canceled] > v2ray.com/core/common/retry: all retry attempts failed

          1. 大佬,能不能帮忙看下这是什么原因啊,1.0.0.1能ping通,但还是不行。。[吐血]

            配置:
            cloudflare partner 网站上设置的dns解析指向真实主机ip,DNSPod上设置的是:主机记录@,A记录,电信1.0.0.1,默认162.159.208.4,CNAME境外用cloudflare partner生成的CNAME

            报错信息:
            2021/03/17 08:10:56 [Warning] [3546384158] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 10.10.50.118:12890->1.0.0.1:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 10.10.50.118:12906->1.0.0.1:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 10.10.50.118:12917->1.0.0.1:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 10.10.50.118:12929->1.0.0.1:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 10.10.50.118:12937->1.0.0.1:443: i/o timeout] > v2ray.com/core/common/retry: all retry attempts failed
            2021/03/17 08:10:56 [Warning] [3546384158] v2ray.com/core/proxy/http: failed to read response from 14.tlu.dl.delivery.mp.microsoft.com > io: read/write on closed pipe
            2021/03/17 08:10:56 [Warning] [3546384158] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/http: connection ends > v2ray.com/core/proxy/http: failed to write response > write tcp 127.0.0.1:10809->127.0.0.1:12889: wsasend: An existing connection was forcibly closed by the remote host.

          2. 用的电信宽带,改成联通和移动的热点试了下,都不行呀。。
            报错还是这样。这个vps,ip已经被墙,没别的法子利用起来了吗?血亏呀

            2021/03/17 11:14:54 [Warning] [2451679624] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 192.168.43.146:11116->162.159.208.4:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 192.168.43.146:11124->162.159.208.4:443: wsarecv: An existing connection was forcibly closed by the remote host. v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 192.168.43.146:11128->162.159.208.4:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > write tcp 192.168.43.146:11145->162.159.208.4:443: i/o timeout v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://amysmith.xyz/tmp): > read tcp 192.168.43.146:11168->162.159.208.4:443: wsarecv: An existing connection was forcibly closed by the remote host.] > v2ray.com/core/common/retry: all retry attempts failed

          3. 你这种情况,必须套cloudflare才能拯救,操作为:1. 没套cloudflare的情况下,伪装网站必须能正常访问(通过走代理方式查看);2. 传输协议必须使用ws; 3. cloudflare的解析页面要开启小黄云;3. 客户端的ip地址填域名或者cloudflare的ip

  2. Job for nginx.service failed because the control process exited with error code.
    See “systemctl status nginx.service” and “journalctl -xe” for details.
    nginx: [emerg] BIO_new_file(“/etc/v2ray/140.82.9.207.pem”) failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(‘/etc/v2ray/140.82.9.207.pem’,’r’) error:2006D080:BIO routines:BIO_new_file:no such file)
    nginx: configuration file /etc/nginx/nginx.conf test failed
    nginx启动失败! 请到 https://hijk.art 反馈
    [root@vultrguest ~]#

  3. 为什么我安装完后出现[Sun Mar 21 14:21:03 CST 2021] Reload error for :
    但是出现了配置成功的界面,但是加密方式是none

  4. 完美伪装美女网址,可以打开,但用手机科学上网en.ipip.net查询IP时却显示在中国IP,请问大佬有关系吗,

  5. Namesilo旧的地址过期了,买了一个新的地址解析到ip。完了一顿代码复制粘贴,伪装域名出来的是还是旧的过期地址。怎么办呢。

  6. Redirecting to /bin/systemctl force-reload nginx.service
    [Thu Mar 25 16:47:45 CST 2021] Reload success
    Job for nginx.service failed because the control process exited with error code.
    See “systemctl status nginx.service” and “journalctl -xe” for details.
    nginx: [emerg] host not found in “9173

    ” of the “listen” directive in /etc/nginx/conf.d/mjfe2o.pp.ua.conf:9
    nginx: configuration file /etc/nginx/nginx.conf test failed
    nginx启动失败! 请到 https://hijk.art 反馈

    已按站内教程《v2ray伪装建站教程》建好博客,安装的时候启动nginx失败 请问是怎么回事,教我解决一下 谢谢

    1. nginx的配置出问题了
      需要先运行这个一键脚本,才能再伪装建站。建议你先使用这个一键脚本卸载,备份博客配置,然后rm -rf /etc/nginx,然后再次运行这个一键脚本

      1. 博客倒是没什么东西 不用备份 我先照你这个方法试试 因为我之前看了一个教程说是要先建一个伪装站 所以才去建了个博客

          1. 你好,现在脚本跑完能用了 但是根据你上面教程的提示“打开浏览器输入伪装域名,能正常打开伪装站,说明服务端在正常运行;输入域名加伪装路径,出现”bad request”,则说明服务端已经完全没问题。”我用不能正常打开伪装站,有什么影响吗

  7. 大佬 不好意思又来麻烦你了 昨天上去之后油管720p都卡 感觉原生BBR不太够用 所以今天想换魔改 然后就换了CentOS 7 再安装一键脚本的时候就说伪装没有解析到IP 但是我IP没有换还是昨天那个

  8. 最后反馈一下 下午重新申请域名弄好了 昨天申请那个pp.ua的域名前面状态变成灰色的了 状态显示“Closed, was active”

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注