Tutorial ~16 min read

OpenWrt OpenClash Setup Guide: Transparent Proxy and Split Rules Step by Step (2026)

If you already run OpenWrt on a router or soft gateway, OpenClash is a practical way to centralize transparent proxy and gateway split rules so phones, laptops, TVs, and consoles do not each need their own Clash client. This guide follows a reproducible order: backup first, install the LuCI plugin and Meta-class core, import subscriptions and remote rule providers, turn on transparent forwarding, align DNS with your rules, and explicitly bypass LAN traffic. Along the way we call out realistic limits—RAM, oversized profiles, and IPv6 dual-stack behavior—so your whole-home setup stays maintainable.

Clash Editorial Team OpenWrt · OpenClash · Transparent proxy · Gateway routing · Rule subscription

Why run transparent proxy and split rules on the gateway?

Desktop tutorials usually assume one machine toggles system proxy or TUN. On a home LAN, the more scalable pattern is to publish policy once at the default gateway: every DHCP client inherits the same routing story without installing per-device VPN apps. OpenClash wraps a modern Clash-class engine (commonly aligned with Meta / Mihomo capabilities) behind LuCI menus, which is why it is popular among readers who already understand OpenWrt basics but do not want to hand-edit YAML on a phone screen at midnight.

The trade-off is honesty about hardware: your router CPU and RAM cap how many rule providers, GeoIP downloads, and concurrent sessions you can sustain. If your workload is mostly a power-user desktop with heavy split tunneling, pairing this article with our Clash Verge Rev Windows setup guide keeps expectations aligned—many households run OpenClash on the router for default policy and keep a graphical client on a laptop for fast debugging.

Hardware, firmware, and storage: know your ceiling

Treat OpenClash like any stateful middlebox: it holds connection tables, parses large YAML, and may download rule bundles to overlay storage. A workable minimum is often 128 MB RAM or more, with comfortable headroom closer to 256 MB+ when you stack multiple remote rulesets and Geo databases. ARM SoCs and x86 mini PCs both work, but the opkg architecture string must match your build—examples include x86_64 and various aarch64_* targets. Before you touch forwarding rules, export a configuration backup from LuCI and write down WAN/LAN addressing plus the DHCP pool; transparent modes are much easier to unwind when you still know the last-known-good topology.

Risk note: mis-tuned firewall or DNS on the gateway can lock you out of LuCI. Keep a wired path, know how to enter failsafe, and avoid applying risky changes while remotely connected unless you have an out-of-band recovery plan.

Network topology: DHCP, default gateway, and who gets proxied

The usual home layout places all LAN clients in one RFC1918 segment with the router as default gateway. Transparent proxying hooks into the forwarding path so eligible TCP/UDP flows are redirected to the Clash engine according to your rules and proxy-groups. That convenience makes LAN bypass lists essential: printers, NAS boxes, cameras, and IoT hubs often should stay on direct paths so discovery protocols and multicast-heavy traffic do not get steered toward an exit node by mistake.

Consoles that sit on the same subnet as a PC running a desktop client are a different pattern; for that scenario see our Nintendo Switch / PS5 LAN proxy guide. Here we focus on the router itself as the single choke point for most household devices.

1Install OpenClash: feeds, ipk, and first boot discipline

Real-world installs cluster into three families: upload a maintainer-built ipk that matches your architecture; add a compatible third-party feed and install via opkg; or bake packages into a custom image. OpenWrt branches differ enough that copy-pasting commands without reading the release notes for your version is how people end up with mismatched kernel modules. After installation you should see a Services → OpenClash entry (wording varies with translations). On first launch, prioritize core selection, download paths, and file permissions before you enable interception—starting transparent modes without a working core produces frustrating restart loops and opaque logs.

If your device is storage-constrained, plan where large artifacts live. Rule providers and databases can grow quickly; pointing downloads to external storage is common on x86 boards, while many ARM routers need a leaner rule footprint to avoid I/O stalls during nightly updates.

2Subscriptions and profiles: what “whole-home” actually imports

In the Subscriptions section, add your provider’s HTTPS subscription URL, set a sane refresh interval, and adopt a consistent naming scheme for nodes before you build policy groups. If the provider ships non-Clash formats, convert them with a workflow you control—our Subconverter complete guide walks through safer conversion patterns than pasting secrets into random web forms. Rotate the URL if it ever leaks in a chat log; subscription links are credentials, not shareable bookmarks.

Once the profile loads, validate proxy-groups, default outbound, and the intended mode (rule versus global). On routers, bloated profiles hurt twice: the UI becomes sluggish and the dataplane may spike CPU when updating thousands of nodes. Ask whether your provider offers a trimmed list or region filters before you import everything “because it was available.”

3Rule providers and gateway split routing

“Gateway split routing” in Clash vocabulary is mostly ordered rules plus remote rule providers: direct domestic CDNs, send video domains to a dedicated group, match GEOIP buckets, then fall back to a sensible default. Community-maintained bundles (ACL4SSR and Loyalsoldier are frequent starting points) save time but are not magic—read the comparison in our ACL4SSR vs Loyalsoldier ruleset article before you stack providers you do not understand. On embedded hardware, prefer fewer, well-chosen providers over a maximalist ruleset that updates hourly.

