V2Ray一键脚本

今天做了CentOS 7/8系统的v2ray的一键安装脚本,目前已经上传到 Github。如果您的系统是Ubuntu,请参考这个教程: v2ray一键脚本Ubuntu版

提示:这是自己搭建科学上网环境的第三步,请确认已经做了前两步:

  1. 购买服务器。想要服务器速度快请参考:wordpressVPS购买教程 或 HostDare服务器购买教程 ,想ip被封后免费换请参考:购买vultr服务器超详细图文教程
  2. 连接到服务器,Windows系统请参考 Bitvise连接Linux服务器教程,mac用户请参考 Mac电脑连接Linux教程

如果你有域名,强烈建议使用 v2ray带伪装一键脚本,能有效应付近些天的疯狂封杀,提供稳如狗的体验!

使用教程

登录到服务器(windows请参考 Bitvise连接Linux服务器教程,mac用户请参考 Mac电脑连接Linux教程),在终端(黑框框)输入如下命令:

bash <(curl -sL https://raw.githubusercontent.com/hijkpw/scripts/master/centos_install_v2ray.sh)

按回车键,屏幕出现 “请设置v2ray的端口[1-65535]” 的提示,输入一个你希望的端口号(例如12345,不能是22)。接下来屏幕上会疯狂出现一些你看得懂也可能看不懂的东西,如果安装过程卡住,请耐心等待几分钟;期间网络断开(windows上表现为黑框框中或者顶部标题出现“disconnected”,mac表现为终端出现“closed by remote host”或”broken pipe”),请重新连接后再次执行命令。安装成功后截图如下:

V2Ray一键脚本
v2ray一键安装脚本

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

V2ray一键脚本做了如下事情:

  1. 更新系统到最新版
  2. 安装bbr加速模块
  3. 交互式安装v2ray

注意:本站的一键脚本与其他网站的不能混合使用,如果之前运行过其他的请先卸载,否则可能导致无法上外网!

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

客户端下载

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

v2ray windows客户端下载

v2ray安卓客户端下载

v2ray mac客户端下载

v2ray ios客户端下载

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

其他

1. 查看v2ray配置参数/运行状态:bash <(curl -sL https://raw.githubusercontent.com/hijkpw/scripts/master/centos_install_v2ray.sh) info;

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

3. 更改端口、alterid最简单的办法:重新运行一键脚本;

4. 更新v2ray到最新版:重新运行一键脚本

5. 卸载v2ray: bash <(curl -sL https://raw.githubusercontent.com/hijkpw/scripts/master/centos_install_v2ray.sh) uninstall

 

运行过程中遇到问题,请随时在页面留言。

18 thoughts on “V2Ray一键脚本

  • 【失败求助】
    环境:Mac Big Sur11.6, V2rayU 2.3.1
    情况:买了HostDare的服务器,SSH连接成功,V2Ray一键脚本成功,vmess链接成功生成,一切都按照文档操作,但访问 『google.com」一直失败(失败日志已粘贴在下方)。特请大佬好心帮忙看看。感谢感谢

    2022/01/14 11:35:21 [Info] [4154191948] v2ray.com/core/proxy/socks: TCP Connect request to tcp:lh5.googleusercontent.com:443
    2022/01/14 11:35:21 [Info] [4154191948] v2ray.com/core/app/dispatcher: default route for tcp:lh5.googleusercontent.com:443
    2022/01/14 11:35:21 [Info] [4154191948] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:185.238.248.65:12121
    2022/01/14 11:35:21 tcp:127.0.0.1:60085 accepted tcp:lh5.googleusercontent.com:443 [proxy]
    2022/01/14 11:35:21 [Info] [49470656] v2ray.com/core/proxy/socks: TCP Connect request to tcp:www.google.com:443
    2022/01/14 11:35:21 [Info] [49470656] v2ray.com/core/app/dispatcher: default route for tcp:www.google.com:443
    2022/01/14 11:35:21 [Info] [49470656] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:185.238.248.65:12121
    2022/01/14 11:35:21 tcp:127.0.0.1:60087 accepted tcp:www.google.com:443 [proxy]
    2022/01/14 11:35:21 [Info] [4154191948] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:lh5.googleusercontent.com:443 via tcp:185.238.248.65:12121
    2022/01/14 11:35:22 [Info] [49470656] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:www.google.com:443 via tcp:185.238.248.65:12121
    2022/01/14 11:35:22 [Info] [3956714996] v2ray.com/core/proxy/socks: TCP Connect request to tcp:www.google.com:443
    2022/01/14 11:35:22 [Info] [3956714996] v2ray.com/core/app/dispatcher: default route for tcp:www.google.com:443
    2022/01/14 11:35:22 [Info] [3956714996] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:185.238.248.65:12121
    2022/01/14 11:35:22 tcp:127.0.0.1:60089 accepted tcp:www.google.com:443 [proxy]
    2022/01/14 11:35:22 [Info] [3481584997] v2ray.com/core/proxy/socks: TCP Connect request to tcp:www.google.com:443
    2022/01/14 11:35:22 [Info] [3481584997] v2ray.com/core/app/dispatcher: default route for tcp:www.google.com:443
    2022/01/14 11:35:22 [Info] [3481584997] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:185.238.248.65:12121
    2022/01/14 11:35:22 tcp:127.0.0.1:60091 accepted tcp:www.google.com:443 [proxy]
    2022/01/14 11:35:22 [Info] [2471887330] v2ray.com/core/proxy/socks: TCP Connect request to tcp:google.com:80
    2022/01/14 11:35:22 [Info] [2471887330] v2ray.com/core/app/dispatcher: default route for tcp:google.com:80
    2022/01/14 11:35:22 [Info] [2471887330] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:185.238.248.65:12121
    2022/01/14 11:35:22 tcp:127.0.0.1:60093 accepted tcp:google.com:80 [proxy]
    2022/01/14 11:35:22 [Info] [3956714996] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:www.google.com:443 via tcp:185.238.248.65:12121
    2022/01/14 11:35:22 [Info] [2471887330] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:google.com:80 via tcp:185.238.248.65:12121
    2022/01/14 11:35:22 [Info] [3481584997] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:www.google.com:443 via tcp:185.238.248.65:12121
    2022/01/14 11:35:26 [Info] [692235611] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
    2022/01/14 11:35:26 [Info] [692235611] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
    2022/01/14 11:35:27 [Info] [2790613069] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
    2022/01/14 11:35:27 [Info] [2790613069] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
    2022/01/14 11:35:47 [Info] [1753559351] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
    2022/01/14 11:35:47 [Info] [1753559351] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
    2022/01/14 11:35:47 [Info] [2368074153] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
    2022/01/14 11:35:47 [Info] [2368074153] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
    2022/01/14 11:35:47 [Info] [3100433640] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
    2022/01/14 11:35:47 [Info] [3100433640] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
    2022/01/14 11:35:47 [Info] [1950749485] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
    2022/01/14 11:35:47 [Info] [1950749485] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > v2ray.com/core/proxy/socks: failed to transport all TCP response > io: read/write on closed pipe
    2022/01/14 11:35:52 [Info] [4154191948] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
    2022/01/14 11:35:52 [Info] [4154191948] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
    2022/01/14 11:35:52 [Info] [49470656] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
    2022/01/14 11:35:52 [Info] [49470656] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
    2022/01/14 11:35:53 [Info] [3956714996] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
    2022/01/14 11:35:53 [Info] [3956714996] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
    2022/01/14 11:35:53 [Info] [3481584997] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
    2022/01/14 11:35:53 [Info] [3481584997] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled

  • 服务器端能够正常ping通,从客户端机器到服务端的监听端口也是通的,但是就是不能连接成功,客户端报failed to process outbound traffic 错误。

留言评论

发表回复

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

Captcha Code