勇敢就是向前走

搭建和使用v2ray及遇到的几个坑

准备

  • Github 项目地址:https://github.com/v2ray/v2ray-core
  • 系统要求:
    Debian 9(推荐)
    Ubuntu 14
    Ubuntu 16
    CentOS 7
    其他Linux版本不建议
  • VIM 快捷键使用:
    输入i 进入编辑模式,修改完毕,Esc键退出编辑模式,输入:w保存文件,输入:q退出vim编辑。

一键安装脚本

   sudo -i 
   bash <(curl -s -L https://git.io/v2ray.sh)

(git.io是raw.githubusercontent.com的短链,最终解析到https://raw.githubusercontent.com/233boy/v2ray/master/install.sh
[tip type="info" title="注意"]
如果提示 curl: command not found
请安装 Curl
ubuntu/debian 系统安装 Curl 方法: apt-get update -y && apt-get install curl -y
centos 系统安装 Curl 方法: yum update -y && yum install curl -y
[/tip]
协议很多,可以搜索了解下,也可以直接用默认的。有的需要有域名(websocket tls),有的就不用(tcp,mkcp)
没啥需求就用 TCP
追求更加安全就用 WS + TLS
ISP 多作怪用动态端口
VPS 网络不好就用 mKCP
基本上按照提示一步步选择,回车就可以搞定了。

配置及管理

[tag type="default" outline]V2Ray 配置文件路径:/etc/v2ray/config.json[/tag]
[tip type="success" title="V2ray常用管理命令"]
v2ray info 查看 V2Ray 配置信息
v2ray config 修改 V2Ray 配置
v2ray link 生成 V2Ray 配置文件链接
v2ray infolink 生成 V2Ray 配置信息链接
v2ray qr 生成 V2Ray 配置二维码链接
v2ray ss 修改 Shadowsocks 配置
v2ray ssinfo 查看 Shadowsocks 配置信息
v2ray ssqr 生成 Shadowsocks 配置二维码链接
v2ray status 查看 V2Ray 运行状态
v2ray start 启动 V2Ray
v2ray stop 停止 V2Ray
v2ray restart 重启 V2Ray
v2ray log 查看 V2Ray 运行日志
v2ray update 更新 V2Ray
v2ray update.sh 更新 V2Ray 管理脚本
v2ray uninstall 卸载 V2Ray
[/tip]

各平台客户端

坑一之国内网络死循环

北京腾讯云服务器安装v2ray,但是国内服务器不好访问github,脚本也执行不了
解决办法就是修改服务器host,让服务器能访问github
1.修改host

sudo vi /etc/hosts
i

2.在末行添加

# GitHub Start
52.74.223.119 github.com
192.30.253.119 gist.github.com
54.169.195.247 api.github.com
185.199.111.153 assets-cdn.github.com
185.199.109.133 raw.githubusercontent.com
151.101.108.133 user-images.githubusercontent.com
151.101.76.133 gist.githubusercontent.com
151.101.76.133 cloud.githubusercontent.com
151.101.76.133 camo.githubusercontent.com
151.101.76.133 avatars0.githubusercontent.com
151.101.76.133 avatars1.githubusercontent.com
151.101.76.133 avatars2.githubusercontent.com
151.101.76.133 avatars3.githubusercontent.com
151.101.76.133 avatars4.githubusercontent.com
151.101.76.133 avatars5.githubusercontent.com
151.101.76.133 avatars6.githubusercontent.com
151.101.76.133 avatars7.githubusercontent.com
151.101.76.133 avatars8.githubusercontent.com
# GitHub End

3.保存退出

esc:
wq

4.按教程执行脚本

坑二之Windows下v2rayN-core的问题

若你下载的v2rayN出现了以下提示

启动服务(2021/6/10 11:51:15)...
找不到Core,下载地址: https://github.com/v2fly/v2ray-core/releases

则说明你没有安装v2ray-core(核心)因为V2Ray Windows 客户端主要有两个,一个是 v2ray-core(v2ray 核心,官方客户端),另一个是 v2rayN(基于 v2ray-core 的开一个 GUI 可视化客户端),其中 v2ray-core 可以单独使用,而 v2rayN 则是基于 v2ray-core 的一个辅助可视化工具。
解决方法:
你需要打开 https://github.com/v2ray/v2ray-core/releases 下载你对应的v2ray-core,然后把V2Ray-core zip包里面的东西移动到V2rayN的文件夹里,或者将 v2rayN里的v2rayN.exe 拖入到 V2Ray-core 文件夹内
然而最简单的办法则是直接下载V2rayN完整版(选择v2rayN-Core.zip):
https://github.com/2dust/v2rayN/releases/latest

添加新评论 取消回复