Dell Networking SONiC:連結層探索通訊協定
Summary: 本文說明 Dell Networking SONiC 中的連結層探索通訊協定 (LLDP) 和組態。本文使用執行 Dell SONiC 4.1 的交換器。
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
|
先決條件
我們使用標準介面命名來展示概念。請參閱Dell Networking S 系列202172文章:基本介面組態 - SONiC 4.0,以取得介面命名的詳細資訊 |
指數
介紹
組態語法
啟用並停用 LLDP。
設定 LLDP 傳輸
設定 LLDP 接收
啟用 LLDP 傳輸和接收。
可讓 LLDP 傳送管理位址、系統名稱和說明。
驗證
簡介
連結層探索通訊協定 (LLDP) 可讓交換器廣告主要功能和實體說明。LLDP 定義于 IEEE 802.1AB。此資訊可用來協助識別系統拓撲和偵測 LAN 上的不良組態。
- LLDP 是單向通訊協定;沒有要求或回應順序。實作傳輸功能的月臺會廣告資訊,而實作接收功能的月臺則會接收和處理資訊。
- 可在每個交換器埠上分別啟用或停用傳輸和接收功能。
- LLDP 是供應商中立的探索通訊協定。
- 交換器會接收並定期傳輸 LLDP 通訊協定資料單元 (PDU)。預設傳輸間隔為 30 秒。
- 從鄰家收到的 LLDP PDU 資訊會在特定時間後到期,稱為居住時間 (TTL)。預設 TTL 值為 120 秒。
- Spanning-tree 封鎖埠允許 LLDP PDU。
組態語法
注意:LLDP 組態變更後,LLDP 表格會在 120 秒 (TTL) 內更新。
啟用並停用 LLDP。
Enable LLDP Globally admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# lldp enable DELLSONiC(config)# end Disable LLDP Globally DELLSONiC# configure DELLSONiC(config)# no lldp enable DELLSONiC(config)# end Enable LLDP on a single interface DELLSONiC# configure DELLSONiC(config)# interface Eth slot/port[/subport] DELLSONiC(config-if-EthX/X)# lldp enable DELLSONiC(config-if-EthX/X)# end Disable LLDP on a single interface DELLSONiC# configure DELLSONiC(config)# interface Eth slot/port[/subport] DELLSONiC(config-if-EthX/X)# no lldp enable DELLSONiC(config-if-EthX/X)# end |
設定 LLDP 傳輸
執行這些命令,停用 LLDP 接收。 Enable LLDP Transmit Globally admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# lldp transmit DELLSONiC(config)# end Enable LLDP Transmit on a single interface DELLSONiC# configure DELLSONiC(config)# interface Eth slot/port[/subport] DELLSONiC(config-if-EthX/X)# lldp transmit DELLSONiC(config-if-EthX/X)# end Enable LLDP Transmit and Receive (Click here) |
設定 LLDP 接收
執行這些命令可停用 LLDP 傳輸。 Enable LLDP Receive Globally admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# lldp receive DELLSONiC(config)# end Enable LLDP Receive on a single interface DELLSONiC# configure DELLSONiC(config)# interface Eth slot/port[/subport] DELLSONiC(config-if-EthX/X)# lldp receive DELLSONiC(config-if-EthX/X)# end Enable LLDP Transmit and Receive (Click here) |
啟用 LLDP 傳輸和接收。
根據預設,LLDP 傳輸和接收會預設為啟用。如果您已設定 LLDP 傳輸,LLDP 接收會停用。
如果您已收到設定的 LLDP,LLDP 傳輸會停用。
若要同時啟動兩者,請移除 LLDP 接收和 LLDP 傳輸。
Enable LLDP Transmit and Receive Globally admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# no lldp receive DELLSONiC(config)# no lldp transmit DELLSONiC(config)# end Enable LLDP Transmit and Receive on a single interface DELLSONiC# configure DELLSONiC(config)# interface Eth slot/port[/subport] DELLSONiC(config-if-EthX/X)# no lldp receive DELLSONiC(config-if-EthX/X)# no lldp transmit DELLSONiC(config-if-EthX/X)# end |
可讓 LLDP 傳送管理位址、系統名稱和說明。
根據預設,LLDP 會廣告系統名稱和系統說明。若要透過LLDP 廣告管理位址,我們必須手動設定lldp tlv-select 管理位址。
Use bellow configuration to enable system-name, system-description and management-address DELLSONiC# configure DELLSONiC(config)# lldp system-name DELLSONiC(config)# lldp system-description DELLSONiC(config)# lldp tlv-select management-address DELLSONiC(config)#end Disable system-name, system-description and management-address DELLSONiC# configure DELLSONiC(config)# no lldp system-name DELLSONiC(config)# no lldp system-description DELLSONiC(config)# no lldp tlv-select management-address DELLSONiC(config)#end |
You have an option to manually specify the IPv4/IPv6 address of management address manually DELLSONiC# configure DELLSONiC(config)# interface Eth slot/port[/subport] DELLSONiC(config-if-Eth1/1)# lldp tlv-set management-addressDELLSONiC(config-if-Eth1/1)# end *Applying this command will make Switch to send LLDP in the specific interface with configured IPV4/IPV6 address, rather than management port IP address. To disable use DELLSONiC# configure DELLSONiC(config)# interface Eth slot/port[/subport] DELLSONiC(config-if-Eth1/1)# lldp tlv-set management-address DELLSONiC(config-if-Eth1/1)# end |
確認
| 組態 | 語法 |
| DELLSONiC# show lldp 表格 | 展示所有 LLDP 鄰家的夏季內容。 |
| DELLSONiC# show lldp ad | 顯示所有 LLDP 近鄰的詳細資料。 |
| DELLSONiC# show lldp 合約 Eth 插槽/埠 [/子埠] | 在特定介面中顯示 LLDP 連續的詳細資料。 |
| DELLSONiC# show lldp 統計資料 | 顯示所有 LLDP 近鄰的 LLDP 統計資料。 |
| DELLSONiC# show lldp statistics Eth slot/port [/subport] | 在特定介面中顯示 LLDP 統計資料。 |
範例輸出
DELLSONiC# show lldp table ------------------------------------------------------------------------------------------------------ LocalPort RemoteDevice RemotePortID Capability RemotePortDescr ------------------------------------------------------------------------------------------------------- Eth1/1 DELL-EDGE-sonic Eth1/1 R Ethernet0 |
DELLSONiC# show lldp neighbor Eth 1/1
-----------------------------------------------------------
LLDP Neighbors
-----------------------------------------------------------
Interface: Eth1/1,via: LLDP
Chassis:
ChassisID: XXXXXXXXXXXXXXXXXXXXXXXX
SysName: DELL-EDGE-sonic
SysDescr: DELL-CORE
TTL: 120
MgmtIP: 30.0.0.1
Capability: ROUTER, ON
Port
PortID: Eth1/1
PortDescr: Ethernet0
LLDP-MED
Device Type: Network Connectivity Device
Capability: Capabilities, yes
Capability: Ext_mdi_power_pd, yes
Capability: Inventory, yes
Capability: Network_policy, yes
Inventory
Hardware Rev: XXXXXXXXXXXXXXXXXXXXXXXX
Software Rev: XXXXXXXXXXXXXXXXXXXXXXXX
Firmware Rev: XXXXXXXXXXXXXXXXXXXXXXXX
Serial Number: |
DELLSONiC# show lldp statistics Eth 1/1
LLDP Statistics
---------------------------------
Interface: Eth1/1
Transmitted : 60
Received : 45
Discarded : 0
Unrecognized TLV : 0
Ageout : 1
--------------------------------- |
Affected Products
Enterprise SONiC Distribution, PowerSwitch E3200-ON Series, Dell EMC Networking N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9100-ON, PowerSwitch Z9264F-ON
, PowerSwitch Z9332F-ON, PowerSwitch Z9432F-ON
...
Article Properties
Article Number: 000218154
Article Type: How To
Last Modified: 16 Oct 2023
Version: 4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.