This guide is for v2rayN users who have imported a subscription, tested nodes, and enabled the system proxy, and now want more control over domestic and overseas traffic exits. It covers preset routing order, the boundaries of whitelist and blacklist modes, custom rule syntax, and ways to verify routing through connection logs.
How domestic and overseas traffic is routed
v2rayN does not simply identify a website and switch nodes. An application request first reaches a local proxy port. The Xray core then identifies the target domain or IP address and checks routing rules from top to bottom. The first matching rule sends the connection through a proxy, direct, or blocked outbound; if nothing matches, the route’s default outbound is used.
In common desktop setups, the local SOCKS port is 10808 and the local HTTP port is 10809. After the system proxy is enabled, browsers and applications that support system proxy settings usually send requests through these entry points. TUN mode covers more traffic, but the routing logic remains the same: identify usable target information, apply the rules, then select an outbound.
Domain and IP rules apply under different conditions. When a browser sends a request by domain, domain, geosite, and domain-suffix rules can be evaluated directly; connections that provide only an IP mainly rely on ip, geoip, or the resolved address. With IPIfNonMatch, the core resolves the IP when no domain rule matches, then tries IP-based rules.
| Match target | Common syntax | Best suited for | Notes |
|---|---|---|---|
| Full domain | full:api.example.com |
Fixed endpoint or single host | Matches only the complete name |
| Domain suffix | domain:example.com |
Apex domain and subdomains | Useful for custom site rules |
| Domain set | geosite:cn |
Categorized group of domains | Depends on updates to local rule data |
| IP set | geoip:cn |
Target server address range | Address ownership does not equal service ownership |
The practical difference between “Bypass Mainland China,” whitelist, and blacklist modes
v2rayN 7.x routing settings generally offer preset profiles that can be copied and edited. Names may vary slightly between minor releases, so do not judge a profile by its label alone—check its rules and default outbound. “Bypass Mainland China” typically sends private networks, mainland-China domains, and mainland-China IPs directly, while handing unmatched traffic to the proxy outbound.
In this type of profile, mainland-China targets form an explicit direct-connection list. The interface or tutorials may describe this as a whitelist approach: known mainland-China and private addresses connect directly, while unknown targets use the proxy by default. The benefit is reliable coverage—new overseas domains can still use the proxy even before they appear in a category database. The trade-off is that mainland services missing from the categories may also be sent through the proxy.
Blacklist routing works the other way around: explicitly listed overseas targets, specific domains, or specific IPs use the proxy, while everything else connects directly by default. This reduces the chance of unknown targets entering the proxy and suits environments that access only a small set of fixed services, but it depends on list coverage. When a domain changes, a new endpoint is added, or a third-party resource is called, the main page may load while login, images, or API requests still go direct.
Bypass Mainland China profile
- Private addresses
- Direct
- Mainland-China domains
- Direct
- Mainland-China IPs
- Direct
- Unmatched targets
- Proxy
Suitable for everyday desktop use, keeping mainland services from taking an unnecessary detour.
Blacklist profile
- Specified overseas domains
- Proxy
- Specified address sets
- Proxy
- Private addresses
- Direct
- Unmatched targets
- Direct
Suitable when the target scope is fixed and the rules can be maintained consistently.
Bottom line: choose the mode by its default outbound
When unknown overseas targets should automatically use the proxy, choose “mainland direct, everything else proxied.” When only a small set of explicit targets should use the proxy, choose “specified targets proxied, everything else direct.” The default outbound says more about actual behavior than the profile name.
Global proxying is not a fine-grained routing strategy. It sends most connections through the proxy and is useful for temporarily checking whether a node works. If global mode works but split routing does not, the issue is usually rule matching, DNS resolution, or rule data—not the VMess or VLESS node itself. Switch back to split routing after troubleshooting to avoid unnecessary detours for mainland downloads, video, and local-network connections.
Building a maintainable split-routing profile in v2rayN
Before making changes, confirm that the node connects normally and note the currently working profile. These steps use v2rayN 7.x as the reference: open “Settings” → “Routing settings,” select the preset closest to your needs, and copy it as a new custom profile. Keeping the original preset makes rollback quick if a rule is wrong and gives you a reference for rule order and outbound labels.
- Choose the default outbound. For everyday browsing across mainland-China and overseas services, send unmatched targets through the proxy; for fixed workplace targets, send unmatched targets directly.
- Keep private networks direct. Put
geoip:private, local-network domains, and local addresses near the top of the direct rules so router admin pages, printers, and intranet services remain reachable. - Add mainland-China categories. Send
geosite:cnandgeoip:cnto the direct outbound, and use your domain-resolution strategy to decide whether both match types are needed. - Add precise exceptions. Put business domains that must use the proxy or direct connection before category rules, so broad sets cannot match them first.
- Save and reload the configuration. Select the new profile, restart the core, and then run connection tests. Saving rules without switching to the active profile does not change existing traffic.
The structure below illustrates Xray routing order. Avoid overwriting the running configuration outside the v2rayN interface, because the client may replace manual edits when it regenerates the configuration. The key points are private addresses direct first, precise exceptions before category rules, mainland-China categories direct, and the default rule handling everything left over.
{
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "direct"
},
{
"type": "field",
"domain": ["domain:service.example"],
"outboundTag": "proxy"
},
{
"type": "field",
"domain": ["geosite:cn"],
"outboundTag": "direct"
},
{
"type": "field",
"ip": ["geoip:cn"],
"outboundTag": "direct"
}
]
}
Rule combinations for common scenarios
A home desktop typically includes mainland-China websites, overseas services, local-network devices, and background system connections. Start with “private networks direct, mainland-China targets direct, everything else proxied,” then add precise exceptions for a few misclassified targets. This keeps mainland video and software downloads on local exits while reducing the chance that new domains fail because category data has not covered them yet.
For remote work, put corporate intranet domains, DNS suffixes, and dedicated addresses at the highest priority. If a corporate service uses an intranet domain that resolves to a private address, relying only on geoip:private may require waiting for domain resolution before it matches. Adding an explicit direct rule for domain:corp.example makes the behavior clearer. Corporate network policies take precedence over general presets.
Scenario 1: mainland services direct, everything else proxied
- Group 1: direct connections for local addresses, the LAN, and
geoip:private. - Group 2: exact domains that must use the proxy, placed before mainland-China categories.
- Group 3: direct connections for
geosite:cnandgeoip:cn. - Final rule: unmatched targets go to the proxy outbound.
Scenario 2: proxy only fixed business services
- Create proxy rules for the business’s primary domain, login domain, API domains, and static asset domains.
- Use logs to add third-party authentication, object storage, and content-delivery domains.
- Keep other targets direct and review business-domain changes regularly.
- Test more than the homepage: also test login, downloads, uploads, and long-lived connections.
Scenario 3: correct a misclassification for one domain
| Symptom | Rule location | Action |
|---|---|---|
| A mainland-China site is sent through the proxy | Before mainland-China categories | Add an exact direct domain rule |
| The target site still connects directly | Before mainland-China categories | Add an exact proxy domain rule |
| The page opens but images fail | Near the primary-domain rule | Add resource and API domains |
| A local-network device is unreachable | Top of the rule list | Send private addresses and intranet domains directly |
Bottom line: keep exception rules narrow
Prefer a full domain or a clearly defined suffix. Do not route an oversized domain set through the proxy just to fix one API. The narrower the scope, the easier future troubleshooting becomes and the less likely it is to affect mainland downloads or local-network connections.
Verifying logs and troubleshooting split routing
Do not validate split routing only from the outbound-address page. A webpage usually requests the main document, images, scripts, authentication APIs, and content-delivery domains at the same time, and different requests may match different rules. During verification, open v2rayN connection details or core logs and record the target domain, target port, matched outbound, and failure reason, then compare them with the custom rules one by one.
Create a fixed test set: five mainland-China websites, five websites that require the proxy, two local-network addresses, and two applications that depend on login APIs. After saving the rules, restart the core, clear each application’s connections, and visit them again one by one. In a browser, close existing tabs and reopen them to prevent connection reuse from keeping the old outbound active.
- First use global proxy mode to test the active node and confirm that the VMess or VLESS connection itself works.
- Switch back to the custom route and check whether the same target reaches the expected outbound.
- Check whether an earlier rule matched the target first.
- Check whether the domain request was resolved to an IP too early, leaving the domain rule no opportunity to match.
- Restart the core after updating routing data, then run the same test set again.
After selecting “Bypass Mainland China,” why are mainland-China websites still using the proxy?
First open “Settings” → “Routing settings” and confirm that the edited profile is active, then check the target domain and outbound in the logs. If the domain is not included in the mainland-China categories, add an exact direct rule before the category rules, save it, and restart the core.
Why does the main page load while login or images keep failing?
The primary domain and API domains are often different. Open the connection log and complete one login attempt, record the authentication, API, and resource domains involved in the failure, add them to the same outbound rule as the primary domain, and test again.
Why does switching routing profiles make no difference?
Confirm that the profile is set as the active route, not merely saved. Then restart the core from the main interface and close application windows that are still reusing old connections. If necessary, disconnect and reconnect the current node.
Why does the log show only an IP even though the domain rule is correct?
Check the domain strategy, DNS settings, and traffic-identification status. For connections that provide only a target IP, add the corresponding geoip or CIDR rule, and avoid treating a dynamic address as one permanently fixed IP.
Will updating the subscription overwrite split-routing rules?
Subscription updates mainly refresh the server list. Custom routing is usually stored separately, but switching configurations, resetting settings, or importing a complete configuration can change the active profile. After updating, check the current node and routing profile name.
DNS is also part of split-routing verification. Resolution results can change with the network, time, and service scheduling, so the same service may return mainland-China or overseas addresses. Long-term rules based on a single IP are fragile. Prefer domain rules for service identification, and use IP rules for private networks, stable ranges, and supplementary checks when domain rules do not match.
Rule data needs regular updates, but rerun the fixed test set after each update. Changes to category sets may fix old misclassifications or move a domain that previously relied on the default outbound into a new category. A maintainable profile keeps a small number of explicit exceptions, a clear rule order, and repeatable test records instead of continually stacking broad rules.