V2Ray
方法一:通过软件源安装 【v2rayA/v2rayA 】项目的官方文档提供了很多种安装方法的指导,直接添加软件源。
# 添加公钥 wget -qO - https://apt.v2raya.org/key/public-key.asc | sudo tee /etc/apt/keyrings/v2raya.asc # 添加软件源 echo "deb [signed-by=/etc/apt/keyrings/v2raya.asc] https://apt.v2raya.org/ v2raya main" | sudo tee /etc/apt/sources.list.d/v2raya.list# 更新 & 安装 sudo apt update && sudo apt install v2ray v2raya -y # 启动 v2rayA `sudo systemctl start v2raya.service` # 设置开机自动启动 sudo systemctl enable v2raya.service # 启动 & 添加启动项 sudo systemctl enable --now v2raya.service
启动v2raya以后,打开浏览器,访问http://host-ip:2017即可访问v2raya的web ui。
接下去就是导入自己的梯子配置信息,全选后点左上角的 PING 可以测速延时,然后选中会用到的节点,点击**左上角的 启用`**即可。
点击右上角的 设置 ,我照抄的官网上的推荐配置。
到这里全部v2raya的配置就结束了。
如果局域网内有其他机器需要走代理,比如debian,只需要在.bashrc中添加代理配置:
export http_proxy="http://192.168.1.9:20172" export https_proxy="http://192.168.1.9:20172"
如果是windows,在设置——网络——代理中进行配置。
这里要留意,如果要走v2raya中配置的分流规则,端口号需要指向20172(默认的端口号)。
方法二:手动安装 deb 包 从 Release 下载 v2rayA 的 deb 包 后可以使用 Gdebi、QApt 等图形化工具来安装,也可以使用命令行:
sudo apt install /path/download/installer_debian_xxx_vxxx.deb
V2Ray / Xray 的 deb 包可以在 APT 软件源中 找到。
使用命令安装:
# 安装 v2ray B860:~:# apt install "/mnt/v2ray_5.37.0_arm64.deb" 注意,选中 'v2ray' 而非 '/mnt/v2ray_5.37.0_arm64.deb' 将要安装: v2ray 摘要: 升级:0,安装:1,卸载:0,不升级:43 下载大小:0 B / 16.8 MB 所需的空间:56.3 MB / 25.0 GB 可用 获取:1 /mnt/v2ray_5.37.0_arm64.deb v2ray arm64 5.37.0 [16.8 MB] 正在选中未选择的软件包 v2ray。 (正在读取数据库 ... 系统当前共安装有 42166 个文件和目录。) 准备解压 /mnt/v2ray_5.37.0_arm64.deb ... 正在解压 v2ray (5.37.0) ... 正在设置 v2ray (5.37.0) ... # 安装 v2raya B860:~:# apt install "/mnt/v2raya_2.2.7.1_arm64.deb" 注意,选中 'v2raya' 而非 '/mnt/v2raya_2.2.7.1_arm64.deb' 将要安装: v2raya 摘要: 升级:0,安装:1,卸载:0,不升级:43 下载大小:0 B / 12.7 MB 所需的空间:30.5 MB / 24.9 GB 可用 获取:1 /mnt/v2raya_2.2.7.1_arm64.deb v2raya arm64 2.2.7.1 [12.7 MB] 正在选中未选择的软件包 v2raya。 (正在读取数据库 ... 系统当前共安装有 42175 个文件和目录。) 准备解压 /mnt/v2raya_2.2.7.1_arm64.deb ... 正在解压 v2raya (2.2.7.1) ... 正在设置 v2raya (2.2.7.1) ... ****************************** * Completed! * ****************************** B860:~:#
分流规则 如果选择gfw模式,需要用到gfwlist.dat资源文件,记得点击更新,如果是root用户,gfwlist.dat文件的存放路径在"/root/.local/share/v2ray/LoyalsoldierSite.dat"。
如果是用大陆白名单模式,记得更新geosite.dat和geoip.dat文件,这俩文件的存放路径在/usr/share/v2ray。
在v2raya中我没有找到自动更新这俩文件的入口,所以做好写个脚本自动更新,更新来源可以查看【Loyalsoldier/v2ray-rules-dat 】这个项目。官方项目
启动 v2rayA / 设置 v2rayA 自动启动
从 1.5 版开始将不再默认为用户启动 v2rayA 及设置开机自动。
启动 v2rayA
sudo systemctl start v2raya.service
设置开机自动启动,这个最好是需要的时候就起动 。
sudo systemctl enable v2raya.service
设置 v2rayA 通过端口: http://localhost:2017 访问 UI 界面按提示进行节点导入并启动节点,一次可以选取多个节点并启动。
通过右上角的设置可以进行设置
设置完成后终端输入: curl https://www.google.com 看是否有信息返回。
如果是用大陆白名单模式,记得更新geosite.dat和geoip.dat文件,这俩文件的存放路径在/usr/share/v2ray。下载地址1 ,下载地址二 。
关闭v2raya服务 :sudo systemctl stop v2raya
重置密码:sudo v2raya --reset-password
启动服务:sudo systemctl start v2raya
关闭开机自启动项
查看项的当前服务状态:sudo systemctl status v2raya 以 v2raya为例
如果服务已经启用,可以使用命令禁用它:sudo systemctl disable v2raya
如果服务没有启用:sudo systemctl enable v2raya
现在此项服务将不再开机自启动了,如果要启用:sudo systemctl start v2raya
错误解决 failed to connect: failed to connect: unsupported shadowsocks encryption method: chacha20-ietf
选择节点时不要选择【协议】有带ietf 的节点,要不就会出现上面的这个问题。
参考文章
【总结目前国内加速拉取 docker 镜像的几种方法 】
【v2rayA用户文档 】
自动安装v2ray root@uefi-x86:~# bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 22562 100 22562 0 0 22577 0 --:--:-- --:--:-- --:--:-- 22562 info: Installing V2Ray v5.40.0 for x86_64 Downloading V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v5.40.0/v2ray-linux-64.zip % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:00:36 --:--:-- 0 100 16.6M 100 16.6M 0 0 22009 0 0:13:14 0:13:14 --:--:-- 492k Downloading verification file for V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v5.40.0/v2ray-linux-64.zip.dgst 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 下列软件包是自动安装的并且现在不需要了: python3-pkg-resources 使用'apt autoremove' 来卸载它(它们)。 建议安装: zip 下列【新】软件包将被安装: unzip 升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 94 个软件包未被升级。 需要下载 173 kB 的归档。 解压缩后会消耗 396 kB 的额外空间。 获取:1 https://mirrors.tuna.tsinghua.edu.cn/debian trixie/main amd64 unzip amd64 6.0-29 [173 kB] 已下载 173 kB,耗时 0秒 (493 kB/s) 正在选中未选择的软件包 unzip。 (正在读取数据库 ... 系统当前共安装有 36405 个文件和目录。) 准备解压 .../unzip_6.0-29_amd64.deb ... 正在解压 unzip (6.0-29) ... 正在设置 unzip (6.0-29) ... 正在处理用于 man-db (2.11.2-2) 的触发器 ... info: unzip is installed. info: Extract the V2Ray package to /tmp/tmp.Udpmk1TRYS and prepare it for installation. info: Systemd service files have been installed successfully! warning: The following are the actual parameters for the v2ray service startup. warning: Please make sure the configuration file path is correctly set . [Unit] Description=V2Ray Service Documentation=https://www.v2fly.org/ After=network.target nss-lookup.target [Service] User=nobody CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE NoNewPrivileges=true ExecStart=/usr/local/bin/v2ray run -config /usr/local/etc/v2ray/config.json Restart=on-failure RestartPreventExitStatus=23 [Install] WantedBy=multi-user.target [Service] ExecStart= ExecStart=/usr/local/bin/v2ray run -config /usr/local/etc/v2ray/config.json installed: /usr/local/bin/v2ray 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/[email protected] removed: /tmp/tmp.Udpmk1TRYS info: V2Ray v5.40.0 is installed. You may need to execute a command to remove dependent software: apt purge curl unzip Please execute the command : systemctl enable v2ray; systemctl start v2ray root@uefi-x86:~#