交換機的MAC地址?


該示例中記錄了Cat2960的MAC地址情況:

Cat2960#sho mac address-table
Mac Address Table
-------------------------------------------

Vlan Mac Address Type Ports
---- ----------- -------- -----
All 0100.0ccc.cccc STATIC CPU
All 0100.0ccc.cccd STATIC CPU
All 0180.c200.0000 STATIC CPU
All 0180.c200.0001 STATIC CPU
All 0180.c200.0002 STATIC CPU
All 0180.c200.0003 STATIC CPU
All 0180.c200.0004 STATIC CPU
All 0180.c200.0005 STATIC CPU
All 0180.c200.0006 STATIC CPU
All 0180.c200.0007 STATIC CPU
All 0180.c200.0008 STATIC CPU
All 0180.c200.0009 STATIC CPU
All 0180.c200.000a STATIC CPU
All 0180.c200.000b STATIC CPU
All 0180.c200.000c STATIC CPU
All 0180.c200.000d STATIC CPU
All 0180.c200.000e STATIC CPU
All 0180.c200.000f STATIC CPU
All 0180.c200.0010 STATIC CPU
All ffff.ffff.ffff STATIC CPU
Total Mac Addresses for this criterion: 20

 

在有些設備上,可以看到例如SVI接口的MAC地址都是一樣的,這取決於交換機的架構問題,可能是正常的。

接下來,查看一下2960上SVI的MAC地址,這里有4個VLAN

Cat2960#sho vlan

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/4, Fa0/5, Fa0/7
Fa0/8, Gi0/1
10 VLAN0010 active Fa0/3
100 VLAN0100 active
192 VLAN0192 active Fa0/1, Fa0/6

 

Cat2960#show int vlan 1 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a40 (bia dc7b.949f.9a40)
Cat2960#show int vlan 10 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a42 (bia dc7b.949f.9a42)
Cat2960#show int vlan 100 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a43 (bia dc7b.949f.9a43)
Cat2960#show int vlan 192 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a41 (bia dc7b.949f.9a41)

 

可以看到這4個SVI的MAC地址不同,只有最后一位不一樣,但為什么SVI192的MAC最后一位是1?因為SVI 1最開始就有,第二個創建的是SVI 192,SVI 10和SVI 100是接下來再創建的。我們可以測試一下,刪除SVI 192.然后再添加SVI 192.

Cat2960(config)#no int vlan 192
Cat2960(config)#int vlan 192
*Mar 1 00:38:33.812: %LINK-5-CHANGED: Interface Vlan192, changed state to administratively down
*Mar 1 00:38:36.438: %LINK-3-UPDOWN: Interface Vlan192, changed state to up
Cat2960(config-if)#do sho int vlan 192 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a41 (bia dc7b.949f.9a41)

發現沒有改變,重啟之后再查看:

Cat2960#wr mem
Building configuration...
[OK]
Cat2960#reload
Proceed with reload? [confirm]

*Mar 1 00:59:48.411: %SYS-5-RELOAD: Reload requested by console. Reload reason: Reload command

......

Cat2960#show int vlan 192 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a43 (bia dc7b.949f.9a43)

可以看到已經改變:

Cat2960#show int vlan 1 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a40 (bia dc7b.949f.9a40)
Cat2960#show int vlan 10 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a41 (bia dc7b.949f.9a41)
Cat2960#show int vlan 100 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a42 (bia dc7b.949f.9a42)
Cat2960#show int vlan 192 | in Hardware
Hardware is EtherSVI, address is dc7b.949f.9a43 (bia dc7b.949f.9a43)

所以,交換機根據先后配置的SVI,按序分配MAC地址,一般從最后一位開始+1

但是有的交換機的SVI MAC地址也是一樣的,好像Cat4500就是把。

 

這里還有九個物理接口:

Cat2960#sh ip int brief
Interface IP-Address OK? Method Status Protocol
Vlan1 unassigned YES NVRAM up down
Vlan10 unassigned YES NVRAM up down
Vlan100 unassigned YES NVRAM up down
Vlan192 unassigned YES NVRAM up down
FastEthernet0/1 unassigned YES unset down down
FastEthernet0/2 unassigned YES unset down down
FastEthernet0/3 unassigned YES unset down down
FastEthernet0/4 unassigned YES unset down down
FastEthernet0/5 unassigned YES unset down down
FastEthernet0/6 unassigned YES unset down down
FastEthernet0/7 unassigned YES unset down down
FastEthernet0/8 unassigned YES unset down down
GigabitEthernet0/1 unassigned YES unset down down

 

依次看看物理接口的MAC地址:

Cat2960#sho int f0/1 | in Hardware
Hardware is Fast Ethernet, address is dc7b.949f.9a01 (bia dc7b.949f.9a01)
Cat2960#sho int f0/2 | in Hardware
Hardware is Fast Ethernet, address is dc7b.949f.9a02 (bia dc7b.949f.9a02)
Cat2960#sho int f0/3 | in Hardware
Hardware is Fast Ethernet, address is dc7b.949f.9a03 (bia dc7b.949f.9a03)
Cat2960#sho int f0/4 | in Hardware
Hardware is Fast Ethernet, address is dc7b.949f.9a04 (bia dc7b.949f.9a04)
Cat2960#sho int f0/5 | in Hardware
Hardware is Fast Ethernet, address is dc7b.949f.9a05 (bia dc7b.949f.9a05)
Cat2960#sho int f0/6 | in Hardware
Hardware is Fast Ethernet, address is dc7b.949f.9a06 (bia dc7b.949f.9a06)
Cat2960#sho int f0/7 | in Hardware
Hardware is Fast Ethernet, address is dc7b.949f.9a07 (bia dc7b.949f.9a07)
Cat2960#sho int f0/8 | in Hardware
Hardware is Fast Ethernet, address is dc7b.949f.9a08 (bia dc7b.949f.9a08)
Cat2960#sho int G0/1 | in Hardware
Hardware is Gigabit Ethernet, address is dc7b.949f.9a09 (bia dc7b.949f.9a09)

相信接口上的也是,先加載哪個接口,哪個接口的MAC地址就更小。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM