阿里云 ubuntu部署一键v20Ray

安装 V20Ray

主地址root#:: bash <(curl -s -L https://git.io/v20ray.sh)

备用地址root#:bash <(curl -s -L https://www.zhuguodong.com/xiazai/v20ray.sh)

如果提示 curl: command not found ,那是因为你的 VPS 没装 Curl
ubuntu/debian 系统安装 Curl 方法: apt-get update -y && apt-get install curl -y

然后,一路回车,安装完毕

 

v20ray restart是报Operation not permitted

进入报错目录 输入chattr -i *** 更改属性

然后 chmod -R 777 *

在重启v20ray 即可

如果重启后一开始好的,过几秒钟恢复Operation not permitted,则需要将/etc/v20ray/config.json的权限修改成777

 

改写服务器端config.json 使其可以在linux客户端使用

{
 "inbounds": [{
    "port": 57849,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "xxx-6c5a-495c-b114-7b872e751c0f",
          "level": 1,
          "alterId": 64
        }
      ]
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  },{
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
  }],
  "routing": {
    "rules": [
      {
        "type": "field",
        "ip": ["geoip:private"],
        "outboundTag": "blocked"
      }
    ]
  }
}

 

客户端配置文件

{
    "log": {
        "loglevel": "warning"
    },
    "inbound": {
        "listen": "0.0.0.0",
        "port": 8123,
        "protocol": "http",
        "settings": {
            "allowTransparent": false,
            "userLevel": 1
        }
    },
    "outbound": {
        "protocol": "vmess",
        "settings": {
            "vnext": [
                {
                    "address": "xx.xxx.220.167",
                    "port": 57849,
                    "users": [
                        {
                            "id": "xxxx-6c5a-495c-b114-7b872e751c0f",
                            "level": 1,
                            "alterId": 64
                        }
                    ]
                }
            ]
        }
    },
    "outboundDetour": [
        {
            "protocol": "freedom",
            "settings": {},
            "tag": "direct"
        }
    ],
    "routing": {
        "strategy": "rules",
        "settings": {
            "rules": [
                {
                    "type": "field",
                    "port": "54-79",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "port": "81-442",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "port": "444-65535",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "domain": [
                        "gc.kis.scr.kaspersky-labs.com"
                    ],
                    "outboundTag": "direct"
                },
                {
                    "type": "chinasites",
                    "outboundTag": "direct"
                },
                {
                    "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": "direct"
                },
                {
                    "type": "chinaip",
                    "outboundTag": "direct"
                }
            ]
        }
    }
}

配置文件修改后,重启v20ray服务

 

参考:

https://www.zhuguodong.com/?id=513

https://yuweidong.blog.csdn.net/article/details/112272223

 

上一篇:技术专栏概览(1)


下一篇:Visual Studio安装卸载模板