Routing rules generator for v2rayNG, Xray, Clash and sing-box

Pick what goes direct and what goes through the VPN, and get a block to paste: routing for Xray, rules to import into v2rayNG and v2rayN, rules: for Clash Meta (mihomo), route for sing-box. Your country goes direct by the geosite and geoip lists, services by the domain lists of the Veli app catalog, built from v2fly. Everything is worked out in your browser.

Runs in your browser, nothing is sent

Settings

Mode

Everything goes through the VPN except your country's sites and the local network.

Your countryits sites and addresses go direct

Also directoptional

Loading the service lists…

Result

Pick your country and the rules will show up here.

Everything is worked out in your browser: keys and addresses are not sent anywhere.

Veli builds the config itself: paste a link, a subscription or a file into Add. Free, no sign-up.

Download Veli

Reference

The same rule in four clients

One sample worked out by the same code as the tool: Iran direct, example.com through the VPN, everything else through the VPN. proxy, direct and PROXY are the names of your outbounds and proxy group.

ClientIran directexample.com through the VPNEverything else through the VPN
Xray
{ "type": "field", "domain": ["geosite:category-ir"], "outboundTag": "direct" },
{ "type": "field", "ip": ["geoip:ir"], "outboundTag": "direct" }
{ "type": "field", "domain": ["domain:example.com"], "outboundTag": "proxy" }
no rule needed: the first outbound gets it
v2rayNG, v2rayN
{ "remarks": "direct · Iran", "domain": ["geosite:category-ir"], "outboundTag": "direct" },
{ "remarks": "direct · Iran", "ip": ["geoip:ir"], "outboundTag": "direct" }
{ "remarks": "proxy · example.com", "domain": ["domain:example.com"], "outboundTag": "proxy" }
no rule needed: the first outbound gets it
Clash Meta (mihomo)
- GEOSITE,category-ir,DIRECT
- GEOIP,ir,DIRECT
- DOMAIN-SUFFIX,example.com,PROXY
- MATCH,PROXY
sing-box
{ "rule_set": ["geosite-category-ir", "geoip-ir"], "action": "route", "outbound": "direct" }
{ "rule_set": ["services"], "action": "route", "outbound": "proxy" }
"final": "proxy"

Country lists in each client

The names the tool uses for every country, checked against the data files of each client on 29 November 2026. Where v2fly has no domain list for a country, its national domain zone goes direct.

CountryXrayv2rayNG, v2rayNClash Meta (mihomo)sing-box
Belarus
domain:by

no IP list in Xray's own geoip.dat

domain:by
geoip:by
DOMAIN-SUFFIX,by
GEOIP,by
domain_suffix: by
geoip-by
China
geosite:cn
geoip:cn
geosite:cn
geoip:cn
GEOSITE,cn
GEOIP,cn
geosite-cn
geoip-cn
Egypt
domain:eg

no IP list in Xray's own geoip.dat

domain:eg
geoip:eg
DOMAIN-SUFFIX,eg
GEOIP,eg
domain_suffix: eg
geoip-eg
Hong Kong
domain:hk

no IP list in Xray's own geoip.dat

domain:hk
geoip:hk
DOMAIN-SUFFIX,hk
GEOIP,hk
domain_suffix: hk
geoip-hk
India
domain:in

no IP list in Xray's own geoip.dat

domain:in
geoip:in
DOMAIN-SUFFIX,in
GEOIP,in
domain_suffix: in
geoip-in
Indonesia
domain:id

no IP list in Xray's own geoip.dat

domain:id
geoip:id
DOMAIN-SUFFIX,id
GEOIP,id
domain_suffix: id
geoip-id
Iran
geosite:category-ir
geoip:ir
geosite:category-ir
geoip:ir
GEOSITE,category-ir
GEOIP,ir
geosite-category-ir
geoip-ir
Kazakhstan
domain:kz

no IP list in Xray's own geoip.dat

domain:kz
geoip:kz
DOMAIN-SUFFIX,kz
GEOIP,kz
domain_suffix: kz
geoip-kz
Myanmar
domain:mm

no IP list in Xray's own geoip.dat

domain:mm
geoip:mm
DOMAIN-SUFFIX,mm
GEOIP,mm
domain_suffix: mm
geoip-mm
Pakistan
domain:pk

no IP list in Xray's own geoip.dat

domain:pk
geoip:pk
DOMAIN-SUFFIX,pk
GEOIP,pk
domain_suffix: pk
geoip-pk
Russia
geosite:category-ru
geoip:ru
geosite:category-ru
geoip:ru
GEOSITE,category-ru
GEOIP,ru
geosite-category-ru
geoip-ru
Saudi Arabia
domain:sa

no IP list in Xray's own geoip.dat

domain:sa
geoip:sa
DOMAIN-SUFFIX,sa
GEOIP,sa
domain_suffix: sa
geoip-sa
Turkey
domain:tr

no IP list in Xray's own geoip.dat

domain:tr
geoip:tr
DOMAIN-SUFFIX,tr
GEOIP,tr
domain_suffix: tr
geoip-tr
Turkmenistan
geosite:category-tm

no IP list in Xray's own geoip.dat

geosite:category-tm
geoip:tm
GEOSITE,category-tm
GEOIP,tm
geosite-category-tm
geoip-tm
UAE
domain:ae

no IP list in Xray's own geoip.dat

domain:ae
geoip:ae
DOMAIN-SUFFIX,ae
GEOIP,ae
domain_suffix: ae
geoip-ae
Ukraine
domain:ua

no IP list in Xray's own geoip.dat

domain:ua
geoip:ua
DOMAIN-SUFFIX,ua
GEOIP,ua
domain_suffix: ua
geoip-ua
Uzbekistan
domain:uz

no IP list in Xray's own geoip.dat

domain:uz
geoip:uz
DOMAIN-SUFFIX,uz
GEOIP,uz
domain_suffix: uz
geoip-uz
Vietnam
domain:vn

no IP list in Xray's own geoip.dat

domain:vn
geoip:vn
DOMAIN-SUFFIX,vn
GEOIP,vn
domain_suffix: vn
geoip-vn

What geosite, geoip and rule-set are

geosite is a file of named domain lists, such as geosite:youtube or geosite:category-ir. The lists come from v2fly/domain-list-community: v2rayNG and v2rayN take geosite.dat from Loyalsoldier/v2ray-rules-dat, Xray from XTLS/Xray-rules-dat, mihomo from MetaCubeX/meta-rules-dat, and the names are the same everywhere.

geoip is the same for IP ranges: geoip:ir, geoip:cn, and geoip:private for the local network. Since 26.10.21 Xray ships a lite geoip.dat with only China, Iran and Russia, while the Loyalsoldier file has every country. mihomo has a built-in GEOIP,lan that needs no file.

sing-box has no .dat files: every list is a rule-set file .srs (geosite-category-ir.srs, geoip-ir.srs from SagerNet/sing-geosite and sing-geoip) that sing-box downloads by its URL. Your own domains go into an inline rule-set right in the config, supported since 1.10.

FAQ

How do I set up routing in v2rayNG so local sites go direct?

Pick "Your country, direct", your country and the v2rayNG format, copy the rules, then in v2rayNG open the side menu → "Routing Settings" → ⋮ → "Import ruleset from clipboard". The import replaces every rule that isn't locked. With the domain strategy IPIfNonMatch the geoip rule also catches local sites on foreign domains.

What are geosite and geoip?

geosite.dat and geoip.dat are files of named lists next to the Xray or v2ray core: geosite:category-ir is every Iranian domain from v2fly/domain-list-community, geoip:ir every Iranian IP range. mihomo reads the same names as GEOSITE and GEOIP, and sing-box has them as .srs rule-set files.

Why do local sites open slowly, or not at all, through the VPN?

Through the VPN they see a foreign address: some local services and banks turn away visitors from abroad, and the traffic makes a round trip to another country. Sending your country direct fixes both and saves VPN traffic too.

What are the Clash rules for China direct?

Pick "Your country, direct", China and Clash Meta: you get GEOSITE,cn,DIRECT and GEOIP,cn,DIRECT before MATCH,PROXY. GEOSITE needs mihomo (Clash Meta), the old Clash core doesn't know it.

Where do the service lists come from?

From the catalog of the Veli app, built from v2fly/domain-list-community: the same lists, services only. Veli has its own Rules with the same catalog.