ARP(3pm)
π ARP β the Perl page from ARP(3pm) π
okay so bestie, welcome to ARP, a Perl extension for creating ARP packets β¨ it lives in the User Contributed Perl Documentation section of the manual, page ARP(3pm), and it's genuinely one of the most fun little network toys you can hold in a Perl script π
β¨ NAME β¨
ARP β a Perl extension for creating ARP packets π¦
πΈ SYNOPSIS πΈ
use Net::ARP;
Net::ARP::send_packet('lo', # Device
'127.0.0.1', # Source IP
'127.0.0.1', # Destination IP
'aa:bb:cc:aa:bb:cc', # Source MAC
'aa:bb:cc:aa:bb:cc', # Destinaton MAC
'reply'); # ARP operation
$mac = Net::ARP::get_mac("enp3s0f1");
print "$mac\n";
$mac = Net::ARP::arp_lookup($dev,"192.168.1.1");
print "192.168.1.1 has got mac $mac\n";
no cap, that's the whole vibe right there π
π¨ IMPORTANT π¨
Version 1.0 will break with the API of PRE-1.0 versions, because the return value of arp_lookup() and get_mac() will no longer be passed as parameter, but returned! π The author hopes this decision is ok as long as we get a cleaner and more perlish API π«Ά β and honestly? we did π
π DESCRIPTION π
This module can be used to create and send ARP packets, and to get the mac address of an ethernet interface or ip address π it's giving "small module, big power."
send_packet() π
Net::ARP::send_packet('lo', # Device
'127.0.0.1', # Source IP
'127.0.0.1', # Destination IP
'aa:bb:cc:aa:bb:cc', # Source MAC
'aa:bb:cc:aa:bb:cc', # Destinaton MAC
'reply'); # ARP operation
I think this is self documentating. πβ¨ (that's a direct vibe-transfer from the original, bestie)
The ARP operation can be one of the following values π:
requestreplyrevrequestrevreplyinvrequestinvreply
get_mac() π¦
$mac = Net::ARP::get_mac("enp3s0f1");
This gets the MAC address of the enp3s0f1 interface and stores it in the variable $mac πΎ The return value is "unknown" if the mac cannot be looked up πΈ (yes, the literal string, not a fancy error object β iconic behaviour, honestly)
arp_lookup() π
$mac = Net::ARP::arp_lookup($dev,"192.168.1.1");
This looks up the MAC address for the ip address 192.168.1.1 and stores it in the variable $mac π The return value is "unknown" if the mac cannot be looked up π same energy, different function, we love consistency.
π SEE ALSO π
man -a arpπ β go read the real thing too, iykyk
π AUTHOR π
- Bastian Ballmann [
balle@codekid.net] http://www.codekid.net
the icon, the legend, the main character π
π COPYRIGHT AND LICENSE π
Copyright (C) 2004-2022 by Bastian Ballmann
License: GPLv2 πΈ
okay that's the whole page bestie, you ate it π β¨
Sending you off with the receipts: this page came from perl v5.42.3, dated 2026-08-19 β so if you ever need to cite the exact vintage of this vibe, that's the number π mwah, go send some ARP packets responsibly π¦π
π¦ where this page comes from
- ubuntu stonking: libnet-arp-perl 1.0.12-1build6 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms