Sometimes a sensor loses connectivity and is unable to reach the gateway. A gateway unreachable error is identified with the following procedure:
ARP cache is flushed
ICMP ping is executed to the gateway
ARP cache is examined for an entry pointing to the gateway.
The above procedure is effective even if ICMP is blocked.
We use arping tool for gateway testing, we send max. 20 ARP request packets if we don't receive a response back from the default gateway. However, we stop sending ARP requests as soon as we receive a response from the default gateway.
arping -i wlan0 -w 20 -W 1 -c 20 -C 1 <gateway ip>
-i interface : Use the specified interface.
wlan0 : wireless interface
eth0: ethernet interface
-w sec : Specify a timeout before ping exits regardless of how many packets have been sent or received.
-W sec : Time to wait between pings.
-c count : Only send count requests.
-C count : Only wait for this many replies, regardless of -c and -w.
For troubleshooting gateway unreachable issues further, you can refer to this help article here: https://help.capenetworks.com/en/articles/7967857-user-experience-insight-troubleshooting-guide