Is physical connection sufficient to register a MAC address to a switch?

I have a computer connected to an unlabeled RJ-45 port. Because it is not labeled, I do not know which switch port the computer is plugged into.

My initial thought was that I could login to the Catalyst switch and run the following command to find the switch port:

sh mac add | inc <MAC>

However, the computer's MAC address is not appearing in the MAC address table of the switch, despite the fact that the computer has a link light (and thus, must be physically connected to the switch). The computer is autoconfiguring a 169.254.x.x address because it cannot find a DHCP server. I suspect this is because the specific VLAN that is configured on the switch port doesn't have access to a DHCP server.

I tried manually configuring a few static IP addresses on the computer, and that seemed to make no difference in terms of getting the computer's MAC address registered in the switch's MAC table. I was trying random static IP addresses because I do not know to which subnet the VLAN is associated.

My question: does this mean that a connected device, like a computer, must have a valid IP address within the correct subnet to register its MAC address to the switch's MAC table? Until today, I thought a mere physical connection was sufficient to register a MAC address to a switch's MAC address table.


Solution 1:

Working link is not sufficient for working MAC level.

Consider different VLANs to be very similar to different cabling and a switch. So you need to have a proper (tagged) VLAN for both your computer and your switch port. But it's only an infinite (4096) number of possible VLANs. Then you need to convince your party to ask for your MAC address - so you need at least a basic communication.

No, IP addresses are not important if there is no ACL or port security interfering in the communication.