# The DietPi Wi-Fi monitor is incompatible with client isolation

**URL:** <https://dietpi.com/forum/t/the-dietpi-wi-fi-monitor-is-incompatible-with-client-isolation/25604>\
**Category:** General Discussion\
**Tags:** wifi\
**Created:** [26 November 2026 18:43 UTC](https://dietpi.com/forum/t/the-dietpi-wi-fi-monitor-is-incompatible-with-client-isolation/25604 "2026-11-26T18:43:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![da1k](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/dc4da7/32.png) [@da1k](https://dietpi.com/forum/u/da1k)\
**Post date:** [26 November 2026 18:43 UTC](https://dietpi.com/forum/t/the-dietpi-wi-fi-monitor-is-incompatible-with-client-isolation/25604/1 "2026-11-26T18:43:15Z")

</div>

I put Orange Pi Zero 3 with DietPi in wireless network with client isolations. I found that every ~12-15 seconds Pi is disconnecting and reconnecting. I tried different things and lastly with AI chat help I found that “problem” is with Wi-Fi monitor script. It does the following:

1. Waits 10 seconds.
2. Gets the default gateway.
3. Tries to ping it.
4. Routers firewall blocks the ping.
5. DietPi incorrectly concludes Wi-Fi has failed.
6. Executes ifdown and ifup.
7. DHCP is released, Wi-Fi disconnects, and everything reconnects.
8. Repeats.

Solution is to change dietpi-wifi-monitor.sh from testing IP connectivity to testing actual Wi-Fi association. So I edited in script:

> elif ! GATEWAY=$(G\_GET\_NET -i “$ADAPTER” gateway) || ! ping -nqc 1 -w 10 -I “$ADAPTER” “$GATEWAY” &\> /dev/null

to

> elif ! iw dev “$ADAPTER” link | grep -q '^Connected to ’

and it’s done. Works perfect 🙂

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [26 November 2026 20:47 UTC](https://dietpi.com/forum/t/the-dietpi-wi-fi-monitor-is-incompatible-with-client-isolation/25604/2 "2026-11-26T20:47:57Z")

</div>

Hi,

many thanks for the report and for tracking it down to the WiFi monitor. Your analysis is right: the monitor pings the default gateway every 10 seconds and restarts the interface (`ifdown`/`ifup`, including a DHCP release) when there is no reply. If the router does not answer pings, this ends in a reconnect loop.

Just a small note on the title: client/AP isolation normally only blocks traffic between WiFi clients, not traffic to the gateway itself. I checked this with AP isolation enabled on a test hotspot (hostapd): the other client was no longer reachable, but the gateway still answered pings and ARP requests. In your case the router (or its firewall) seems to drop ICMP echo requests to itself, which is common on guest networks. The result is the same, of course.

About your fix: `iw dev "$ADAPTER" link` only checks whether the adapter is still associated with the access point. If only the association is lost, wpa\_supplicant reconnects on its own anyway (in my tests a few seconds after the access point was back, also after a 2-minute outage). But the adapter can still show as connected while no traffic gets through anymore. With the `iw` check those cases would go undetected. I tested that: with an access point that answers neither IP nor ARP, `iw` still reports “Connected to …”, so the monitor would never reconnect.

A gateway that drops pings still has to answer ARP requests, otherwise nothing would work on that network. So I tested a fallback: if the ping fails, the cached ARP entry of the gateway is removed and resolved again. If the gateway answers that ARP request, the connection is considered fine. Test results against a test hotspot that drops pings, with a Raspberry Pi 5 (onboard WiFi) and a NanoPi R5S (RTL8188EUS USB stick) as clients:

| Case | Current monitor | With ARP fallback |
| --- | --- | --- |
| Gateway drops pings (90 s) | 3 reconnects | 0 reconnects |
| Gateway completely unreachable but still associated (60 s) | reconnects | reconnects |
| Access point switched off for 30 s (RPi 5 only) | – | detected, reconnected |
| Normal operation | 0 reconnects | 0 reconnects |

If you like to test it on your Orange Pi Zero 3, please restore the original line in /var/lib/dietpi/services/dietpi-wifi-monitor.sh first. Then add this function below the line `GATEWAY=` (before the `Main` section):

```auto
	# Gateway reachability: ICMP echo, with ARP fallback for gateways which do not answer pings
	Check_Gateway()
	{
		ping -nqc 1 -w 10 -I "$ADAPTER" "$GATEWAY" &> /dev/null && return 0
		# Force a fresh ARP resolution, as a cached entry does not prove the gateway is still there
		ip neigh del "$GATEWAY" dev "$ADAPTER" 2> /dev/null
		ping -nqc 1 -w 3 -I "$ADAPTER" "$GATEWAY" &> /dev/null
		[[$(ip neigh show "$GATEWAY" dev "$ADAPTER" nud reachable)]]
	}

```

and change the check line to:

```auto
		elif ! GATEWAY=$(G_GET_NET -i "$ADAPTER" gateway) || ! Check_Gateway

```

Then restart the service:

```auto
systemctl restart dietpi-wifi-monitor

```

If the monitor did reconnect before, this restart can drop the WiFi connection, until the restarted monitor detects it and reconnects (in my tests the connection was gone for 16-20 seconds). So better do it from a local console or via Ethernet, if possible.

Note that a manual change of this file will be overwritten by a future DietPi update. I could not test it on an Orange Pi Zero 3 or on a network like yours. Could you let us know whether it works for you as well?
