Skip to main content

Set up NPV with xray or mihomo on your router

A ready-to-use xray config for Keenetic (xkeen), OpenWrt (Podkop), GL.iNet, AsusWRT-Merlin and MikroTik (mihomo) — built from your RouteSense subscription, vless key or base64 blob. Generated locally in your browser; nothing is sent to any server.

Configurator: build an xray/mihomo config

Supported inputs: a RouteSense subscription, a vless key, or a base64 blob with one or more keys.
You can request a subscription or key from support. Everything is processed locally and never leaves your browser.
Done

Guides for your router

1. Install xkeen

Plug in a USB drive (formatted as ext4/ext3), enable OPKG in the Keenetic web UI and install Entware. Then install xkeen following the guide on GitHub.

2. Upload the config

Download config.json with the button above. Copy the file to your router over SSH or WinSCP:

/opt/etc/xray/configs/config.json

3. Restart xkeen

xkeen -restart

Check the status with xkeen -status. Within 10–15 seconds all Wi-Fi traffic will follow the routing rules.

Podkop — the easiest way on OpenWrt

Podkop is a LuCI app for selective routing (sing-box + nftables). It accepts a vless:// key directly, so you don't need the config.json from this page — the key from step 1 is enough.

1. Install Podkop

Over SSH on the router (OpenWrt 23.05+, ~15 MB of free space):

sh <(wget -O - https://raw.githubusercontent.com/itdoginfo/podkop/main/install.sh)

The installer adds sing-box and the web UI on its own.

2. Paste your key

In the router web UI open Services → Podkop and paste your vless:// key as the proxy string in the connection field.

3. Choose what to route

In the domain lists (Community Lists) tick Russia inside: only blocked services go through NPV, the rest of your traffic stays direct. It's the domain-list counterpart of our In Russia mode. Hit Save & Apply.

Podkop reconfigures DNS by itself (encrypted DNS for the listed domains) — no extra steps. For troubleshooting, use the Diagnostics tab inside Podkop.

1. Install xray-core

opkg update
opkg install xray-core

If the package is missing from the repository, build it from source or use luci-app-xray-core for a GUI. Prefer something simpler? Check the Podkop tab — a one-command install with no config.json needed.

2. Place the config

/etc/xray/config.json

3. Start the service

/etc/init.d/xray enable
/etc/init.d/xray start

Logs: logread | grep xray.

GL.iNet runs on OpenWrt — the config is the same

Connect over SSH (login root, your web UI password), then:

opkg update
opkg install xray-core

Place config.json at /etc/xray/config.json. Then start it:

/etc/init.d/xray enable
/etc/init.d/xray restart

On models with built-in AdGuard Home, make sure its DNS port does not clash with the xray inbound on port 10808.

1. Install Entware

Your firmware must be AsusWRT-Merlin (not stock). Install Entware onto a USB drive following the official guide.

2. Install xray

opkg update
opkg install xray-core

3. Upload the config and enable autostart

/opt/etc/xray/config.json

Add to /jffs/scripts/services-start:

/opt/sbin/xray run -c /opt/etc/xray/config.json &

Save and reboot the router.

A turnkey option — Mihomo for RouterOS

xkeen does not run on MikroTik, but there is a solid alternative: the wiktorbgu/mihomo-mikrotik container. It runs Mihomo (a Clash fork), which speaks VLESS and works with a regular RouteSense subscription link.

Requirements: RouterOS v7.x, ARM / ARM64 / x86, a USB or SSD drive. Install the container package via System → Packages and enable container mode (see the official MikroTik guide).

1. Create a network for the container

/interface/bridge add name=Bridge-Docker
/ip/address add address=192.168.254.1/24 interface=Bridge-Docker
/interface/veth add address=192.168.254.3/24 gateway=192.168.254.1 name=MIHOMO
/interface/bridge/port add bridge=Bridge-Docker interface=MIHOMO

2. Paste your subscription link

Request a subscription link in your account dashboard and put the URL into the SUB1 variable — Mihomo will fetch the config and pull the full server list on its own:

/container envs add list=MIHOMO key=SUB1 value="https://sub.routesense.cc/raw/YOUR_SUBSCRIPTION"

If you want to connect a single vless:// key directly, use SRV1 instead of SUB1.

3. Start the container

/container add envlists=MIHOMO interface=MIHOMO logging=yes \
    remote-image=wiktorbgu/mihomo-mikrotik \
    root-dir=disk1/mihomo dns=1.1.1.1,8.8.8.8 \
    start-on-boot=yes

Once started, Mihomo serves a web dashboard at http://192.168.254.3:9090/ui/ where you can see throughput, the active server, and switch locations manually.

Templates and support

Advanced configs (Russian traffic bypassing NPV, everything else through the tunnel, separate rules for social networks and streaming) live in the wiktorbgu/mihomo-templates repository. Questions about Mihomo itself — in the author's chat @it_network_people. If something is off with your subscription — our support.

FAQ

Where do I get a subscription or key?

Request a subscription or vless key from support. This is personal data — never share it with anyone.

Does my key leak when generating the xray config?

No. All processing happens in your browser: the page loads your subscription and builds the config locally. Nothing is logged on our server and your sub URL is never stored.

Which routing mode should I pick?

In Russia is the best fit for most people: Russian services (Gosuslugi, VK, banks) and Apple go direct with no added latency, everything else goes through NPV. Abroad routes all traffic through NPV except your local network (if you want maximum anonymity even on Russian sites).

What if xkeen won't connect?

Check the logs: xkeen -log. The most common causes are a wrong clock on the router (Reality TLS requires accurate time — sync via NTP) or unfinished geoip/geosite downloads (run xkeen -reload). Still stuck? Message support and we'll help.

xkeen, Podkop or a manual xray install — which one?

On Keenetic — xkeen, it is built for the Entware environment of those routers. On OpenWrt and GL.iNet Podkop is the easiest: a one-command install, the key goes straight into the web UI, no config generator needed. A manual xray-core install is for those who want full control over routing: build a config.json with the configurator above and tweak it to taste.

Need a subscription?

15 GB free, no card, forever. Plenty to try it out.

Try for free

Other tools