Dell Networking SONiC 媒體存取控制 (MAC) 位址

Riepilogo: 本文說明 Dell SONiC 交換器中的 MAC 位址

Questo articolo si applica a Questo articolo non si applica a Questo articolo non è legato a un prodotto specifico. Non tutte le versioni del prodotto sono identificate in questo articolo.

Istruzioni

指數

什麼是 MAC 位址
如何在交換器
中學習 MAC 位址設定靜態 MAC 位址
設定 MAC 使用時間
設定 MAC 位址分層
範例組態
驗證
檢視 MAC 位址表
依 MAC 位址檢視 MAC
位址表專案依 VLAN
檢視 MAC 位址表專案檢視 MAC 位址計數
依介面
檢視 MAC 位址專案透過 PortChannel
檢視 MAC 位址專案檢視靜態 MAC 位址專案
檢視動態 MAC 位址專案                        




什麼是 MAC 位址

媒體存取控制 (MAC) 位址是 nn.nn.nn.nn.nn.nn 格式的 48 位數位。MAC 位址表包含靜態和動態 MAC 位址專案。

  • 靜態 MAC 位址是使用者設定的專案,不會變老。
  • 動態學習的 MAC 位址是硬體型專案,會根據設定的使用時間變舊。
 
注意:mac 位址表的最大容量會因交換器機型和已設定的 L2/L3 交換器設定檔而有所不同。如需詳細資訊,請參閱文章 Dell Networking SONiC OS L2 和 L3 交換器設定檔
 

如何在交換器中學習 MAC 位址

交換器收到封包時,會在收到封包的埠的來源 MAC 位址欄位中瞭解 MAC 位址。然後,交換器會在 MAC 位址表中查看指定 VLAN 的目的地 MAC 位址。如果找到目的地 MAC 位址,交換器會將封包轉送至適當的埠/埠通道。如果找不到目的地 MAC 位址,交換器會將封包固定在所有 VLAN 埠上。

達到使用過時時間時,由於沒有收到含有來源 MAC 的封包,則會從表格中刪除動態 MAC 位址專案。

注意:Dell SONiC 的預設 MAC 使用時間為 600 秒 (10 分鐘)。
 
 

設定靜態 MAC 位址

若要將靜態 MAC 位址新增至 MAC 位址表,請手動設定位址。指定乙太網路埠或埠通道和 VLAN,透過這些通道可以連接具有靜態 MAC 位址的裝置,以及交換器可將封包轉送至哪個位置。

組態語法

admin@sonic:~$ sonic-cli
sonic# configure
sonic(config)# mac address-table mac-address Vlan vlan-id 
 
範例組態
admin@sonic:~$ sonic-cli
sonic# configure
sonic(config)# no mac address-table 00:00:00:00:00:01 Vlan 10 
 

若要刪除靜態 MAC 位址,請使用無乙太網路埠或埠通道號碼的完整命令版本。

範例組態

admin@sonic:~$ sonic-cli
sonic# configure
sonic(config)# no mac address-table 00:00:00:00:00:01 Vlan 10 
 
 

設定 MAC 使用時間

設定所有動態學習到的 MAC 位址的使用時間 (0 到 1000000 秒;預設 600)。靜態 MAC 位址專案不受 mac 位址表的逾時命令影響。達到使用時間時,會從表格中刪除動態 MAC 位址專案。輸入 0 以停用 MAC 老舊。輸入無版本的命令,以還原預設的使用時間。

組態語法
admin@sonic:~$ sonic-cli
sonic# configure
sonic(config)# mac address-table aging-time 

範例組態
admin@sonic:~$ sonic-cli
sonic# show mac address-table aging-time 
Global aging time: 600 seconds

admin@sonic:~$ sonic-cli
sonic# configure
sonic(config)# mac address-table aging-time 1000
sonic(config)# exit
sonic# show mac address-table aging-time 
Global aging time: 1000 seconds

sonic(config)# mac address-table aging-time 0
sonic(config)# exit
sonic# show mac address-table aging-time 
Global aging time: 0 seconds(disabled)

sonic(config)# no mac address-table aging-time 
sonic(config)# exit
sonic# show mac address-table aging-time 
Global aging time: 600 seconds
 
 

設定 MAC 位址分層

若要限制動態 MAC 位址可指派給不同介面的最大次數,請設定授權閾值 (5 至 100;無預設值)。

組態語法
admin@sonic:~$ sonic-cli
sonic# configure
sonic(config)# mac address-table dampening-threshold 

若要設定動態 MAC 位址可指派給不同介面的最短時間間隔,請設定節點間隔 (1 至 1000000 秒,無預設值)。

組態語法
admin@sonic:~$ sonic-cli
sonic# configure
sonic(config)# mac address-table dampening-interval 
 
 

範例組態

admin@sonic:~$ sonic-cli 
sonic# configure
sonic(config)# mac address-table 00:00:00:00:00:01 Vlan 10 Eth1/1
sonic(config)# mac address-table 00:00:00:00:00:01 Vlan 11 Eth1/1
sonic(config)# mac address-table 00:00:00:00:00:03 Vlan 30 Eth1/2
sonic(config)# mac address-table 00:00:00:00:00:05 Vlan 50 Eth1/3
sonic(config)# mac address-table 00:00:00:00:00:07 Vlan 70 Eth1/4
sonic(config)# mac address-table 00:00:00:00:00:09 Vlan 90 Eth1/5
sonic(config)# mac address-table 00:00:00:00:00:98 Vlan 10 Eth1/6
sonic(config)# mac address-table 00:00:00:00:00:99 Vlan 99 PortChannel 110
sonic(config)# mac address-table aging-time 1000
sonic(config)# mac address-table dampening-threshold 10
sonic(config)# mac address-table dampening-interval 100000
 

 

