5

So I may have a stupid question that mainly comes from me getting weird results to say the least while experimenting.

I'm a bit unsure how do ARP requests work.

For example how can I arp my entire local net 192.168.0.1/24. Must I send an arp request to each individual ip or does the arp request get sent to the router or switch who in turn replies to which host is up and its corresponding ip and MAC address.

I'm trying to do this programmatically using python, with a module called scapy... I was watching a tutorial and they arpinged the entire local network by giving their local ip address and mask to scapy.all.arping if I'm not mistaken

1
  • There is no such a stupid question. Oct 21, 2021 at 23:31

1 Answer 1

6

Must I send an arp request to each individual ip

Yes.

or does the arp request get sent to the router

An ARP request is never forwarded by a router (apart from very exotic cases).

or switch

A switch does forward ARP requests just like any other broadcasts (to all ports but the one the broadcast was received on).

who in turn replies to which host is up and its corresponding ip and MAC address.

No - the one replying is the host itself.

An ARP request is sent as a broadcast (=destination MAC address FF:FF:FF:FF:FF:FF) to the whole layer-2 network (connected by switches, hubs). All hosts receive the request but all but the one asked for simply ignore/drop it. The one host with the requested IP address replies to the request to the source host, informing it of the associated MAC address.

ARP is defined in RFC 826.

2
  • 2
    proxy-arp doesn't forward the request either. It answers with it's own MAC for anything it can reach. (it may make an arp request itself to find the target)
    – Ricky
    Jun 15, 2019 at 23:58
  • @RickyBeam That is the usual case, yes. I had a very exotic case in the back of my mind where proxy ARP was combined with virtual bridging. Probably better to leave that out here, thx.
    – Zac67
    Jun 16, 2019 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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