Watch the operational side: failed downloads, stale files, or DNS resolution errors during update windows silently leave you on yesterday’s geography maps. Keep an eye on update logs, stagger refresh timers, and avoid enabling multiple gigantic GEOIP sources unless you truly need them—each extra provider is both flash wear and RAM pressure.

4Enable transparent proxy: redir versus TUN (conceptual)

OpenClash exposes different traffic takeover mechanisms depending on version and kernel capabilities. Classic iptables/nftables redirect paths are predictable and often lighter; TUN-style tunnels can feel closer to “full-device” capture and sometimes help with UDP-heavy workloads, but they also raise the bar for kernel modules, firewall ordering, and troubleshooting. A sane first pass is to enable the project’s recommended defaults, confirm baseline browsing works for LAN clients, then compare latency and CPU when switching modes. If you toggle modes frequently, document the change—future you will not remember which combination worked with your IPTV box.

When testing, change one variable at a time. If you simultaneously flip TUN, DNS hijack, and IPv6 without measuring, you will attribute symptoms to “bad rules” when the real issue is interaction between hooks. Capture logs when behavior diverges: a refused redirect looks different from a DNS loop or a mis-typed group name.

5DNS, Fake-IP, and leak prevention on a router

Gateway DNS is where small mistakes become house-wide outages. If clients still query ISP resolvers while Clash applies a different view upstream, you can see split-brain symptoms: some apps obey your rules while others appear to “bypass” policy because they never asked the resolver you thought they did. Read the dns stanza holistically—upstream lists, fallback ordering, FakeIP behavior, and domain policies—and map UI labels back to concepts in our Meta core DNS leak prevention guide so you are not cargo-culting toggles.

Practice tip: running another Clash client on a laptop at the same time as router-level hijacks can create double capture or conflicting DNS. For clean tests, isolate to one layer, verify, then add complexity.

6Bypass LAN, preserve management access, and firewall ordering

Always carve out private address space—for example 192.168.0.0/16, 10.0.0.0/8, and 172.16.0.0/12—so local services stay DIRECT. Pin management IPs, NAS targets, and multicast-heavy devices into bypass lists before you chase international domains. If you expose management to WAN (generally discouraged), revisit exposure after enabling transparent modes because forwarding chains can interact with custom firewall snippets you added years ago.

After firmware or core upgrades, revalidate that custom iptables/nft scripts still run in the intended order relative to OpenClash hooks. A rule that “worked fine” on an older kernel may now drop traffic before redirects occur, which looks like random packet loss from the user’s perspective.

Troubleshooting: RAM, huge subscriptions, and IPv6 surprises

Out-of-memory kills and sluggish LuCI

Symptoms include the core disappearing from top, LuCI timeouts, or transparent mode that works for minutes then collapses. Mitigations are pragmatic: reduce simultaneous rule providers, lengthen refresh intervals, disable nonessential daemons, and prefer leaner Geo sources. If you are still pinned against the limit, hardware upgrades—or moving heavy policy to a beefier x86 gateway—are cheaper than endless YAML micro-optimization.

Oversized subscription files

Thousands of nodes look impressive until parsing time dominates every config reload. Filter by protocol or region at conversion time, ask the provider for compact lists, and keep group names short enough to scan in logs. Remember that mobile clients and routers differ: what is tolerable on a gaming PC may choke a router SoC.

IPv6 dual-stack quirks

When your ISP hands out global IPv6 while your mental model is IPv4-only, some flows can appear to “escape” because they never touched the IPv4 rule path you tuned. Decide deliberately: disable IPv6 at the WAN/LAN boundary for testing, or invest the time to mirror policies for v6 DNS and forwarding. There is no universal toggle—verify with real traffic captures rather than assumptions.

Documentation and downloads: keep the site as the front door

Router configuration is only half the story. When you still need a graphical client on a laptop or phone for travel, grab packages from our official Clash download page and pair them with the configuration documentation for shared vocabulary—policy groups, modes, and DNS knobs mean the same things across ecosystems. GitHub remains the right place to read licenses, file issues, and follow upstream changes, but treat it as transparency, not the primary installer channel.

Closing thoughts

OpenClash on OpenWrt is fundamentally about centralizing transparent interception and gateway split rules so every device inherits consistent policy. Done carefully—with backups, conservative first boots, explicit LAN bypasses, and DNS aligned to your rules—it removes the busywork of per-machine clients while still fitting the Clash mental model. Compared with ad hoc browser extensions or one-off SOCKS settings, a router-level approach scales better for families and shared apartments, even though it demands more respect for resource limits and dual-stack networking.

When you want the same subscription and rule philosophy on a desktop with richer diagnostics, Clash-class clients remain the fastest way to iterate; the ecosystem shines when router and client share vocabulary rather than fighting each other.

Download Clash for free and experience the difference

Clash clients Desktop & mobile

When OpenClash handles gateway policy, keep graphical clients on laptops and phones for travel, quick rule edits, and deep log inspection—downloads stay on this site for a consistent update path.

Official builds

Windows, macOS, Linux, Android from the download hub

Same vocabulary

Profiles, groups, and DNS line up with router workflows

Debug-friendly

Logs and connection panes for side-by-side tests

Deep dives on the blog

DNS, Subconverter, and ruleset comparisons

Previous & Next

Related Reading

Router done—need a client?

Grab Clash from our download page for laptops and phones when you want portable debugging alongside OpenClash on the gateway.

Download Free Client