v2ray的官方使用说明https://www.v2ray.com/chapter_00/install.html
最简单的V2ray使用方法,不用第三方脚本。
1、使用v2ray官方脚本安装(建议不要使用第三方脚本)
bash <(curl -L -s https://install.direct/go.sh)
2、编辑配置文件config.json
vim /etc/v2ray/config.json,
复制以下配置,
port修改为自己的端口(记得在iptables和防火墙中放行),
id修改为自己私有的UUID。
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": XXX,
"protocol": "vmess",
"settings": {
"udp": true,
"clients": [
{
"id": "X-X-X-X-X",
"level": 1,
"alterId": 233
}
]
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "blocked"
},
]
}
}
}
3、重启v2ray服务
sudo systemctl restart v2ray
4、查看v2ray状态
sudo systemctl status v2ray
5、windows下使用图形客户端V2rayN
https://github.com/2dust/v2rayN/releases
对照服务端的配置一一填写,然后可以生成二维码供手机配置使用。
6、andorid下使用客户端V2rayNG
https://github.com/2dust/v2rayNG/releases
扫一扫步骤5生成的二维码即可,省掉打字输入~
simple is best : )