喵♂呜 的博客

一个刚毕业就当爹的程序猿 正在迷雾中寻找道路...

V2ray安装指南

V2ray是新型的翻墙工具

  • 一健安装脚本

    1
    curl -L -s https://install.direct/go.sh | bash
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    Installing V2Ray v4.16.0 on x86_64
    Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/v4.16.0/v2ray-linux-64.zip
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 608 0 608 0 0 967 0 --:--:-- --:--:-- --:--:-- 968
    100 10.2M 100 10.2M 0 0 4237k 0 0:00:02 0:00:02 --:--:-- 6910k
    Extracting V2Ray package to /tmp/v2ray.
    Archive: /tmp/v2ray/v2ray.zip
    inflating: /tmp/v2ray/config.json
    creating: /tmp/v2ray/doc/
    inflating: /tmp/v2ray/doc/readme.md
    inflating: /tmp/v2ray/geoip.dat
    inflating: /tmp/v2ray/geosite.dat
    creating: /tmp/v2ray/systemd/
    inflating: /tmp/v2ray/systemd/v2ray.service
    creating: /tmp/v2ray/systemv/
    inflating: /tmp/v2ray/systemv/v2ray
    inflating: /tmp/v2ray/v2ctl
    extracting: /tmp/v2ray/v2ctl.sig
    inflating: /tmp/v2ray/v2ray
    extracting: /tmp/v2ray/v2ray.sig
    inflating: /tmp/v2ray/vpoint_socks_vmess.json
    inflating: /tmp/v2ray/vpoint_vmess_freedom.json
    PORT:16701
    UUID:b6fdc608-f9b0-47cc-90e8-f4457d4a2dee
    Created symlink from /etc/systemd/system/multi-user.target.wants/v2ray.service to /etc/systemd/system/v2ray.service.
    V2Ray v4.16.0 is installed.
  • 服务端配置 /etc/v2ray/config.json

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    {
    "log": {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
    },
    "inbound": {
    "port": 38325,
    "protocol": "vmess",
    "settings": {
    "clients": [
    {
    "id": "01a137bd-9fe6-4110-b8da-47ec02d90087",
    "level": 1,
    "alterId": 64
    }
    ]
    },
    "streamSettings": {
    "network": "mkcp",
    "kcpSettings": {
    "mtu": 1350,
    "tti": 20,
    "uplinkCapacity": 5,
    "downlinkCapacity": 100,
    "congestion": false,
    "readBufferSize": 1,
    "writeBufferSize": 1,
    "header": {
    "type": "none"
    }
    }
    }
    },
    "outbound": {
    "protocol": "freedom",
    "settings": {}
    },
    "outboundDetour": [
    {
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
    }
    ],
    "routing": {
    "strategy": "rules",
    "settings": {
    "rules": [
    {
    "type": "field",
    "ip": [
    "geoip:private"
    ],
    "outboundTag": "blocked"
    }
    ]
    }
    }
    }
  • 客户端配置 /etc/v2ray/config.json

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    {
    "log": {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
    },
    "inbound": {
    "port": 1080,
    "protocol": "socks",
    "domainOverride": [
    "tls",
    "http"
    ],
    "settings": {
    "auth": "noauth"
    }
    },
    "outbound": {
    "protocol": "vmess",
    "settings": {
    "vnext": [
    {
    "address": "服务器地址",
    "port": 38325,
    "users": [
    {
    "id": "01a137bd-9fe6-4110-b8da-47ec02d90087",
    "alterId": 64
    }
    ]
    }
    ]
    },
    "streamSettings": {
    "network": "mkcp",
    "kcpSettings": {
    "mtu": 1350,
    "tti": 20,
    "uplinkCapacity": 5,
    "downlinkCapacity": 100,
    "congestion": false,
    "readBufferSize": 1,
    "writeBufferSize": 1,
    "header": {
    "type": "none"
    }
    }
    }
    }
    }
  • 开启防火墙端口

    1
    2
    firewall-cmd --zone=public --add-port=38325/udp --permanent
    firewall-cmd --reload
  • 参考资料

欢迎关注我的其它发布渠道