Search code examples
network-programmingipnmap

nmap, missing last mac address


when I run

sudo nmap -sn xxx.xxx.x.*

I got a list of all IPs connected to my router (xxx.xxx.x.1 is gateway), but i've noticed that the last ip connected doesn't show the MAC address. Why? How can i fix this? This is my output:

Starting Nmap 7.60 ( https://nmap.org ) at 2018-04-09 18:38 CEST
Nmap scan report for xxx.xxx.x.1
Host is up (0.0029s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Technicolor)
Nmap scan report for xxx.xxx.x.2
Host is up (0.00014s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Prime Electronics & Satellitics)
Nmap scan report for xxx.xxx.x.3
Host is up (0.16s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Espressif)
Nmap scan report for xxx.xxx.x.46
Host is up (1.1s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Xiaomi Communications)
Nmap scan report for xxx.xxx.x.61
Host is up (1.4s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Unknown)
Nmap scan report for xxx.xxx.x.128
Host is up (8.3s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Motorola Mobility, a Lenovo Company)
Nmap scan report for xxx.xxx.x.254
Host is up.
MAC Address: xx:xx:xx:xx:xx:xx (Unknown)
Nmap scan report for xxx.xxx.x.27
Host is up.
Nmap done: 256 IP addresses (8 hosts up) scanned in 27.83 seconds

As you can see, MAC address is missing from the last host (that is my pc, from which i lunch the command)


Solution

  • The last IP is your scanning machine. Because it is accessed over the loopback interface, it does not have an associated MAC address. The Loopback link type does not have a physical medium, so it does not need or have a "media access control" (MAC) address. It is listed last because Nmap first scanned all the targets that used Ethernet (or similar, like WiFi) links in one group, leaving only your local address in the last group.