跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • v2ray的路由功能真好用
未分類
23 2 月 2020

v2ray的路由功能真好用

zdszf 大佬有话说 : 2019-12-8 10:51:33

v2ray的路由功能真好用

本帖最后由 zdszf 于 2019-12-8 16:38 编辑

花了一上午来看v2ray的说明,一点点的写配置,终于懂了个大概。尝试了动态端口+mkcp和ws+tls+web+cdn。ws套CDN速度和以前gost -L=ss+ohttp速度齐平,KCP速度和gost开kcp也没明显区别。

目前觉得最让我喜欢的是路由功能,比如从服务端屏蔽网站,转发特殊访问(比如把看NF的请求转发到原生VPS上)。

还有啥骚操作,大佬们指点下吧

美国VPS综合讨论: v2ray官方一键脚本支持小内存VPS安装的alpine吗? 试试先.

配置例子:
# Usage:
#   v2ray.server

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

############# server config #############
vi /etc/v2ray/config.json
{
    "sniffing": {"enabled": true,"destOverride": ["http","tls"]},
   
    "inbounds":
    [
      {
      "port": 1289,
      "protocol": "vmess",
      "settings": {"clients": [{ "id": "UUID","alterId": 32}]},
      "detour": {"to": "dynamicPort"},
      "streamSettings": {"network": "mkcp","kcpSettings": {"uplinkCapacity": 25,"downlinkCapacity": 100,"congestion": true,"header": {"type": "utp"}}}
      },
      
      {
      "port": "10000-20000",
      "protocol": "vmess",
      "tag": "dynamicPort",      
      "settings": {"default": {"alterId": 32}},
      "allocate": {"strategy": "random","concurrency": 3,"refresh": 5},
      "streamSettings": {"network": "mkcp","kcpSettings": {"uplinkCapacity": 25,"downlinkCapacity": 100,"congestion": true,"header": {"type": "utp"}}}
      }
    ],
   
    "outbounds":
    [
      {
      "protocol": "freedom",
      "settings": {}
      },
      
      {
      "protocol": "blackhole",
      "settings": {},
      "tag": "block"
      }
    ],
   
    "routing":
    {
      "domainStrategy": "AsIs",
      "rules":
      [
            {"type": "field","outboundTag": "block","protocol": ["bittorrent"]},
            {"type": "field","outboundTag": "block","ip": ["geoip:private"]},
            {"type": "field","outboundTag": "block","domain": ["geosite:qihoo360"]}
      ]
    }
}
############# server config #############

# active
service v2ray restart

############# client config #############
{
    "inbounds":
    [
      {
            "port": 1087,
            "listen": "127.0.0.1",
            "protocol": "socks",
            "settings": {"udp": true}
      },
      
      {
      "port": 1089,
      "listen": "0.0.0.0",
      "protocol": "shadowsocks",
      "settings": {"method": "chacha20","password": "123456","network": "tcp,udp"}
      }
    ],
   
    "outbounds":
    [
      {
            "protocol": "vmess",
            "settings": {
                "vnext":
                [
                  {
                        "address": "127.178.127.228",
                        //"address": "277.185.613.314",
                        "port": 1289,
                        "users": [{"id": "UUID","alterId": 2}]
                  }
                ]
            },
      
            "mux": {"enabled": true,"concurrency": 128},
      
            "streamSettings": {"network": "mkcp","kcpSettings": {"uplinkCapacity": 5,"downlinkCapacity": 100,"congestion": true,"header": {"type": "utp"}}}
      },
   
      {
            "protocol": "freedom",
            "tag": "direct",
            "settings": {}
      }
    ],
   
    "dns": {
      "servers":
      [
                        "8.8.8.8",
            {"address": "223.5.5.5","port": 53,"domains": ["geosite:cn"],"expectIPs": ["geoip:cn"]},
            "8.8.4.4",
            "localhost"
      ]
    },
   
    "routing":
    {
      "domainStrategy": "IPIfNonMatch",
      "rules":
      [
            {"type": "field","outboundTag": "direct","domain": ["geosite:cn"]},
            {"type": "field","outboundTag": "direct","ip": ["geoip:cn","geoip:private"]}
      ]
    }
}
############# client config #############
自己按需修改

一颗赛艇 大佬有话说 : 2019-12-8 11:06:38

路由还可以实现dns分流,国内走国内dns,国外用国外dns,还可以自定义规则等等,神器

dragonfsky 大佬有话说 : 2019-12-8 10:54:00

能教教咋用不

vagaa 大佬有话说 : 2019-12-8 10:55:37

用了之后腰也不疼了

any 大佬有话说 : 2019-12-8 10:56:12

配置发出来试试

wangjy 大佬有话说 : 2019-12-8 10:56:52

我试了下,感觉和55没什么差别啊

jpfree 大佬有话说 : 2019-12-8 11:03:59

不知道说的什么,好像根本就用不上的样子

zdszf 大佬有话说 : 2019-12-8 11:04:24

wangjy 大佬有话说 : 2019-12-8 10:56
我试了下,感觉和55没什么差别啊

所以我目前觉得最好用的是路由功能啊,SS没有

anrighthand 大佬有话说 : 2019-12-8 11:05:06

反向代理,类似frp

wangjy 大佬有话说 : 2019-12-8 11:07:35

一颗赛艇 大佬有话说 : 2019-12-8 11:06
路由还可以实现dns分流,国内走国内dns,国外用国外dns,还可以自定义规则等等,神器 …

这个在客户端实现挺好的吧

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具