# 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"
            ]
        }
    ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://v2bx.v-50.me/v2bx/gong-neng-shuo-ming/zi-ding-yi-lu-you-gong-neng-shuo-ming.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
