I am creating a simple function, which should collect MAC addresses of all devices in my network.
import scapy.all as scapy
def network_scan(ip):
arp_request = scapy.ARP(pdst=ip)
print(arp_request.summary())
network_scan("10.0.2.1/24")
This ARP request returns "ARP who has ?? says ??"
But when I try to request a MAC address of a single IP, it works good:
network_scan("10.0.2.1")
Single IP output: ARP who has 10.0.2.1 says myIP