claude-code - 💡(How to fix) Fix [BUG] Desktop app blocks all LAN/private IP network access (regression) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46503Fetched 2026-04-11 06:18:34
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×6commented ×1

Error Message

Error Messages/Logs

  1. Observe: "No route to host" error

Code Example

$ ssh -o ConnectTimeout=5 alexchachkov@192.168.0.27 "echo hello"
ssh: connect to host 192.168.0.27 port 22: No route to host

$ ping -c 1 192.168.0.27
ping: sendto: No route to host
PING 192.168.0.27 (192.168.0.27): 56 data bytes
--- 192.168.0.27 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss

$ ping -c 1 192.168.0.1  # gateway WORKS from sandbox
PING 192.168.0.1 (192.168.0.1): 56 data bytes
64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=7.309 ms
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The Claude Code desktop app (Electron) blocks all outbound TCP connections to LAN/private IP ranges (192.168.x.x). SSH, ping, and nc to any local network device all fail with "No route to host". This is a regression — local SSH to a Mac Studio on the same subnet worked as recently as March 26, 2026.

The same SSH command works perfectly from a regular Terminal on the same machine. Only the desktop app's Bash tool is affected.

Key findings from debugging:

  • Both machines are on the same subnet (192.168.0.x), ARP resolves correctly
  • The Mac Studio can ping/reach the MacBook — but not the reverse (from Claude Code)
  • dangerouslyDisableSandbox: true on the Bash tool does NOT help
  • Adding "excludedCommands": ["ssh *"] to sandbox settings in settings.json does NOT help
  • Tailscale IPs (100.x.x.x) continue to work fine
  • Disabling Tailscale entirely does NOT fix it — confirming it's the Electron app's network restriction
  • The restriction applies to ALL LAN devices (tested multiple IPs), not just one host

What Should Happen?

The Bash tool should be able to reach LAN/private IP addresses, just as it could prior to ~March 26, 2026. SSH to machines on the local network is a core workflow for users who develop on remote local servers.

Error Messages/Logs

$ ssh -o ConnectTimeout=5 [email protected] "echo hello"
ssh: connect to host 192.168.0.27 port 22: No route to host

$ ping -c 1 192.168.0.27
ping: sendto: No route to host
PING 192.168.0.27 (192.168.0.27): 56 data bytes
--- 192.168.0.27 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss

$ ping -c 1 192.168.0.1  # gateway WORKS from sandbox
PING 192.168.0.1 (192.168.0.1): 56 data bytes
64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=7.309 ms

Steps to Reproduce

  1. Open Claude Code desktop app (Electron) on a Mac connected to a local network
  2. Have another machine on the same subnet (e.g., 192.168.0.27) with SSH enabled
  3. Run: ssh -o ConnectTimeout=5 [email protected] "echo hello"
  4. Observe: "No route to host" error
  5. Open a regular Terminal on the same Mac
  6. Run the exact same command
  7. Observe: SSH connects successfully

Also tested:

  • ping 192.168.0.27 from Claude Code Bash tool -> "No route to host"
  • nc -z -w 3 192.168.0.27 22 from Claude Code Bash tool -> fails
  • ping 192.168.0.1 (router/gateway) from Claude Code Bash tool -> WORKS
  • All of the above work from regular Terminal

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

1.1617.0 (desktop app)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

  • Claude Code version: 1.1617.0 (desktop app / Electron)
  • OS: macOS Darwin 25.3.0 (Sequoia)
  • Machine: MacBook Pro, connected via Wi-Fi to 192.168.0.x subnet
  • Target: Mac Studio on same subnet at 192.168.0.27 (SSH works from regular Terminal)
  • Last working: March 26, 2026 (confirmed via last login history on the target machine showing successful SSH sessions from this MacBook's IP via Claude Code)
  • Note: dangerouslyDisableSandbox: true and sandbox excludedCommands settings have no effect, suggesting the restriction is at the Electron app process level, not the Bash tool sandbox level.

extent analysis

TL;DR

The Electron app's network restriction is likely causing the issue, and modifying the app's configuration or code to allow outbound TCP connections to LAN/private IP ranges may resolve the problem.

Guidance

  • Investigate the Electron app's configuration and code to identify the specific restriction causing the issue, focusing on network settings and sandbox configurations.
  • Consider modifying the webPreferences settings in the Electron app's configuration to allow more permissive network access, potentially by setting sandbox: false or adjusting other related settings.
  • Test the app with different network configurations, such as connecting to a different subnet or using a different network interface, to isolate the issue.
  • Review the app's update history and changelog to identify any recent changes that may have introduced the regression, specifically around March 26, 2026.

Example

No specific code example is provided, as the issue is likely related to the Electron app's configuration and network settings, which are not explicitly stated in the issue.

Notes

The issue is specific to the Claude Code desktop app (Electron) and does not occur when using a regular Terminal on the same machine, suggesting that the problem is related to the app's configuration or code rather than a system-wide issue.

Recommendation

Apply a workaround by modifying the Electron app's configuration to allow more permissive network access, as the root cause of the issue is likely related to the app's network restriction settings.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING