2017年12月10日星期日

V2Ray 简单安装

debian-8.7-x86_64

root@server1:~# sudo  vi  /etc/hosts  //修改hosts,改成“127.0.0.1  自己的主机命”。注意编辑的时候ESC,然后才能上下左右。i进入编辑模式。

root@server1:~# apt-get update
root@server1:~# apt-get install sudo  //以上两步更新 sudo程序

root@server1:~# sudo  vi  /etc/hosts  //修改hosts,改成“127.0.0.1 自己的主机命”。注意编辑的时候ESC,然后才能上下左右。

root@server1:~# wget https://toutyrater.github.io/install-release.sh //下载安装包

root@server1:~# sudo bash install-release.sh  //安装脚本。会自动生成端口和ID。安装成功:V2Ray v3.1 is installed.

root@server1:~# sudo systemctl start v2ray  //启动
root@server1:~# sudo systemctl restart v2ray  //重启
root@server1:~# service v2ray status  //查看运行状态

编辑配置文件, vi /etc/v2ray/config.json 开启MKCP,添加SS,以下为完整配置文件:
{ "log": { "access": "/var/log/v2ray/access.log", "error": "/var/log/v2ray/error.log", "loglevel": "warning" }, "inbound": { "port": 00000, "protocol": "vmess", "settings": { "clients": [{ "id": "xxxxxxxxxxxxx", "level": 1, "alterId": 64 }] } }, "streamSettings": { "network": "kcp", //开启MKUP "kcpSettings": { "mtu": 1350, "tti": 20, "uplinkCapacity": 5, "downlinkCapacity": 100, "congestion": false, "readBufferSize": 1, "writeBufferSize": 1, "header": { "type": "none" } } }, "outbound": { "protocol": "freedom", "settings": {} }, "inboundDetour": [{ "protocol": "shadowsocks", //添加SS。可添加多个。 "port": 0000, "settings": { "method": "aes-128-cfb", "password": "v2ray", "udp": true } }], "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" }] } } }

参考:https://toutyrater.github.io/prep/install.html
http://www.jianshu.com/p/b59150fd8f47

没有评论:

发表评论