Admin

centos7安装vray服务
2019年4月22日 10:50 19 0 1 1

目录

安装

  1. bash <(curl -L -s https://install.direct/go.sh)

参考官方文档

配置文件

  1. vim /etc/v2ray/config.json

内容

  1. {
  2. "inbounds": [{
  3. "port": 1234,
  4. "protocol": "vmess",
  5. "settings": {
  6. "clients": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }]
  7. }
  8. }],
  9. "outbounds": [{
  10. "protocol": "freedom",
  11. "settings": {}
  12. }]
  13. }

系统服务

启动

  1. systemctl start v2ray

开机自动启动

  1. systemctl enable v2ray

防火墙

  1. firewall-cmd --zone=public --add-port=1234/tcp --permanent
  2. firewall-cmd --reload

客户端

安装

同服务端安装

配置

  1. {
  2. "inbounds": [{
  3. "port": 1081,
  4. "listen": "0.0.0.0",
  5. "protocol": "socks",
  6. "settings": {
  7. "udp": true
  8. }
  9. }],
  10. "outbounds": [{
  11. "protocol": "vmess",
  12. "settings": {
  13. "vnext": [{
  14. "address": "IP OR HOST URL HERE",
  15. "port": 1234,
  16. "users": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }]
  17. }]
  18. }
  19. },{
  20. "protocol": "freedom",
  21. "tag": "direct",
  22. "settings": {}
  23. }],
  24. "routing": {
  25. "domainStrategy": "IPOnDemand",
  26. "rules": [{
  27. "type": "field",
  28. "ip": ["geoip:private"],
  29. "outboundTag": "direct"
  30. }]
  31. }
  32. }
发布内容,请遵守相关法律法规。
评论