驗證


使用 show mac 位址表命令來檢視 MAC 位址表資訊。
show mac address-table [address mac-address] [aging-time] [interface Eth slot/port[/breakout-port]] [Vlan vlan-id] [PortChannel number] [count] [static] [dynamic]
 


檢視 MAC 位址表


範例輸出
sonic# show mac address-table 
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
10 00:00:00:00:00:01 STATIC Eth1/1 
11 00:00:00:00:00:01 STATIC Eth1/1 
100 00:00:00:00:00:10 DYNAMIC Eth1/9 
20 00:00:00:00:00:02 DYNAMIC Eth1/2 
30 00:00:00:00:00:03 STATIC Eth1/2 
40 00:00:00:00:00:04 DYNAMIC Eth1/3 
50 00:00:00:00:00:05 STATIC Eth1/3 
60 00:00:00:00:00:06 DYNAMIC Eth1/4 
70 00:00:00:00:00:07 STATIC Eth1/4 
80 00:00:00:00:00:08 DYNAMIC Eth1/4 
90 00:00:00:00:00:09 STATIC Eth1/5 
99 00:00:00:00:00:99 STATIC PortChannel110


依 MAC 位址檢視 MAC

位址表專案範例輸出
sonic# show mac address-table address 00:00:00:00:00:01 
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
10 00:00:00:00:00:01 STATIC Eth1/1 
11 00:00:00:00:00:01 STATIC Eth1/1


依 VLAN

檢視 MAC 位址表專案範例輸出
sonic# show mac address-table Vlan 10
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
10 00:00:00:00:00:01 STATIC Eth1/1 
10 00:00:00:00:00:98 STATIC Eth1/1
 
sonic# show mac address-table static Vlan 11 
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE
-----------------------------------------------------------
11 00:00:00:00:00:01 STATIC Eth1/1
 
sonic# show mac address-table dynamic Vlan 60 
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
60 00:00:00:00:00:06 DYNAMIC Eth1/12


檢視 MAC 位址計數

範例輸出
sonic# show mac address-table count
MAC Entries for all vlans : 13 
Dynamic Address Count : 5 
Static Address (User-defined) Count : 8 
Total MAC Addresses in Use: 13 


依介面

檢視 MAC 位址專案範例輸出
sonic# show mac address-table interface Eth1/1
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
10 00:00:00:00:00:01 STATIC Eth1/1 
10 00:00:00:00:00:98 STATIC Eth1/1 
11 00:00:00:00:00:01 STATIC Eth1/1
 
sonic# show mac address-table static interface Eth1/3 
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
30 00:00:00:00:00:03 STATIC Eth1/3
 
sonic# show mac address-table dynamic interface Eth1/5 
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
60 00:00:00:00:00:06 DYNAMIC Eth1/5


透過 PortChannel

檢視 MAC 位址專案範例輸出
sonic# show mac address-table interface PortChannel 10 
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
99 00:00:00:00:00:99 STATIC PortChannel10


檢視靜態 MAC 位址專案

範例輸出
sonic# show mac address-table static
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
10 00:00:00:00:00:01 STATIC Eth1/1 
11 00:00:00:00:00:01 STATIC Eth1/1 
30 00:00:00:00:00:03 STATIC Eth1/3 
50 00:00:00:00:00:05 STATIC Eth1/5 
70 00:00:00:00:00:07 STATIC Eth1/7 
90 00:00:00:00:00:09 STATIC Eth1/9
10 00:00:00:00:00:98 STATIC Eth1/1 
99 00:00:00:00:00:99 STATIC PortChannel10
 
sonic# show mac address-table static address 00:00:00:00:00:01
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
10 00:00:00:00:00:01 STATIC Eth1/1 
11 00:00:00:00:00:01 STATIC Eth1/1 


檢視動態 MAC 位址專案

範例輸出
sonic# show mac address-table dynamic
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
100 00:00:00:00:00:10 DYNAMIC Eth1/1 
20 00:00:00:00:00:02 DYNAMIC Eth1/2 
40 00:00:00:00:00:04 DYNAMIC Eth1/3 
60 00:00:00:00:00:06 DYNAMIC Eth1/4 
80 00:00:00:00:00:08 DYNAMIC Eth1/5
 
sonic# show mac address-table dynamic address 00:00:00:00:00:06
-----------------------------------------------------------
VLAN MAC-ADDRESS TYPE INTERFACE 
-----------------------------------------------------------
60 00:00:00:00:00:06 DYNAMIC Eth1/1



Prodotti interessati

Enterprise SONiC Distribution, PowerSwitch E3200-ON Series, PowerSwitch N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON , PowerSwitch Z9432F-ON ...
Proprietà dell'articolo
Numero articolo: 000217932
Tipo di articolo: How To
Ultima modifica: 02 ott 2023
Versione:  5
Trova risposta alle tue domande dagli altri utenti Dell
Support Services
Verifica che il dispositivo sia coperto dai Servizi di supporto.