Provider routing, DNS and geo
Wrabbit has no routing policy of its own: by default all traffic goes into the tunnel. You set the route — with rules in the Xray JSON template or with a Happ profile in the routing header. Below: which method applies to which servers, how to send Russian services direct, and what the client changes in your template.
#Where the route comes from
Exactly one source of provider rules applies to each server. Which one depends on how the server arrived in the subscription. The user's own rule sets always sit on top (Routing).
| Server arrived as | Whose rules apply | License | Who gets it this way |
|---|---|---|---|
Full Xray JSON (Wrabbit rule with XRAY_JSON or <sub_url>/json) | routing and dns of your template — as is | not needed: it is your template | 2.2.0 via the Wrabbit rule |
Links vless://, vmess://, trojan://, ss://, hysteria2:// | The Happ profile from this subscription's routing header | routing | 2.1.0 (Fallback Base64), other panels, subscriptions without JSON |
#Russian services direct: the Xray JSON template2.2.0
A typical task: Russian sites and banks go direct, everything else through the VPN. For 2.2.0 this is done in the XRAY_JSON template that Remnawave serves through the Wrabbit rule. Any Remnawave version works; the same template also works in Happ and v2rayNG.
#Turn on routeOnly on the template inbound
The client takes
sniffingfrom the first client inbound of the template (socks, http, mixed or tun). WithrouteOnly: truethe sniffed domain is used only by domain rules while the connection goes to the original IP, so IP rules also match HTTPS. WithrouteOnly: falsethe destination is replaced by the domain, and IP rules only see connections without a domain.#Set DNS with UseIPv4
queryStrategy: UseIPv4restricts the built-in resolver to IPv4. It answers AAAA queries over UDP or TCP locally withNOERRORand no addresses. These queries will be absent from the upstream DNS log. This also applies to names whose connections would match adirectrule. IPv6 routing still applies: apps can connect to a known IPv6 address if the selected outbound supports it. For AAAA-only names, setUseIPexplicitly in a full Xray JSON profile if the required outbounds support IPv6. Russian domains can use a Russian resolver.#Add direct rules before the catch-all
Put the rules right after the private-networks rule, before the final “everything else” rule. Explicit
domain:entries and CIDRs are the most reliable: they do not depend on geo files and their limits on the phone.Remnawave → Subscription Templates → XRAY_JSON (fragments)JSON { "inbounds": [ { "tag": "socks", "protocol": "socks", "port": 10808, "listen": "127.0.0.1", "settings": { "udp": true }, "sniffing": { "enabled": true, "destOverride": ["http", "tls", "quic"], "routeOnly": true } } ], "dns": { "servers": [ { "address": "https://dns.google/dns-query" }, { "address": "https://common.dot.dns.yandex.net/dns-query", "domains": ["domain:ru", "domain:xn--p1ai", "domain:yandex.net", "domain:vk.com"] } ], "queryStrategy": "UseIPv4" }, "routing": { "rules": [ { "type": "field", "outboundTag": "direct", "domain": ["domain:ru", "domain:xn--p1ai", "domain:yandex.net", "domain:vk.com", "domain:ozon.com"] }, { "type": "field", "outboundTag": "direct", "ip": ["77.88.0.0/18", "87.250.224.0/19"] } ] } }The domains and networks are an example; use your own list. If the shared XRAY_JSON template is also served to other clients and Wrabbit needs its own, name it in the Wrabbit rule with the
subscriptionTemplatefield (Remnawave 2.7.4+).#Check
Request the subscription the way 2.2.0 does and make sure the
directrules,routeOnly: trueandUseIPv4are there. The request takes an HWID slot — remove the device from the test user afterwards.Terminalbash curl -sS -o /tmp/wrabbit-sub.json -A 'Wrabbit/2.2.0' \ -H 'x-hwid: wrabbit-test-0001' -H 'Cache-Control: no-cache' \ 'https://YOUR-DOMAIN/<SHORT_UUID>' jq '.[0].routing.rules, .[0].inbounds[0].sniffing, .[0].dns.queryStrategy' /tmp/wrabbit-sub.jsonOn a phone with the VPN on, open a Russian and a foreign service that show your IP: the Russian one should show your home address. If a geo-code rule was cut, the log shows it.
#What the client changes in the template
The template runs as is, like in Happ: outbounds, balancers (leastLoad, leastPing, random, roundRobin, fallbackTag), observatory and burstObservatory, dialerProxy, routing.rules and dns. remnawave.injectHosts is expanded by the panel itself (2.6.3+). The client adds no rules, CDN exceptions or split DNS of its own. It only:
- replaces
inboundswith its own password-protected socks-in on 127.0.0.1; client inbound tags in rules are rewritten to it; - puts the user's rule sets at the start of the rules: block → direct → via VPN. “Via VPN” is the template catch-all if it leads to a proxy, otherwise the first proxy outbound or balancer;
- replaces a
fallbackTagthat points to another balancer with the first outbound of that balancer's pool and writes a warning to the log; - intercepts app DNS (port 53, UDP and TCP) into the core DNS module. A template with its own
dnsuses that DNS. A template withoutdnsgets a minimal1.1.1.1/1.0.0.1cache withUseIPv4and no split DNS: queries follow the template’s tunnel rules; - for full Xray JSON, when the client generates
dns-out, builds 503 and 504 return an empty answer for types other than A/AAAA. MX, TXT and SRV forwarding was added during development of build 505 and is included in candidate 550. These queries go to the original resolver over TCP through a validated proxy. If the client cannot select a suitable outbound, it returns SERVFAIL. HTTPS/SVCB, PTR and other types outside this list still get an empty answer. An existing template outbound taggeddns-outkeeps its own rules; - copies
sniffingfrom the template's client inbound; with no inbound or nosniffingit setsrouteOnly: true. Thesniffing-enabledirective applies on top; - always sets
domainStrategy: AsIs:IPIfNonMatchwould resolve every unmatched domain, and the VPN extension's memory on iPhone is limited; - checks geo codes (below). If a “→ proxy” rule was cut and the catch-all goes direct, the catch-all is switched to the proxy — blocked traffic does not leak past the VPN.
Provider network directives — fragmentation, mux, exclude-routes, dns-from-json-enable, sniffing-enable — also apply to full JSON. They are listed in the directives reference.
Ping, balancers and decoys: which outbound the client treats as the working one
The connection always uses your whole JSON. But the ping in the list and the Auto checks measure one “main” outbound — the preferred outbound. If the entry has a decoy, the ping may measure it and show red while the tunnel works.
Selection order: routing.balancers[].fallbackTag → tag proxy-wl* or *-wl-* → non-decoy if the pool has *decoy* → the catch-all rule's pool (a rule without domain, ip and port) → the target of the other routing.rules (outboundTag or balancerTag) → the balancer.selector pool → transport cluster (when TLS and Reality are mixed) → tag proxy → the first proxy outbound.
- The most reliable signal is
routing.balancers[].fallbackTagset to the working outbound. - Mark a decoy in its tag (for example
proxy-decoy-1) or give it a different transport from the working path. - For a balancer, the ping checks up to four outbounds of the pool. The Auto row has no number of its own.
dialerProxychains and fragmentation are honoured by the ping too.- For
leastLoadwithburstObservatory, open a new TCP connection after a scheduled probe. An existing connection stays on its selected outbound. Check thatsubjectSelectorcovers the pool’s tags. Probe interval and sample count (sampling) affect failover time. A completed HTTP exchange counts as transport success even if it returns 503. - If the HTTP probe passes while the outbound drops UDP, route the affected UDP traffic through a proxy you have verified. Place the rule with
network: udpand the proxy’soutboundTagbefore the catch-allleastLoadrule. Keep existing blocking, bypass and destination rules above it. Scope the rule to the affected addresses or ports if needed. Matching flows stay on that outbound. After updating the template, test fresh TCP and UDP sessions separately.
#Servers from links: the Happ profilerouting
Servers from links follow the Happ profile of their subscription — the same one Happ applies. Subscription A's profile does not apply to subscription B's servers or to servers added one by one. The user can turn the subscription's rule set off — then the profile and its DNS are not applied.
#Build the profile
The easiest way is the builder at routing.happ.su. A minimal profile:
Happ profileJSON { "Name": "RU direct", "DirectSites": ["domain:ru", "domain:xn--p1ai", "domain:vk.com"], "DirectIp": ["77.88.0.0/18", "87.250.224.0/19"], "ProxySites": [], "BlockSites": [] }The client drops references to external files
ext:andext-domain:; it keepsgeosite:andgeoip:and resolves them with geo files.#Serve the profile in the routing header
The value is a Happ link with the profile in base64. The header wins over a
happ://routing/…line in the body.Subscription response headerHTTP routing: happ://routing/onadd/<BASE64_PROFILE>Remnawave 3.x
There is no separate field: when upgrading to 3.0 the panel moved “Happ routing” into
customResponseHeaders, and theroutingline goes to every client. Add a new profile there too.Remnawave 2.7–2.8
The panel serves the Subscription Settings → Happ Routing field to Happ only: Wrabbit will not get it. Duplicate the same
routing: happ://routing/…line incustomResponseHeaders(and in squads'responseHeadersif set: in 2.x a squad replaces the whole set).#Check the license
The profile is applied only with a license that includes the
routingfeature. In 2.2.0 open Subscription check: Routing should have a check mark, and there should be no “Unverified directives” row. How to get a license — License.
| Profile field | What the client does |
|---|---|
BlockSites / BlockIp | → block |
DirectSites / DirectIp | → direct |
ProxySites / ProxyIp | → via the server |
DomesticDNS… / RemoteDNS… | split DNS: DirectSites are resolved by the domestic DNS, everything else by the remote one, via the server |
DnsHosts | dns.hosts |
Geoipurl / Geositeurl | this subscription's geo files |
DomainStrategy | ignored — always AsIs |
- Rule order: app DNS → core DNS module; private networks and Apple (
17.0.0.0/8) — direct; the user's rule sets (block → direct → via VPN); the subscription profile (block → direct → via VPN); everything else — via the server. - A profile without DNS fields gets one resolver,
1.1.1.1, via the server. The client has no “home” domains, QUIC blocking or CDN exceptions of its own.
#Turn the profile offrouting
With a header or a body line. The profile is then not applied to the subscription's servers: no rules, no DNS, no networks past the tunnel. For routing-enable only 1 or true turns it on; any other non-empty value turns it off. A link works too: routing: happ://routing/off; 2.2.0 also accepts plain routing: off.
routing-enable: 0
#Profile by link with auto-update2.2.0routing
Like autorouting in INCY: the profile is fetched from an https link (it wins over the routing header), loaded at once and then every routing-geo-update-interval hours, or once a day without it. Limits: https only, up to 512 KB, up to 30 s; the profile passes the same check as a profile from a link — no catch-all rules, negations or overly wide networks. On failure the previous profile stays, and the next try is no sooner than 30 minutes later.
autorouting: https://YOUR-DOMAIN/routing/profile.json
routing-geo-update-interval: 24
DirectIp past the tunnel at the iOS level: restrictions
Explicit IPv4 CIDRs from DirectIp (profile and user, up to 80) are routed past the tunnel at the iOS level — that traffic never enters the tunnel. Geo codes stay core rules.
- Each network is no wider than
/8, and all together no more than four/8: otherwise the profile would turn the VPN off while showing “connected”. - Networks that cover the tunnel's system DNS, the tunnel's own address or FakeDNS pools (for example
172.16.0.0/12) are not routed past the tunnel: a core rule sends them direct. - Networks that overlap explicit CIDRs from
BlockIpandProxyIpare not routed past the tunnel. - Domain rules do not work at the iOS level: a domain the user sends via the VPN goes direct if its IP is in the profile's
DirectIp. - Under Kill Switch iOS ignores routes past the tunnel: the first core rule sends the same list direct, for app traffic only.
#Geo files and limits on the phone
- 2.2.0 Each subscription has its own geo files from its profile (
Geoipurl/Geositeurl, as in Happ). Deleting the subscription deletes them. - A server's
geoip:andgeosite:codes resolve with its subscription's files, otherwise with the shared default set (geoip — runetfreedom, geosite — v2fly). If the code is not there either, the rule is cut with a log entry and the tunnel keeps working. - Profile files live as long as the profile sets them: if the
routingfeature is gone, the profile is turned off or the provider removesGeoipurl, the file is deleted and the default set resolves the codes. - 2.2.0
routing-geo-update-interval(hours, routing) — profile files are re-downloaded on schedule: checked when the app opens, and a scheduled refresh of the same address never runs over cellular. Without the directive a file is downloaded once until its address changes.
| What | Limit | What happens above it |
|---|---|---|
One geoip: code | 1 MiB | replaced by the default set or cut |
One geosite: code | 512 KiB | replaced by the default set or cut |
All distinct geoip: codes | 2 MiB | the extra ones are cut |
All distinct geosite: codes | 1 MiB | the extra ones are cut |
geoip:ru (about 400 KB) and geosite:category-ru (about 24 KB) fit the limits. Heavy codes — for example geosite:ru-blocked (about 1.6 MB) or “fat” builds of geosite:category-ads-all — are cut on the phone. If a rule is critical, write explicit domain: entries and CIDRs.
#2.2.0 and 2.1.0
| What | 2.2.0 | 2.1.0 |
|---|---|---|
| How servers arrive from Remnawave | Full JSON via the Wrabbit rule | Links via Fallback Base64, plus the app fetches <sub>/json itself: template outbounds and balancers apply to hosts with the same name |
| Whose rules apply | The XRAY_JSON template | The routing profile instead of the template's domain/ip rules; without a profile, the template rules from /json (with routeOnly: false) |
routing-enable: 0 | yes | yes |
autorouting, routing-geo-update-interval | yes | no |
| Profile geo files | per subscription | shared: files of the first subscription with Geoipurl/Geositeurl |
While 2.1.0 is in the App Store, keep the routing profile in customResponseHeaders — its subscribers need it. The setup order for both versions is in Remnawave setup.