v2raya安装教程

v2raya安装教程

vr2aya官方文档:https://v2raya.org/

v2ray-core官方文档:https://www.v2fly.org/

Debian / Ubuntu

v2rayA 的功能依赖于 V2Ray 内核,因此需要安装内核。

安装 v2rayA

方法一:通过软件源安装

添加公钥

wget -qO - https://apt.v2raya.org/key/public-key.asc | sudo tee /etc/apt/keyrings/v2raya.asc

添加 V2RayA 软件源

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

安装 V2RayA

sudo apt install v2raya v2ray ## 也可以使用 xray 包

方法二:手动安装 deb 包

从 Release 下载 v2rayA 的 deb 包 后可以使用 Gdebi、QApt 等图形化工具来安装,也可以使用命令行:sudo apt install /path/download/installer_debian_xxx_vxxx.deb ### 自行替换 deb 包所在的实际路径

V2Ray / Xray 的 deb 包可以在 APT 软件源中 找到。

启动 v2rayA / 设置 v2rayA 自动启动

从 1.5 版开始将不再默认为用户启动 v2rayA 及设置开机自动。

  • 启动 v2rayAsudo systemctl start v2raya.service
  • 设置开机自动启动sudo systemctl enable v2raya.service

使用 nftables

如果你的系统上已经有了 nftables 防火墙,那么 v2rayA 将优先使用 nft 命令来创建防火墙规则。可以使用 --nftables-support 参数或者 V2RAYA_NFTABLES_SUPPORT 来进行控制是否开启 nftables 支持。

v2ray-core下载安装

#平台支持

V2Ray 在以下平台中可用:

  • Windows 7 及之后版本(x86 / amd64 / arm32);
  • macOS 10.10 Yosemite 及之后版本(amd6 / arm64);
  • Linux 2.6.23 及之后版本(x86 / amd64 / arm / arm64 / mips64 / mips / riscv64);
    • 包括但不限于 Debian 7 / 8、Ubuntu 12.04 / 14.04 及后续版本、CentOS 7 / 8、Arch Linux 等;
  • FreeBSD (x86 / amd64);
  • OpenBSD (x86 / amd64);
  • Dragonfly BSD (amd64);

#下载 V2Ray

预编译的二进制 ZIP 格式压缩包可在 Github Releasesopen in new window 中找到。下载对应平台的压缩包,解压后即可使用。

#验证安装包

V2Ray 提供两种验证方式:

#Windows 安装方式

#macOS 安装方式

#Linux 安装方式

#安装脚本

请查看 GitHub 仓库:fhs-install-v2rayopen in new window

#Linux 发行版包管理器

Linux 发行版提供的 V2Ray 包(可通过发行版相应的包管理器安装):

#APT pinning

目前,Debian 的 V2Ray 包仍位于 Unstable 仓库,想用新包,又不想整体转为 Unstable 的话,就可以使用 APT pinningopen in new window

  1. 向 /etc/apt/preferences 写入:
Explanation: Uninstall or do not install any Debian-originated
Explanation: package versions other than those in the stable distro
Package: *
Pin: release a=stable
Pin-Priority: 900

Package: *
Pin: release o=Debian
Pin-Priority: -10

这将保证主体仍为 Stable。

  1. 向 /etc/apt/preferences.d/90debian-unstable 写入:
Package: v2ray
Pin: release a=unstable
Pin-Priority: 900

这会确保单独从 Unstable 仓库拿取 V2Ray 包。

  1. 执行并写入:
# apt edit-sources unstable

deb https://deb.debian.org/debian/ sid main
deb-src https://deb.debian.org/debian/ sid main

这样就增添了 Unstable(Sid)仓库。

  1. 更新软体仓库并安装 V2Ray:
# apt update
# apt install v2ray

注意:由于该包在 v2ray.service 中使用了 DynamicUser=true,如果你想向 /var/log/v2ray/ 目录档中写入 Log,请执行并写入:

# systemctl edit v2ray.service

[Service]
LogsDirectory=v2ray

#Linuxbrew 包管理器

Linuxbrewopen in new window 包管理器的使用方式与 Homebrew 一致:brew install v2ray

#Docker 安装方式

Docker image 的文件结构:

  • /etc/v2ray/config.json:配置文件
  • /usr/bin/v2ray:V2Ray 主程序
  • /usr/bin/v2ctl:V2Ray 辅助工具
  • /usr/local/share/v2ray/geoip.dat:IP 数据文件
  • /usr/local/share/v2ray/geosite.dat:域名数据文件
© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容