← Writing
DevOps

Building a Stable macOS Remote Development Infrastructure with Tailscale, ShadowRocket, SMB, SSH, and Screen Sharing

Publication Date: 3 June 2026
Latest Update Date: 9 June 2026
Author: Ailven LIU 刘翔
All Rights Reserved

Overview

This memo targets a setup with:

Target state:

Single principle:

Tailscale should own private networking, and ShadowRocket should own internet acceleration.

1. Architecture and final recommendation

The topology below is the stable end state:

                          Internet
                             │
                   ┌─────────┴─────────┐
                   │                   │
                   │     Tailscale     │
                   │   Overlay Mesh    │
                   │                   │
                   └─────────┬─────────┘
                             │
               ┌─────────────┴─────────────┐
               │                           │
          MacBook Air                 Mac Mini (NAS)
          Client Node                 Development Host
               │                           │
          ShadowRocket               ShadowRocket
         Full-Network Client        Restricted-Network Client
               │                           │
          SSH / SMB / VNC            SSH / SMB / VNC
            via LAN or                 via LAN or
             Tailnet                    Tailnet

This yields four concrete rules:

  1. Both machines join the same Tailnet.
  2. Both machines use ShadowRocket with a local proxy listener at 127.0.0.1:1082.
  3. The MacBook Air enables full-network capture, while the Mac Mini NAS keeps private networking outside the tunnel.
  4. LAN ranges, Tailscale ranges, loopback ranges, and internal domains must bypass proxy handling explicitly.

Typical failure symptoms when the boundary is broken:

2. Why the two machines use different tunnel scope

The stable design is not ‘proxy on one machine, no proxy on the other.’ It is ‘different tunnel scope for different roles.’

2.1 MacBook Air: primary device

The MacBook Air is the primary interactive client. It:

For that role, ShadowRocket can capture all non-excluded traffic:

2.2 Mac Mini: NAS and remote host

The Mac Mini must remain continuously reachable as:

Because it is a service host, the safer configuration is to keep private addressing outside full-network capture:

Practical rule:

3. Configuration that actually works

3.1 Mac Mini: Tailscale first, proxy second

Recommended startup order:

1. Start Tailscale
2. Wait until the Tailnet is established
3. Start ShadowRocket

3.2 Mac Mini: ShadowRocket settings

Reusable ShadowRocket config file:

Recommended ShadowRocket settings on the Mac Mini NAS:

Always On: ON
On Demand: ON
Enforce Route: OFF
Compatibility: ON
Proxy Type: HTTP
Proxy Address: 127.0.0.1
Proxy Port: 1082
Include All Networks: OFF
Include Local Networks: N/A
Include APNs: N/A
Include Cellular Services: N/A
Enable IPv6: OFF
Prefer IPv6: OFF
Private IP Answer: OFF
Fallback DNS: 1.1.1.1, 8.8.8.8, 8.8.4.4, 100.100.100.100, 192.168.123.1

Key point:

Include All Networks: OFF

3.3 Private ranges that must be excluded

These entries should be repeated in:

Recommended list:

10.0.0.0/8
100.64.0.0/10
169.254.0.0/16
172.16.0.0/12
224.0.0.0/4
127.0.0.0/8
192.168.0.0/16
*.local
localhost
*.tailnet
*.tail.net
*m-team.cc

Most important:

100.64.0.0/10

Reason: Tailscale CGNAT range.

If a default exclusion list already exists, keep it and append the entries above.

3.4 macOS network proxy and bypass list

On both the Mac Mini and the MacBook Air, the active network service should use:

Auto Proxy Discovery: OFF
Automatic Proxy Configuration: OFF
Web Proxy (HTTP): OFF
Secure Web Proxy (HTTPS): OFF
SOCKS Proxy: 127.0.0.1:1082
Exclude simple hostnames: ON

The bypass list in System Settings should match the exclusion list in Section 3.3.

Bypass list

localhost
*.local

192.168.0.0/16
192.168.123.0/24
172.16.0.0/12
100.64.0.0/10
10.0.0.0/8
127.0.0.0/8
*.local
*.m-team.cc

Optionally:

*.ts.net

for Tailnet hostnames.

3.5 MacBook Air: ShadowRocket settings

