Today internet and computer networks use popular protocols like TCP/IP, Ethernet, etc. Ethernet is the most popular protocol used in Layer 2 which is called Media Access Control simply MAC. Every ethernet card has a MAC address in order to identify it uniquely. Normally MAC addressed are configured statically into the Ethernet cards, wireless cards, etc. but recently they can be modified with the operating system configuration.
Why Ping Mac Address?
MAC address is used inside the LAN for communication. Every device has a unique MAC address and generally communicates with the gateway and other devices by using its MAC address. The IP address is mainly used to give a unique number that can change in different situations and in different networks.
- Specify the remote system MAC address.
- Filter the remote system according to its MAC address.
- Pair multiple devices according to their MAC addresses.
Ping MAC Address with ping Command
By default, the Windows, Linux, and MacOSX operating systems do not provide a specific command to ping the MAC address. But there is an alternative way to execute MAC ping operations. First, we will ping the remote system IP address with the ping command.
> ping 192.168.142.133
The output will be like below for the ping command and responses.
Pinging 192.168.142.133 with 32 bytes of data: Reply from 192.168.142.133: bytes=32 time=2ms TTL=64 Reply from 192.168.142.133: bytes=32 time<1ms TTL=64 Reply from 192.168.142.133: bytes=32 time<1ms TTL=64 Reply from 192.168.142.133: bytes=32 time<1ms TTL=64 Ping statistics for 192.168.142.133: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 2ms, Average = 0ms
After the ping command is completed successfully the MAC address of the target will be stored in the ARP cache. ARP cache is a cache or temporary storage used to store IP addresses and related MAC addresses. The MAC address can be listed with the arp command by providing the -a parameter to list all ARP entries.
> arp -a
The output will be as below. As you can see every interface will have different ARP tables because every interface may have a different network connection.
Interface: 192.168.142.130 --- 0x8 Internet Address Physical Address Type 192.168.142.2 00-50-56-ec-77-85 dynamic 192.168.142.128 00-0c-29-60-d4-26 dynamic 192.168.142.132 00-0c-29-60-d4-26 dynamic 192.168.142.133 00-0c-29-e0-58-54 dynamic 192.168.142.254 00-50-56-eb-7a-b6 dynamic 192.168.142.255 ff-ff-ff-ff-ff-ff static 126.96.36.199 01-00-5e-00-00-16 static 188.8.131.52 01-00-5e-00-00-fb static 184.108.40.206 01-00-5e-00-00-fc static 220.127.116.11 01-00-5e-7f-ff-fa static 255.255.255.255 ff-ff-ff-ff-ff-ff static
Ping MAC Address with arp-ping.exe Command
arping command is specifically created to ping MAC address. The arping is not provided with the Windows operating systems but can be download via the following link.
After download, we can run the
arp-ping.exe via the MS-DOS or PowerShell command-line interface.
> arp-ping.exe aa.bb.cc.dd.ee.ff
Linux distributions like Ubuntu, Debian, CentOS, Mint, Kali provide the
arping command which is very similar to the arp-ping.exe command. It is not installed by default and can be installed like below.
Debian, Ubuntu, Mint, Kali:
$ sudo apt install arping
CentOS, RHEL, Fedora:
$ sudo dnf install arping
The arping command can be used like below.
> arping aa.bb.cc.dd.ee.ff