I have connected two computers, A and B, NIC-to-NIC using an ethernet cable. They have self-assigned their IP addresses—at least, I can see that A has done so, so I infer that B must have also done so. Computer A is a laptop running Windows 10, but I have no keyboard and mouse available for B. From A, how can I determine B's IP address?
On A, this is what I see:
> ipconfig Ethernet adapter Ethernet Autoconfiguration IPv4 Address. . : 169.254.219.59 Subnet Mask . . . . . . . . : 255.255.0.0 > nmap -sn 169.254.219.0/24 ...which just says "Host is up" and doesn't report anybody else being on the network. I don't claim to understand what nmap is doing (for example, I have no idea what's special about the number 24) but I do know that the same command with 192.168.1.0/24 successfully finds devices on the wireless network to which A is also attached.
1 Answer
for example, I have no idea what's special about the number 24
It's a short way of writing the "255.255.255.0" netmask. (Also called "CIDR syntax" from its origins, or "prefix length" because it indicates that the network is specified by the first 24 bits. If you convert 255.255.255.0 from decimal to binary, you'll see it begins with exactly 24 'one' bits.)
However, your actual netmask is not 255.255.255.0 – it's 255.255.0.0, as shown in the ifconfig output. That's a /16. The whole "self-assigned" range is in fact 169.254.0.0/16.
Hosts will send out a few ARP probes as part of the self-assignment process (to ensure that the address isn't already in use). If you connect the computers while Wireshark or tcpdump is already running a capture on the Ethernet interface, you should see both of them revealing their addresses this way.
3