Recommended ShadowRocket settings on the MacBook Air primary device:

Always On: ON
On Demand: ON
Enforce Route: OFF
Compatibility: ON
Proxy Type: HTTP
Proxy Address: 127.0.0.1
Proxy Port: 1082
Include All Networks: ON
Include Local Networks: OFF
Include APNs: ON
Include Cellular Services: ON
Enable IPv6: OFF
Prefer IPv6: OFF
Private IP Answer: OFF
Fallback DNS: 1.1.1.1, 8.8.8.8, 8.8.4.4, 100.100.100.100, 192.168.123.1

This keeps the MacBook Air convenient for daily outbound traffic while preserving direct access to LAN and Tailnet destinations through the shared exclusion set.

3.6 Copy-and-paste configuration reference

The following block preserves the current working configuration exactly as recorded:

MacMini as NAS: 

    -> ShadowRockets:     
    -> Settings --> Tunnel --> On Demand --> Always On            : ON      
    -> Settings --> Tunnel --> On Demand --> On Demand            : ON      
    -> Settings --> Tunnel --> Tunnel --> Enforce Routes          : OFF    
    -> Settings --> Tunnel --> Tunnel --> Include All Networks    : OFF     
    -> Settings --> Tunnel --> Tunnel --> Include Local Networks  : N/A (When Include All Networks is OFF, it is inapplicable)    
    -> Settings --> Tunnel --> Tunnel --> Include APNs            : N/A (When Include All Networks is OFF, it is inapplicable)     
    -> Settings --> Tunnel --> Tunnel --> Include Cellular Services : N/A (When Include All Networks is OFF, it is inapplicable)     
    -> Settings --> Tunnel --> Proxy --> Compatibility Mode       : ON      
    -> Settings --> Tunnel --> Proxy --> Proxy Type               : HTTP (Do not use TUN mode)      
    -> Settings --> Tunnel --> Proxy --> Proxy Port               : 1082
    -> Settings --> Tunnel --> Proxy --> Proxy Address            : 127.0.0.1       
    -> Config --> General --> Enable IPv6                         : OFF    
    -> Config --> General --> Prefer IPv6                         : OFF    
    -> Config --> General --> Private IP Answer                   : OFF     
    -> Config --> General --> Fallback DNS                        : 1.1.1.1, 8.8.8.8, 8.8.4.4, 100.100.100.100, 192.168.123.1     
    -> Config --> General --> Skip Proxy                          : [existed default], 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 172.16.0.0/12, 224.0.0.0/4, 127.0.0.0/8, 192.168.0.0/16, *.local, localhost, *.tailnet, *.tail.net, *m-team.cc      
    -> Config --> General --> TUN Excluded Routes                 : [existed default], 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 172.16.0.0/12, 224.0.0.0/4, 127.0.0.0/8, 192.168.0.0/16     

    -> System Settings:       
    -> Networks --> The Network connected current --> Auto Proxy Discovery          : OFF      
    -> Networks --> The Network connected current --> Automatic Proxy Configuration : OFF      
    -> Networks --> The Network connected current --> Web Proxy (HTTP)              : OFF      
    -> Networks --> The Network connected current --> Secure Web Proxy (HTTPS)      : OFF      
    -> Networks --> The Network connected current --> SOCKS Proxy                   : 127.0.0.1:1082      
    -> Networks --> The Network connected current --> Exclude simple hostnames      : ON     
    -> Networks --> The Network connected current --> Bypass proxy settings for these hosts and domains : 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 172.16.0.0/12, 224.0.0.0/4, 127.0.0.0/8, 192.168.0.0/16, *.local, localhost, *.tailnet, *.tail.net, *m-team.cc     

