Files
conversation-history/2026-09-14-mac-nexxt-tailscale-art0-sharing.md

335 lines
21 KiB
Markdown

---
date: 2026-09-14
tags: [networking, tailscale, macos, art0, runbook]
status: working-temporary
---
# Mac → Nexxt Wi-Fi → art0 Tailscale exit node
## Outcome
Windows connected to the Nexxt **mandeville** Wi-Fi without installing Tailscale. After replacing the Mac's Internet Sharing PF rules, the user confirmed that https://checkip.amazonaws.com displayed **104.190.60.129**, art0's public IPv4 address. Before the change Windows displayed **72.244.163.227**, while the Mac itself already displayed art0's address.
This verifies the Windows IPv4 web request through art0. It is not a complete DNS-leak, IPv6, VPN-disconnect, reboot, or long-duration reliability test. Shared IPv6 was explicitly blocked for this test. No automatic startup or reconnection recovery was installed.
## Hardware and topology
Existing internet Wi-Fi → MacBook Pro (Tailscale using art0) → Rapoo UCA-1006 USB-C Gigabit Ethernet adapter → Ethernet cable → Nexxt WAN/LAN port → Windows on mandeville Wi-Fi.
The SSID is **mandeville** (no space). Nexxt is **Vektor3600-AC, AEFME904U1**. Its stock console does not run Tailscale; the Mac is the VPN gateway. Nexxt Internet Connection Type remains **DHCP**, not Bridge. Keep the Mac on the existing upstream internet Wi-Fi, plugged into AC power with its lid open.
| Component | Observed value |
|---|---|
| Mac Wi-Fi | en0, 192.168.1.30/24; gateway 192.168.1.1 |
| Rapoo network service | AX88179A, en8 |
| Adapter link | Active, 100 Mbps full duplex observed |
| Internet Sharing bridge | bridge100, 192.168.2.1/24, member en8 |
| Nexxt WAN lease | 192.168.2.2 |
| Tailscale interface | utun4, 100.115.106.53 |
| art0 Tailscale IP | 100.115.252.53 |
| art0 public IPv4 | 104.190.60.129 |
| art0 SSH | garfield@104.190.60.129, port 2222 |
Interface names and addresses above are session observations; recheck them after restarting or reconnecting devices.
## Mac settings
System Settings → General → Sharing → Internet Sharing:
- Share your connection from: **Wi-Fi**.
- To devices using: **AX88179A only**.
- Thunderbolt Bridge, USB 10/100/1000 LAN, and Thunderbolt Ethernet Slot 2: off.
- Internet Sharing: on.
- Tailscale: connected, exit node **art0**.
Initially the wrong three sharing outputs were enabled and AX88179A was off. This was corrected before testing.
## Why ordinary Internet Sharing bypassed Tailscale
Read-only inspection found these rules under `com.apple.internet-sharing/shared_v4`:
```pf
nat on en0 inet from 192.168.2.0/24 to any -> (en0:0) extfilter ei
pass on bridge100 all flags any keep state rtable 6
```
The sharing configuration scoped forwarded traffic to the Wi-Fi path and translated its source on en0. The Mac's own Tailscale default route did not make downstream Windows traffic use art0.
A first recursive PF inspection did not expose all nested NAT rules and reported `DIOCGETRULES: Invalid argument`. Explicit inspection of the shared_v4 and shared_v6 anchors supplied the missing rules. `No ALTQ support in kernel` appeared as a diagnostic warning, not a failure of the eventual fix.
## Temporary fix applied
A locally prepared shell script, executed by the user with Mac administrator privileges:
1. Checked the expected tunnel and bridge IPs and verified the Mac's public IP was art0.
2. Saved the original v4/v6 anchor rules under `/var/root/mac-tailscale-sharing-test/`.
3. Syntax-checked the backups and replacement rules with `pfctl -n`.
4. Replaced only the `com.apple.internet-sharing/shared_v4` and `shared_v6` anchors.
5. NATed shared IPv4 traffic onto utun4 and forced inbound nonlocal shared IPv4 traffic to that tunnel with `route-to`.
6. Preserved DHCP and access to the Mac's shared gateway; clamped TCP MSS to 1240 for the tunnel's 1280 MTU.
7. Blocked inbound shared IPv6 and cleared states sourced from 192.168.2.0/24 so clients used the new rules.
Applied command:
```sh
sudo /bin/sh /tmp/mac-tailscale-check/test-sharing.sh
```
### Verification
After applying the script, Windows remained connected to **mandeville**, and reopening the IP-check page returned **104.190.60.129**. The saved PF output confirms the installed rules:
```text
No ALTQ support in kernel
ALTQ related functions disabled
nat on utun4 inet from 192.168.2.0/24 to any -> (utun4) round-robin
No ALTQ support in kernel
ALTQ related functions disabled
scrub on bridge100 all no-df max-mss 1240 fragment reassemble
pass in quick on bridge100 inet proto udp from any port = 68 to any port = 67 keep state
pass in quick on bridge100 inet from 192.168.2.0/24 to 192.168.2.1 flags S/SA keep state
pass in quick on bridge100 route-to utun4 inet from 192.168.2.0/24 to ! 192.168.2.0/24 flags S/SA keep state
block drop in quick on bridge100 inet6 all
pass out on bridge100 inet all flags S/SA keep state
pass out on utun4 inet from 100.115.106.53 to any flags S/SA keep state
No ALTQ support in kernel
ALTQ related functions disabled
block drop in quick on bridge100 inet6 all
```
## Rollback and recovery
Restore the pre-test sharing rules:
```sh
sudo /bin/sh /tmp/mac-tailscale-check/test-sharing.sh undo
```
This restores regular sharing, which previously used the ISP address rather than art0. The rollback clears shared IPv4 states, briefly interrupting downstream connections.
**Do not blindly rerun the apply command:** the original script deliberately refuses if `/var/root/mac-tailscale-sharing-test` already exists. Rebooting, toggling Internet Sharing, or reconnecting Tailscale may replace the rules or change the tunnel interface. Reinspect live interfaces and rules, retain the original backups, and prepare a fresh application against the actual state. Do not delete the backup merely to bypass that guard.
The `/tmp` script may disappear after cleanup/reboot. Its exact contents are preserved below; recover it to a local file before using the rollback if necessary. The backup directory is root-only. No persistent system configuration or launch daemon was created by this Mac fix, and no full disconnect kill-switch guarantee was tested.
Useful checks:
```sh
networksetup -listallhardwareports
ifconfig bridge100
ifconfig utun4
/Applications/Tailscale.app/Contents/MacOS/Tailscale status
curl -4 --max-time 15 https://checkip.amazonaws.com
sudo pfctl -a com.apple.internet-sharing/shared_v4 -sn
sudo pfctl -a com.apple.internet-sharing/shared_v4 -sr
sudo pfctl -a com.apple.internet-sharing/shared_v6 -sr
```
Always check the public IP from **Windows as well as the Mac**. A correct Mac IP alone was insufficient.
## Earlier art0 work during the same session
At the user's request, the security-watchdog and its daily-report cron entries were suspended through Kimi over SSH, with crontab backup `/home/garfield/crontab-backup-20260914-124558.txt`. Watchdog suspension alone did not fix exit-node traffic.
Investigation found Calico's legacy forwarding rule cleared bits overlapping Tailscale's packet mark, preventing Tailscale's marked NAT rule from matching. A narrow live IPv4 NAT rule restored exit-node service:
```sh
iptables -t nat -I POSTROUTING 1 -s 100.64.0.0/10 -o enp2s0 -m comment --comment tailscale-exit-calico-snat -j MASQUERADE
```
An existence check was used before insertion. Prior rules were backed up to `/root/tailscale-exit-backup-20260914/iptables-before.v4`. The user confirmed phone exit-node service recovered. A later persistence attempt was interrupted, so server-side reboot persistence was **not verified**. The watchdog remained suspended as last confirmed; this is separate from the Mac sharing fix. The temporary monitoring automation was paused after recovery.
## Options explored
- Stock Nexxt, Tenda AC6, Mercusys Halo H32G/MW306R, and TP-Link TL-WR844N were not native Tailscale gateway solutions.
- Normal phone hotspot sharing did not establish inheritance of the phone's Tailscale exit node. Samsung USB tethering exposed RNDIS to the Mac without a usable network interface.
- An old Lenovo laptop stalled during BIOS startup and was abandoned.
- The Rapoo USB-C Ethernet adapter supplied the missing physical downstream link; an HDMI adapter would not.
- A GL.iNet Slate Plus GL-A1300 or Beryl AX GL-MT3000 remains a dedicated-router alternative if an always-on Mac is unsuitable.
## References
- [Apple Internet Sharing](https://support.apple.com/guide/mac-help/mchlp1540/mac)
- [Tailscale macOS Internet Sharing issue](https://github.com/tailscale/tailscale/issues/15730)
- [GL.iNet Tailscale compatibility and exit-node setup](https://docs.gl-inet.com/router/en/4/interface_guide/tailscale/)
## Exact script used (archival copy)
This is the tested session-specific script, not a general-purpose installer. Review interface/IP preconditions before future use.
```sh
#!/bin/sh
set -eu
PATH=/usr/bin:/bin:/usr/sbin:/sbin
BASE=/var/root/mac-tailscale-sharing-test
A=com.apple.internet-sharing
if [ "$(id -u)" != 0 ]; then echo 'Run with sudo.'; exit 1; fi
restore() {
pfctl -a "$A/shared_v4" -f "$BASE/original-v4.conf"
pfctl -a "$A/shared_v6" -f "$BASE/original-v6.conf"
pfctl -k 192.168.2.0/24 || true
}
if [ "${1:-}" = undo ]; then restore; echo 'Original sharing rules restored.'; exit; fi
if [ -e "$BASE" ]; then echo 'A test backup already exists. Stop and return to Codex.'; exit 1; fi
ifconfig utun4 | grep -q 'inet 100.115.106.53 ' || { echo 'Tailscale interface changed; stop.'; exit 1; }
ifconfig bridge100 | grep -q 'inet 192.168.2.1 ' || { echo 'Sharing network changed; stop.'; exit 1; }
[ "$(curl -4 -fsS --max-time 15 https://checkip.amazonaws.com)" = 104.190.60.129 ] || { echo 'Mac is not exiting through art0; stop.'; exit 1; }
umask 077
mkdir "$BASE"
for V in v4 v6; do
pfctl -a "$A/shared_$V" -sr > "$BASE/filter-$V.txt"
pfctl -a "$A/shared_$V" -sn > "$BASE/nat-$V.txt"
{ grep '^scrub' "$BASE/filter-$V.txt" || true; cat "$BASE/nat-$V.txt"; grep -v '^scrub' "$BASE/filter-$V.txt" || true; } > "$BASE/original-$V.conf"
pfctl -n -a "$A/shared_$V" -f "$BASE/original-$V.conf"
done
cat > "$BASE/test-v4.conf" <<'RULES'
scrub on bridge100 all no-df max-mss 1240 fragment reassemble
nat on utun4 inet from 192.168.2.0/24 to any -> (utun4)
pass in quick on bridge100 inet proto udp from any port 68 to any port 67 keep state
pass in quick on bridge100 inet from 192.168.2.0/24 to 192.168.2.1 keep state
pass in quick on bridge100 route-to utun4 inet from 192.168.2.0/24 to ! 192.168.2.0/24 keep state
block drop in quick on bridge100 inet6 all
pass out on bridge100 inet all keep state
pass out on utun4 inet from 100.115.106.53 to any keep state
RULES
cat > "$BASE/test-v6.conf" <<'RULES'
block drop in quick on bridge100 inet6 all
RULES
pfctl -n -a "$A/shared_v4" -f "$BASE/test-v4.conf"
pfctl -n -a "$A/shared_v6" -f "$BASE/test-v6.conf"
trap 'restore' HUP INT TERM
if ! pfctl -a "$A/shared_v6" -f "$BASE/test-v6.conf"; then restore; exit 1; fi
if ! pfctl -a "$A/shared_v4" -f "$BASE/test-v4.conf"; then restore; exit 1; fi
pfctl -k 192.168.2.0/24 || true
{
pfctl -a "$A/shared_v4" -sn
pfctl -a "$A/shared_v4" -sr
pfctl -a "$A/shared_v6" -sr
} > /tmp/mac-tailscale-check/test-result.txt 2>&1
chmod 644 /tmp/mac-tailscale-check/test-result.txt
echo 'Temporary sharing test applied. Reopen the IP check on Windows.'
echo 'Undo: sudo /bin/sh /tmp/mac-tailscale-check/test-sharing.sh undo'
```
## Follow-up — 2026-09-15: watchdog preparation and art0 persistence
New watchdog bans now target only TCP/2222 (the actual SSH listener), preserving Tailscale UDP connectivity. Tailnet exclusions remain, and ban detection ignores unrelated ports/protocols. Existing broad bans were retained. **Both watchdog cron entries remain suspended; the watchdog was not run.**
The art0 SNAT rule is now in `/etc/iptables/rules.v4`. A root-owned idempotent helper `/usr/local/sbin/tailscale-exit-snat` is installed, with an enabled/active `tailscale-exit-snat.service` and a `tailscaled.service` ExecStartPost hook for future daemon starts. Source files and rollback notes are in `/home/garfield/fetcherpay-infra/systemd/README-tailscale-exit-snat.md`.
Validation passed: shell syntax, existing watchdog regression, mocked SSH-only/tailnet-exclusion tests, saved-rule parse test, systemd verification, and repeated helper execution without duplicate live rules. Mac public IPv4 remained **104.190.60.129**. No actual reboot or Tailscale restart was performed. The Mac PF sharing configuration remains temporary.
Backups: `/home/garfield/security-watchdog-backup-20260915-032939/` and `/root/tailscale-snat-persistence-20260915-033030/`. Changes were made in the server working copies; no git commit or push was performed.
## Recovery — 2026-09-15: coralsprings after Mac restart
### Current outcome and verification limit
The Nexxt Wi-Fi was renamed from **mandeville** to **coralsprings**. After recovery, the user reported that whatsmyip loaded on the phone and showed **Florida**. This confirms web connectivity in that phone test. The phone's exact public IP and final mobile-data/Tailscale toggle states were not independently confirmed, so the latest phone test does not conclusively establish art0 as its exit. The Mac's public IP was independently checked as **104.190.60.129**. Earlier Windows testing had explicitly confirmed that same art0 address.
### What changed after the restart
The Mac had rebooted at approximately 02:16 on September 15. Tailscale was now **utun5**, rather than **utun4**; the earlier `/tmp` scripts and result files were gone. The Nexxt still had WAN address **192.168.2.2**, reached through **bridge100 / en8**, with the Mac sharing gateway **192.168.2.1**.
### Recovery actions in order
1. Recovered the exact working script from this note's archival copy, changed its tunnel references from utun4 to utun5, and saved it outside `/tmp` as `/Users/garfieldheron/NetworkTools/restore-coralsprings.sh`. Used a separate root backup directory, `/var/root/mac-tailscale-sharing-recovery-20260915`, preserving the earlier backup.
2. User ran it with sudo. Its saved output confirmed NAT and route-to rules using utun5, with shared IPv6 still blocked. This alone did not restore the phone's browsing.
3. Captured packet headers on en8 and utun5. Requests from 192.168.2.2 reached the tunnel; external replies returned and were translated back to 192.168.2.2, but were visible going back through the tunnel rather than reaching Ethernet. Local DNS requests to 192.168.2.1 received replies. This evidence isolated a return-routing problem rather than failure of the art0 outbound NAT.
4. `route -n get 192.168.2.2` selected **utun5**, and Tailscale preferences showed `ExitNodeAllowLANAccess: false`.
5. Enabled local LAN access on the Mac while retaining art0 as the exit node:
```sh
/Applications/Tailscale.app/Contents/MacOS/Tailscale set --exit-node-allow-lan-access=true
```
6. Rechecked the route. It now incorrectly selected **en0 via 192.168.1.1**, not the sharing bridge. Prepared and user executed `/Users/garfieldheron/NetworkTools/fix-coralsprings-return.sh`, which made this specific route change and cleared existing shared IPv4 states:
```sh
sudo route -n change -net 192.168.2.0/24 -interface bridge100
sudo pfctl -k 192.168.2.0/24
```
7. Verified that `route -n get 192.168.2.2` selected **bridge100** and the Nexxt answered both ping probes (about 0.6 ms). Tailscale retained LAN access enabled, and the Mac still returned **104.190.60.129** on the IP check.
8. The user initially reported continued failure, then reported that whatsmyip worked and showed Florida. A second capture was prepared but was not reported completed or analyzed before this successful browsing report.
### Future recovery checklist
- Keep Mac upstream Wi-Fi connected, Tailscale using art0, and only AX88179A selected as the Internet Sharing output. Phone/Windows clients join **coralsprings**.
- Discover the actual Tailscale utun interface; never assume utun4 or utun5 survives a restart.
- Check **Allow LAN access** is enabled in Mac Tailscale.
- Check the route to the Nexxt WAN IP. With this addressing it must use **bridge100**, not the Tailscale tunnel or the upstream Wi-Fi gateway.
- Check sharing NAT and route-to rules point to the current tunnel.
- When validating from the phone, turn phone Tailscale and mobile data off so they cannot mask the path under test. Verify the exact public IP **104.190.60.129**, not only a Florida location label or Android's connectivity warning.
- The restored script is still session-specific: its apply mode refuses to run if its backup directory already exists. Do not delete backups to defeat that guard; inspect the current state and prepare a fresh recovery if necessary.
- The Mac PF rules and explicit return route are **not automatically persistent**. No Mac launch daemon or reconnection watcher was installed. Tailscale's LAN-access preference was changed, but reboot/reconnect behavior was not tested afterward.
- The art0 SNAT persistence setup and suspended watchdog state from the earlier follow-up are separate and unchanged by this recovery.
### Local files and rollback
- Restore script: `/Users/garfieldheron/NetworkTools/restore-coralsprings.sh`
- Restore output: `/Users/garfieldheron/NetworkTools/sharing-result.txt`
- Route fix: `/Users/garfieldheron/NetworkTools/fix-coralsprings-return.sh`
- Route snapshots: `/Users/garfieldheron/NetworkTools/return-route-before.txt` and `return-route-after.txt`
- Capture helper: `/Users/garfieldheron/NetworkTools/check-coralsprings.sh`
- Diagnostic directory: `/Users/garfieldheron/NetworkTools/coralsprings-diagnostic/`
PF rollback for this recovery:
```sh
sudo /bin/sh /Users/garfieldheron/NetworkTools/restore-coralsprings.sh undo
```
This restores only the saved PF anchors. It does **not** revert the explicit bridge route or the Tailscale LAN-access preference. Reverting either can reintroduce the return-path failure; inspect current routing before any rollback.
### Archived recovery scripts
These preserve the exact recovery actions if the local copies are lost. They are not universal or automatically repeatable installers.
#### restore-coralsprings.sh
```sh
#!/bin/sh
set -eu
PATH=/usr/bin:/bin:/usr/sbin:/sbin
BASE=/var/root/mac-tailscale-sharing-recovery-20260915
A=com.apple.internet-sharing
if [ "$(id -u)" != 0 ]; then echo 'Run with sudo.'; exit 1; fi
restore() {
pfctl -a "$A/shared_v4" -f "$BASE/original-v4.conf"
pfctl -a "$A/shared_v6" -f "$BASE/original-v6.conf"
pfctl -k 192.168.2.0/24 || true
}
if [ "${1:-}" = undo ]; then restore; echo 'Original sharing rules restored.'; exit; fi
if [ -e "$BASE" ]; then echo 'A test backup already exists. Stop and return to Codex.'; exit 1; fi
ifconfig utun5 | grep -q 'inet 100.115.106.53 ' || { echo 'Tailscale interface changed; stop.'; exit 1; }
ifconfig bridge100 | grep -q 'inet 192.168.2.1 ' || { echo 'Sharing network changed; stop.'; exit 1; }
[ "$(curl -4 -fsS --max-time 15 https://checkip.amazonaws.com)" = 104.190.60.129 ] || { echo 'Mac is not exiting through art0; stop.'; exit 1; }
umask 077
mkdir "$BASE"
for V in v4 v6; do
pfctl -a "$A/shared_$V" -sr > "$BASE/filter-$V.txt"
pfctl -a "$A/shared_$V" -sn > "$BASE/nat-$V.txt"
{ grep '^scrub' "$BASE/filter-$V.txt" || true; cat "$BASE/nat-$V.txt"; grep -v '^scrub' "$BASE/filter-$V.txt" || true; } > "$BASE/original-$V.conf"
pfctl -n -a "$A/shared_$V" -f "$BASE/original-$V.conf"
done
cat > "$BASE/test-v4.conf" <<'RULES'
scrub on bridge100 all no-df max-mss 1240 fragment reassemble
nat on utun5 inet from 192.168.2.0/24 to any -> (utun5)
pass in quick on bridge100 inet proto udp from any port 68 to any port 67 keep state
pass in quick on bridge100 inet from 192.168.2.0/24 to 192.168.2.1 keep state
pass in quick on bridge100 route-to utun5 inet from 192.168.2.0/24 to ! 192.168.2.0/24 keep state
block drop in quick on bridge100 inet6 all
pass out on bridge100 inet all keep state
pass out on utun5 inet from 100.115.106.53 to any keep state
RULES
cat > "$BASE/test-v6.conf" <<'RULES'
block drop in quick on bridge100 inet6 all
RULES
pfctl -n -a "$A/shared_v4" -f "$BASE/test-v4.conf"
pfctl -n -a "$A/shared_v6" -f "$BASE/test-v6.conf"
trap 'restore' HUP INT TERM
if ! pfctl -a "$A/shared_v6" -f "$BASE/test-v6.conf"; then restore; exit 1; fi
if ! pfctl -a "$A/shared_v4" -f "$BASE/test-v4.conf"; then restore; exit 1; fi
pfctl -k 192.168.2.0/24 || true
{
pfctl -a "$A/shared_v4" -sn
pfctl -a "$A/shared_v4" -sr
pfctl -a "$A/shared_v6" -sr
} > /Users/garfieldheron/NetworkTools/sharing-result.txt 2>&1
chmod 644 /Users/garfieldheron/NetworkTools/sharing-result.txt
echo 'Sharing restored through utun5. Reopen the IP check on your phone.'
echo 'Undo: sudo /bin/sh /Users/garfieldheron/NetworkTools/restore-coralsprings.sh undo'
```
#### fix-coralsprings-return.sh
```sh
#!/bin/sh
set -eu
PATH=/usr/bin:/bin:/usr/sbin:/sbin
ifconfig bridge100 | grep -q 'inet 192.168.2.1 ' || { echo 'Sharing interface changed; stop.'; exit 1; }
route -n get 192.168.2.2 > /Users/garfieldheron/NetworkTools/return-route-before.txt
route -n change -net 192.168.2.0/24 -interface bridge100
pfctl -k 192.168.2.0/24
route -n get 192.168.2.2 > /Users/garfieldheron/NetworkTools/return-route-after.txt
chmod 644 /Users/garfieldheron/NetworkTools/return-route-before.txt /Users/garfieldheron/NetworkTools/return-route-after.txt
cat /Users/garfieldheron/NetworkTools/return-route-after.txt
```
## Dedicated watchdog runbook
See [[SquareMCP/runbooks/2026-09-15-art0-watchdog-tailscale-safety]] for the reasons, installed changes, backups, restart recommendation, and validation procedure. Watchdog and daily report were subsequently re-enabled in monitor-only mode; automatic banning is disabled. See the dedicated runbook for the superseding status.
## Windows GlobalProtect SSL fallback — 2026-09-16
See [[SquareMCP/runbooks/2026-09-16-coralsprings-globalprotect-ssl-fallback]] for the verified Windows HTTPS fix, narrow Mac PF rules, scripts, backups, and rollback. GlobalProtect SSL browsing was confirmed; startup persistence is not installed.