2

I am trying to broadcast an ARP query. I want to get every node's ip and mac address updated in my system via this query. So that I can type $arp and see all the nodes on my network and their corresponding physical addresses.

I have tried $ arping with no avail.

rafael@rcepeda:/var/www/html$ arping -s 192.168.1.9 -I wlan0 192.168.1.255
ARPING 192.168.1.255 from 192.168.1.9 wlan0
^CSent 37 probes (37 broadcast(s))
Received 0 response(s)

ifconfig for my interface

inet addr:192.168.1.9 Bcast:192.168.1.255 Mask:255.255.255.0

Regular broadcast ping

rafael@rcepeda:/var/www/html$ ping -b 192.168.1.255
WARNING: pinging broadcast address
PING 192.168.1.255 (192.168.1.255) 56(84) bytes of data.
^C
--- 192.168.1.255 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5040ms

100% packet loss

Is my router not letting me do this?

  • Are you the network admin? Let nmap do the work. – ott-- Jun 30 '15 at 17:26
  • Sneaking ICMP ECHO broadcasts into a network was a common method of doing a denial of service attack ( SMURF attack ) so by default most routers no longer forward or respond to them. Most systems ignore them as well. – Brian Jun 30 '15 at 17:44
  • I see, it seems like this might be impossible. How is it that network discovery tools accomplish this task quickly and without permission problems? – Rafael Jun 30 '15 at 18:29
2

Most Linux distributions ignore ICMP echo broadcasts by default (kernel parameter net.ipv4.icmp_echo_ignore_broadcasts).

As far back as I could remember, Windows does not respond to ICMP echo broadcasts either. Maybe it could be overwritten by a registry modification but I do not know offhand.

This is discussed in the RFC 1122 standards document.

I would suggest using a bash script like this:

for i in 192.168.1.{1..254} 
do
  ping -c1 $i > /dev/null || true
  arp -an $i
done
  • I ran the bash script and I get ping usage info. – Rafael Jun 30 '15 at 17:00
  • Oops, just pasted my base script without modifying it for your question. Note that it'll take a while due to ping. You could modify timeout (-W, view man ping) accordingly. – Belmin Fernandez Jun 30 '15 at 17:39
  • 1
    It works, and yeah it takes a while. A network discovery tool might be better. – Rafael Jun 30 '15 at 18:27
  • 1
    Depending on your use-case, I'd say something like nmap is infinitely better honestly. – Belmin Fernandez Jun 30 '15 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.