MacBookAir as primary device:      

    -> ShadowRockets:     
    -> Settings --> Tunnel --> On Demand --> Always On            : ON      
    -> Settings --> Tunnel --> On Demand --> On Demand            : ON      
    -> Settings --> Tunnel --> Tunnel --> Enforce Routes          : OFF    
    -> Settings --> Tunnel --> Tunnel --> Include All Networks    : ON     
    -> Settings --> Tunnel --> Tunnel --> Include Local Networks  : OFF     
    -> Settings --> Tunnel --> Tunnel --> Include APNs            : ON     
    -> Settings --> Tunnel --> Tunnel --> Include Cellular Services : ON     
    -> Settings --> Tunnel --> Proxy --> Compatibility Mode       : ON      
    -> Settings --> Tunnel --> Proxy --> Proxy Type               : HTTP (Do not use TUN mode)      
    -> Settings --> Tunnel --> Proxy --> Proxy Port               : 1082
    -> Settings --> Tunnel --> Proxy --> Proxy Address            : 127.0.0.1       
    -> Config --> General --> Enable IPv6                         : OFF    
    -> Config --> General --> Prefer IPv6                         : OFF    
    -> Config --> General --> Private IP Answer                   : OFF     
    -> Config --> General --> Fallback DNS                        : 1.1.1.1, 8.8.8.8, 8.8.4.4, 100.100.100.100, 192.168.123.1     
    -> Config --> General --> Skip Proxy                          : [existed default], 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 172.16.0.0/12, 224.0.0.0/4, 127.0.0.0/8, 192.168.0.0/16, *.local, localhost, *.tailnet, *.tail.net, *m-team.cc      
    -> Config --> General --> TUN Excluded Routes                 : [existed default], 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 172.16.0.0/12, 224.0.0.0/4, 127.0.0.0/8, 192.168.0.0/16     

    -> System Settings:       
    -> Networks --> The Network connected current --> Auto Proxy Discovery          : OFF      
    -> Networks --> The Network connected current --> Automatic Proxy Configuration : OFF      
    -> Networks --> The Network connected current --> Web Proxy (HTTP)              : OFF      
    -> Networks --> The Network connected current --> Secure Web Proxy (HTTPS)      : OFF      
    -> Networks --> The Network connected current --> SOCKS Proxy                   : 127.0.0.1:1082      
    -> Networks --> The Network connected current --> Exclude simple hostnames      : ON     
    -> Networks --> The Network connected current --> Bypass proxy settings for these hosts and domains : 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 172.16.0.0/12, 224.0.0.0/4, 127.0.0.0/8, 192.168.0.0/16, *.local, localhost, *.tailnet, *.tail.net, *m-team.cc

3.7 An alternative MacBook Air setup: TUN mode

This is the alternative recorded for the MacBook Air. It differs from 3.5 in using TUN capture rather than the system SOCKS proxy, and in leaving Include Local Networks on.

Tailscale

Enabled

ShadowRocket

A TUN-based client configuration is acceptable.

Include All Networks: ON
Include Local Networks: ON

works correctly when the remote Mac Mini follows the server-side configuration described above.

No system SOCKS proxy configuration is required.

4. Verification and fast diagnosis

4.1 First verify Tailscale itself

Run:

tailscale status
tailscale ping <mac-mini-tailnet-name>
ping <mac-mini-tailnet-name>

If tailscale status is healthy but tailscale ping is unstable, inspect 100.64.0.0/10 exclusions first.

4.2 Then verify local resolution and route choice

Run:

scutil --dns
route -n get <mac-mini-lan-ip>
route -n get <mac-mini-tailnet-ip>
netstat -rn | grep 100.64
ifconfig | grep -A3 utun

4.3 Verify SSH, SMB, and Screen Sharing separately

SSH:

ssh <mac-mini-lan-ip>
ssh <mac-mini-tailnet-name>
nc -vz <mac-mini-lan-ip> 22
nc -vz <mac-mini-tailnet-ip> 22

SMB and Screen Sharing:

smb://<mac-mini-lan-ip>
smb://<mac-mini-tailnet-name>
vnc://<mac-mini-lan-ip>
vnc://<mac-mini-tailnet-name>

4.4 Verify that internet acceleration still works

Run:

curl -I https://github.com
curl -I https://pypi.org
curl -I https://huggingface.co

4.5 End-to-end checklist

Check Command Expected
LAN connectivity ping 192.168.123.20 0% packet loss
SSH ssh mac_local Successful login
SMB Finder ⌘+K, then smb://192.168.123.20 Successful authentication
Screen Sharing open vnc://192.168.123.20 Session established
Tailnet connectivity ping mac-mini-nas.tailxxxx.ts.net Successful response

