You turn the proxy on, public sites load, and then 192.168.1.1 spins forever. Or the NAS disappears from Finder. Or nas.lan resolves to something in 198.18.x.x that nothing answers on. People usually respond by switching nodes, which cannot possibly help — none of these paths involve your proxy server at all.
There are three distinct failures behind "LAN broke", and they need three different fixes. Applying the wrong one is why the problem survives a reinstall.
One check decides which case you're in
Run one command before touching any config: ping your gateway.
- Gateway replies, browser still fails → rules are routing the range into a proxy group (Case A)
- Gateway replies, hostname fails but IP works → DNS is returning a synthetic address (Case B)
- Gateway itself doesn't reply → the routing table was rewritten, rules never ran (Case C)
If more than one applies, work on the lowest one. A routing problem masks the other two, so editing rules while TUN owns the routing table is wasted editing.
Case A: private ranges match the proxy
Clash-family clients send anything that matches no rule to the MATCH policy, and MATCH normally points at a proxy group. Private ranges with no explicit rule therefore leave through your proxy server — which has no route to your router.
Confirm it rather than assume: open the client's connections panel, hit the LAN address again, and look at which policy that connection used. If it shows a node name instead of DIRECT, that is your bug.
The fix is three rules at the top of the file:
rules:
- IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
- IP-CIDR,10.0.0.0/8,DIRECT,no-resolve
- IP-CIDR,172.16.0.0/12,DIRECT,no-resolve
- IP-CIDR,127.0.0.0/8,DIRECT,no-resolve
Order matters more than the rules themselves. Placed after MATCH, they never fire. And no-resolve is not decoration: without it the client performs a DNS lookup to evaluate IP-CIDR, which for internal hostnames leaks the query upstream and turns a working setup into an intermittent one.
The 172.16.0.0/12 line is the one people forget, and it is the only one that covers Docker. Default bridge networks sit around 172.17.0.0/16. Services that work on the host and vanish inside a container are usually missing exactly this line.
Case B: fake-ip ate your hostname
If 192.168.1.20 loads and nas.lan doesn't, rules are fine. Look at DNS.
Most clients run fake-ip mode: DNS queries get an immediate synthetic answer (commonly 198.18.0.0/16), and rule matching happens by hostname once the connection starts. For public domains that is elegant. For LAN devices it is fatal — the synthetic address never reaches the device, because there is no public domain behind it to resolve later.
Check it in one command:
nslookup nas.lan # Windows
dig nas.lan # macOS / Linux
198.18.x.x back means fake-ip is hijacking. The real device address (e.g. 192.168.1.20) means you are in Case A instead.
The fix lives in the DNS block, not the rules:
dns:
enhanced-mode: fake-ip
fake-ip-filter:
- '*.lan'
- '*.local'
- '*.home.arpa'
- '*.arpa'
- '+.corp.example.com'
Two traps worth knowing. First, fake-ip-filter only matters while enhanced-mode is actually fake-ip; if DNS is on redir-host, editing the filter does nothing and you will conclude the filter is broken. Second, whitelisting the hostname with DOMAIN-SUFFIX does not substitute for the filter. The hostname resolves to a synthetic IP first, the rule matches that IP, and the whitelist never fires. Both changes are required.
Case C: TUN rewrote the routing table
Everything works under system proxy. Enable TUN and the printer, the NAS and the gateway all disappear at once.
This is not a regression in your rules — it is a different mechanism. System proxy only influences applications that respect the system proxy setting. TUN creates a virtual interface and takes over routing for the entire machine, private ranges included.
Verify in this order, changing one thing per round:
-
ip routeorroute print— does the default route point at the virtual interface? -
pingthe gateway — failing here means routing was hijacked before rules evaluated - Disable TUN and ping again — recovery confirms TUN as the cause rather than a driver fault
Beyond the DIRECT rules above, most clients expose a "bypass LAN" toggle somewhere under TUN or routing settings. That toggle does not edit rules; it decides whether the virtual interface writes private ranges into its own routing table. Both have to be right, and turning one on while the other is off produces exactly the "some LAN things work" confusion that wastes an afternoon.
Verify, don't eyeball
After editing, resist the urge to just reload a page. Walk the four steps:
-
ping <gateway>succeeds → routing is intact - NAS opens by IP → rules are matching
-
nslookup nas.lanreturns192.168.x.x→ fake-ip filter is active -
http://nas.lanopens → end to end
Step 2 passing while 3 fails localises the fault to DNS. Step 1 failing means the rules never ran. Working in this order is faster than toggling TUN and guessing.
Two adjacent problems that look similar but aren't: LAN is fine and public access broke (that's a TUN baseline problem), and LAN is fine but only one app fails (that's an app bypassing the proxy). Keeping them separate keeps the diagnosis short.
I keep the longer version, with the full command set for Windows, macOS and Linux, plus the corporate-intranet cases, at Clash can't reach your LAN: router, NAS and internal domains. If you are setting the client up from scratch, the download centre lists current versions and file sizes so you don't install an architecture that crashes on launch.
Top comments (0)