Without help of other automatic-discovery tools when finding out "which PC is attached to which switch port", I use "show mac-address-table address" command to locate that port. The last parameter to this command is MAC address of the PC in question.
I used to know the MAC address should be in "0012.3456.7890" format. However, I found that it could also be in formats such as "00-12-34-56-78-90" and "00:12:34:56:78:90"!
It would be much easier for us to do the cut-and-paste on the screen results of "ipconfig" or "ifconfig" on Windows and Unix hosts, respectively.
The following is a typical imaginary screen capture when I use this command to locate the switch port which the PC is connected to. Assume the PC's MAC address is "0012.3456.7890".
Switch>show mac-address-table address ?
H.H.H 48 bit mac address
Switch>show mac-address-table address 0012.3456.7890
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
225 0012.3456.7890 DYNAMIC Fa0/2
Total Mac Addresses for this criterion: 1
Switch>
Then, I know this PC is attached to "FastEthernet0/2". (Assume this is not a trunk link and no other dumb switch/hub could be attached to this port.)
What is the problem? See the result of "ipconfig /all":
C:\Documents and Settings\User>ipconfig /all
.....
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet
Physical Address. . . . . . . . . : 00-12-34-56-78-90
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 1.2.3.4
Subnet Mask . . . . . . . . . . . : 255.255.255.0
.....
Well, Windows uses the format of "00-12-34-56-78-90"! If IOS does not accept it, we have to manually replace "-" characters to none or ":", by our hand.
Luckily, IOS accepts it!
Switch>show mac-address-table address 00-12-34-56-78-90
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
225 0012.3456.7890 DYNAMIC Fa0/2
Total Mac Addresses for this criterion: 1
Switch>
Furthermore, IOS even accepts this format, which we often find on Unix hosts.
Switch>show mac-address-table address 00:12:34:56:78:90
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
225 0012.3456.7890 DYNAMIC Fa0/2
Total Mac Addresses for this criterion: 1
Switch>
No comments:
Post a Comment
Tip: you can also anonymously comment here.