5. ShadowRocket and Tailscale troubleshooting commands

5.1 Tailscale-focused checks

tailscale status
tailscale ip -4
tailscale ping <peer>
tailscale netcheck

5.2 Route and interface checks

route -n get <peer-tailnet-ip>
route -n get <peer-lan-ip>
netstat -rn
ifconfig

5.3 DNS checks

scutil --dns
dscacheutil -q host -a name <peer-tailnet-name>
ping <peer-tailnet-name>

5.4 Service port checks

nc -vz <peer-lan-ip> 22
nc -vz <peer-tailnet-ip> 22
nc -vz <peer-lan-ip> 5900
nc -vz <peer-tailnet-ip> 5900

This separates path failure from service failure.

5.5 Fault mapping

6. SMB, Bonjour, and Finder fault isolation

When SMB appears unstable on macOS, separate the problem into three independent layers:

Finder UI
    │
Bonjour / DNS-SD
    │
SMB Transport

Many troubleshooting attempts fail because symptoms from different layers are mixed together.

6.1 Verify SMB independently of Finder

Check active SMB mounts:

mount | grep smb

Expected:

... on /Volumes/<share>

If mounted volumes still exist, SMB remains operational even if Finder no longer displays them.

Inspect SMB session state:

smbutil statshares -a

Pay particular attention to:

SESSION_RECONNECT_COUNT
SESSION_RECONNECT_TIME

A reconnect event indicates a transport interruption but does not necessarily indicate a persistent SMB failure.

6.2 Verify Bonjour independently of SMB

Check SMB service discovery:

dns-sd -B _smb._tcp

Healthy output:

Mac mini (NAS)
MacBook Air

If Bonjour discovery works but Finder does not display the NAS, the problem is no longer in the networking layer.

6.3 Verify DNS-SD infrastructure

Check DNS-SD socket state:

stat /var/run/mDNSResponder

Expected:

srw-rw-rw- ... /var/run/mDNSResponder

A missing socket may correlate with:

DNSServiceBrowse failed -65563 (Service Not Running)

and simultaneously cause:

Additional verification:

ps aux | grep mDNSResponder
sudo lsof -nP -p $(pgrep -x mDNSResponder)

Healthy output should include:

UDP *:5353
/var/run/mDNSResponder

6.4 Separate Finder problems from network problems

Verify mounted shares:

ls -la /Volumes

If a share exists under:

/Volumes/NAS

but does not appear in Finder Sidebar, the SMB connection is already established.

Restart Finder:

killall Finder

If the mounted share immediately reappears in Sidebar after Finder restarts, the problem is a Finder UI state issue rather than an SMB issue.

6.5 Fault mapping

Finder sidebar missing NAS

Symptoms:

Finder Sidebar missing NAS
mount shows active SMB volumes
dns-sd works

Likely cause:

Finder Sidebar cache/state inconsistency

Recommended action:

killall Finder

Finder network browser missing NAS

Symptoms:

dns-sd -B _smb._tcp
DNSServiceBrowse failed -65563 (Service Not Running)

Likely cause:

Bonjour / DNS-SD failure

Recommended investigation:

stat /var/run/mDNSResponder
ps aux | grep mDNSResponder

SMB failure

Symptoms:

No active SMB mounts
Cannot mount via smb://<ip>
Infuse SMB access also fails

Likely cause:

SMB transport or network path failure

This should be investigated separately from Bonjour and Finder.

6.6 The lesson

Do not treat:

Finder cannot see NAS

as equivalent to:

SMB is broken

Always verify:

SMB
Bonjour
Finder

independently before making configuration changes.

7. Reusing the SOCKS endpoint from development tools

The local SOCKS endpoint:

127.0.0.1:1082

can be reused by:

Example:

export ALL_PROXY=socks5h://127.0.0.1:1082

Git:

git config --global http.proxy socks5://127.0.0.1:1082
git config --global https.proxy socks5://127.0.0.1:1082

8. Conclusion

Recommended model:

This is easier to reason about, easier to debug, and materially more stable in daily use.

The architecture provides stable LAN and Tailnet communication, reliable SSH, SMB and Screen Sharing services, accelerated access to external development resources, and minimal interaction between Tailscale and the proxy infrastructure.