I'm trying to write a simple network discovery for my linux 2.6 router.
I'm testing arping which is bult inot busybox. I can't work out why sending a single request to the direct broadcast is not enough.
root@router:# arping -h
BusyBox v1.32.1 (2021-03-26 15:21:46 CET) multi-call binary.
Usage: arping [-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP
Send ARP requests/replies
-f Quit on first ARP reply
-q Quiet
-b Keep broadcasting, don't go unicast
-D Exit with 1 if DST_IP replies
-U Unsolicited ARP mode, update your neighbors
-A ARP answer mode, update your neighbors
-c N Stop after sending N ARP requests
-w TIMEOUT Seconds to wait for ARP reply
-I IFACE Interface to use (default eth0)
-s SRC_IP Sender IP address
DST_IP Target IP address
So at this point I try:
root@router:# arping -c1 -w1 -I br1 -s 10.10.11.5 10.10.11.255
ARPING 10.10.11.255 from 10.10.11.5 br1
Sent 1 probe(s) (0 broadcast(s))
Received 0 response(s) (0 request(s), 0 broadcast(s))
What am I missing here? I would expect all the devices within the LAN to answer the arp request but it doens't seems to happen. The only alternative I'm left is to send one arping per possible IP but this is extremely memory consuming considering the small device.
So in a nutshell: how can I make a single arping command to request a full subnet to respond so that my arp table can be considered a reliable source of info when it comes to network mapping?
Thanks!