> For the complete documentation index, see [llms.txt](https://v2bx.v-50.me/v2bx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2bx.v-50.me/v2bx/gong-neng-shuo-ming/zi-ding-yi-lu-you-gong-neng-shuo-ming.md).

# Xray内核自定义路由功能说明

V2bX完整支持全部的Xray-core所提供的自定义路由功能，具体启用方式如下：

1. 编写 route.json文件，此配置与Xray 路由配置完全相同，请查看：<https://xtls.github.io/config/routing.html>获取帮助。
2. 在`config.yml`中配置`RouteConfigPath`为route.json的路径。
3. 如果要启用geoip相关配置，请确保`geoip.dat`和`geosite.dat`处于和`config.yml`同一目录。

{% hint style="info" %}
远程获取的节点自动生成的inboundTag/outboundTag遵循：\[ApiHost]-NodeType:NodeID的形式。如：\[[https://v2b.v-50.me\]-shadowsocks:12。入/出站tag相同。](https://v2bx.v-50.me/v2bx/gong-neng-shuo-ming/https:/v2b.v-50.me]-shadowsocks:12。入/出站tag相同。)
{% endhint %}

### 自定义路由功能示例

```
{
    "domainStrategy": "IPOnDemand",
    "rules": [
        {
            "type": "field",
            "outboundTag": "block",
            "ip": [
                "geoip:private"
            ]
        },
        {
            "type": "field",
            "outboundTag": "block",
            "protocol": [
                "bittorrent"
            ]
        },
        {
            "type": "field",
            "outboundTag": "IPv6_out",
            "domain": [
                "geosite:netflix"
            ]
        }
    ]
}
```
