03-DLDP配置
本章節下載: 03-DLDP配置 (456.24 KB)
目 錄
在實際組網中,有時會出現單通現象,即一條鏈路上的兩個端口,有且隻有一端可收到另一端發來的鏈路層報文,此鏈路便稱為單向鏈路。圖1-1以光纖連接為例,示意了兩種單通情形:一種是光纖交叉相連,另一種是一條光纖未連接或斷路。
物理層的檢測機製(如自動協商機製)負責進行物理信號和故障的檢測。而在單向鏈路中,由於物理層仍處於連通狀態,因此物理層檢測機製無法發現設備間的通信異常,從而會導致錯誤轉發、環路等問題。而我司私有實現的DLDP(Device Link Detection Protocol,設備鏈路檢測協議)能夠通過在鏈路層監控光纖或網線的鏈路狀態,檢測鏈路連接是否正確、鏈路兩端可否正常交互報文。當發現單向鏈路時,DLDP會根據用戶配置自動關閉或由用戶手工關閉相關接口,以防止網絡問題的發生。DLDP與物理層檢測機製協同工作,可以檢測並避免物理和邏輯的單向連接。
假設接口A和B同處一條鏈路上,若A能收到B發來的鏈路層報文,便將B稱為A的DLDP鄰居,能夠互相收發報文的兩個接口互為鄰居。DLDP鄰居的狀態如表1-1所示。
表1-1 DLDP鄰居狀態
狀態 |
說明 |
Confirmed(確定) |
鏈路雙通時的DLDP鄰居狀態 |
Unconfirmed(未確定) |
發現新鄰居但未確認鏈路雙通時的DLDP鄰居狀態 |
開啟了DLDP功能的接口簡稱DLDP接口。DLDP接口可以有一或多個DLDP鄰居,其狀態與各DLDP鄰居的狀態相關,具體如表1-2所示。
表1-2 DLDP接口狀態
狀態 |
說明 |
Initial(初始) |
當接口已開啟DLDP功能,但全局尚未開啟DLDP功能時的接口狀態 |
Inactive(非活動) |
當接口和全局均已開啟DLDP功能,但鏈路物理down時的接口狀態 |
Bidirectional(雙通) |
當接口和全局均已開啟DLDP功能,且有至少一個處於確定狀態下的鄰居時的接口狀態 |
Unidirectional(單通) |
當接口和全局均已開啟DLDP功能,且沒有處於確定狀態下的鄰居時的接口狀態,處於此狀態的接口隻能收發DLDP報文 |
DLDP在工作過程中使用到的定時器如表1-3所示。
表1-3 DLDP定時器
定時器 |
說明 |
Advertisement發送定時器 |
Advertisement報文的發送間隔(缺省為5秒,可配) |
Probe發送定時器 |
Probe報文的發送間隔(固定為1秒) |
Echo等待定時器 |
對鄰居進行探測時會啟動此定時器(固定為10秒) |
鄰居老化定時器 |
每個新鄰居的加入都要建立鄰居表項,當鄰居處於確定狀態時啟動鄰居老化定時器,當收到鄰居的Advertisement報文時刷新鄰居表項的鄰居老化定時器。鄰居老化定時器的值是Advertisement發送定時器的值的3倍 |
加強探測定時器 |
若鄰居老化定時器超時,則啟動該鄰居的加強探測定時器(固定為1秒),同時啟動Echo等待定時器 |
DelayDown定時器 |
接口物理down時不會立即刪除所有鄰居,而是先啟動DelayDown定時器(缺省為1秒,可配),該定時器超時後再核對接口的物理狀態:若為down,則刪除DLDP鄰居信息;若為up,則不進行任何處理 |
恢複探測定時器 |
RecoverProbe報文的發送間隔(固定為2秒)。處於單通狀態的接口會定期發送RecoverProbe報文來檢測單向鏈路是否恢複 |
進行DLDP認證,可以防止網絡攻擊和惡意探測,DLDP的認證模式如表1-4所示。
表1-4 DLDP認證模式
認證模式 |
DLDP報文發送端的處理 |
DLDP報文接收端的處理 |
不認證 |
將DLDP報文的認證字字段置為全0 |
將接收的DLDP報文的認證信息與本端配置進行比較,若一致則認證通過,否則丟棄該報文 |
明文認證 |
將DLDP報文的認證字字段置為明文認證密碼 |
|
MD5認證 |
將DLDP報文的認證字字段置為用MD5算法加密後的密碼摘要 |
當兩台設備通過光纖或網線直接相連時,可以在這兩台設備之間啟用DLDP協議來檢測單向鏈路,此時這兩台設備的接口互為DLDP鄰居,因此稱為單鄰居檢測。下麵分兩種情況分別介紹單鄰居的單向鏈路檢測過程。
(1) 開啟DLDP功能前鏈路已出現單通
如圖1-2所示,在開啟DLDP功能之前,Device A和Device B之間的光纖就已交叉連接。當開啟DLDP功能後,處於up狀態的四個接口都進入單通狀態,並向外發送RecoverProbe報文。下麵以Port 1為例介紹單向鏈路的檢測過程:
· Port 1收到Port 4發來的RecoverProbe報文後,回複RecoverEcho報文。
· 由於Port 4無法收到Port 1發來的RecoverEcho報文,因此不會與Port 1建立鄰居關係。
· Port 3雖能收到Port 1發來的RecoverEcho報文,但由於該報文並不是回複給Port 3的,因此Port 3也不會與Port 1建立鄰居關係。
其它三個接口上的檢測過程與Port 1類似,這四個接口將始終處於單通狀態。
(2) 開啟DLDP功能後鏈路才出現單通
如圖1-3所示,Device A和Device B通過光纖相連。在開啟DLDP功能之後,光纖連接起初是正常的,Port 1與Port 2之間的雙通鄰居建立過程如下:
· 處於物理up狀態的Port 1先進入單通狀態,向外發送RecoverProbe報文。
· Port 2收到RecoverProbe報文後,回複RecoverEcho報文。
· Port 1收到RecoverEcho報文後,發現該報文中攜帶的鄰居信息與本機的相同,於是與Port 2建立確定的鄰居關係,接口狀態由單通變為雙通,啟動該鄰居的老化定時器並定期發送Advertisement報文。
· Port 2收到Advertisement報文後與Port 1建立未確定的鄰居關係,為該鄰居啟動Echo等待定時器和Probe發送定時器,定期發送Probe報文。
· Port 1收到Probe報文後,回複Echo報文。
· Port 2收到Echo報文後,發現該報文中攜帶的鄰居信息和本機保存的相同,於是將鄰居狀態由未確定切換為確定,接口狀態則由單通切換為雙通,啟動該鄰居的老化定時器並定期發送Advertisement報文。
至此,Port 1與Port 2之間的雙通鄰居關係建立完畢。
此後,假設Port 2的Rx端突發故障而無法接收信號,該接口將物理down並進入非活動狀態,但此時由於其Tx端尚能發送信號給Port 1,因此Port 1還處於up狀態。Port 1在鄰居老化定時器超時後,將啟用加強探測定時器和Echo等待定時器,並向鄰居Port 2發送Probe報文;而由於Port 1的Tx端已斷路,Echo等待定時器超時後將收不到Port 2回複的Echo報文,於是Port 1進入單通狀態,並發送Disable報文通知對端。同時,Port 1刪除鄰居Port 2,並啟動恢複探測定時器以檢測鏈路是否恢複。在此過程中,Port 2將一直處於非活動狀態。
需要注意的是,物理down之後,DLDP會嚐試發送LinkDown報文,對端收到此報文後會直接刪除鄰居表項,以縮短故障發現時間。接口能否成功發送LinkDown報文取決於以下兩點:
· 接口必須為千兆以太網光接口,且必須將接口的speed配置為1000,duplex配置為full。關於speed和duplex命令的詳細介紹,請參見“接口管理”中的“以太網接口”。
· 由於發送此報文時接口已物理down,因此能否發送成功還取決於接口的Tx端是否完好。
當多台設備通過Hub相連時,也可以在這些設備之間啟用DLDP協議來檢測單向鏈路,此時每個接口都會檢測到一個以上的DLDP鄰居,因此稱為多鄰居檢測。在多鄰居組網環境中,為了能正確檢測出單向鏈路,要求在所有與Hub相連的接口上都啟用DLDP,接口一旦發現沒有確定的鄰居,便進入單通狀態。
如圖1-4所示,Device A~Device D都通過一台Hub相連,各設備都支持DLDP。當Port 1、Port 2和Port 3發現與Port 4的連接出錯後,都將刪除該鄰居,但仍保持雙通狀態。
· 為確保DLDP功能能夠正常工作,要保證兩端設備的DLDP功能都處於開啟狀態,且Advertisement報文的發送間隔、DLDP認證模式和密碼都相同。
· 為確保DLDP功能能夠正常工作,請將兩端接口的雙工模式配置為全雙工、速率配置為相同的強製速率。
表1-5 DLDP配置任務簡介
配置任務 |
說明 |
詳細配置 |
開啟DLDP功能 |
必選 |
|
配置Advertisement報文的發送間隔 |
可選 |
|
配置DelayDown定時器的超時時間 |
可選 |
|
配置DLDP發現單向鏈路後接口的關閉模式 |
可選 |
|
配置DLDP的認證模式和密碼 |
可選 |
要啟用DLDP功能,必須在全局和接口上都開啟DLDP功能。
開啟了DLDP功能的接口最先進入Initial(初始)狀態,然後轉變為Unidirectional(單通)狀態。缺省情況下,DLDP協議會立即阻塞該接口,從而造成短暫的流量中斷,直至接口確定鄰居後,DLDP協議打開該接口,該接口進入Bidirectional(雙通)狀態。
用戶可以配置接口由初始狀態進入單通狀態時DLDP阻塞接口的延遲時間,在此時間內,DLDP協議不會阻塞該接口,避免造成短暫的流量中斷;若超過延遲時間,該接口沒有確認的鄰居,則DLDP協議會阻塞該接口。
表1-6 開啟DLDP功能
命令 |
說明 |
|
進入係統視圖 |
system-view |
- |
全局開啟DLDP功能 |
dldp global enable |
缺省情況下,DLDP功能處於全局關閉狀態 |
進入以太網接口視圖 |
interface interface-type interface-number |
- |
開啟接口的DLDP功能和配置由初始狀態進入單通狀態時DLDP阻塞接口的延遲時間 |
dldp enable [ initial-unidirectional-delay time ] |
缺省情況下,接口上的DLDP功能處於關閉狀態,且接口由初始狀態進入單通狀態時DLDP阻塞接口無延遲 |
通過合理調整Advertisement報文的發送間隔,可使DLDP在不同的網絡環境下都能夠及時發現單向鏈路(建議采用缺省值)。
表1-7 配置Advertisement報文的發送間隔
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置Advertisement報文的發送間隔 |
dldp interval interval |
缺省情況下,Advertisement報文的發送間隔為5秒 |
有些接口當其Tx端發生故障時會引起Rx端光信號的抖動(表現為該接口down後隨即又up),為避免在這種情況下錯誤清除鄰居信息,DLDP會在接口物理down時先啟動DelayDown定時器,該定時器超時後再核對接口的物理狀態:若為down,則刪除DLDP鄰居信息;若為up,則不進行任何處理。
本配置將應用於所有開啟了DLDP功能的接口上。
表1-8 配置DelayDown定時器的超時時間
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置DelayDown定時器的超時時間 |
dldp delaydown-timer time |
缺省情況下,DelayDown定時器的超時時間為1秒 |
當DLDP檢測到單向鏈路時,可以采用以下三種方式關閉單通接口:
· 自動模式:在此模式下,若DLDP檢測到單向鏈路,則會自動關閉單通接口;若單向鏈路恢複為雙向鏈路,則DLDP會自動打開被關閉的接口。
· 手動模式:在此模式下,若DLDP檢測到單向鏈路,不會直接關閉單通接口,需要用戶手工將其關閉;當用戶想知道鏈路是否恢複為雙向鏈路時,需要執行undo shutdown命令打開端口重新檢測鏈路,若檢測到鏈路恢複為雙向鏈路,則接口恢複正常。當網絡性能較差、設備業務量較大或CPU利用率較高時,都容易造成DLDP對單通的誤判而自動關閉接口,手動模式就是為了避免這種誤判而采取的一種折中方案。
· 混合模式:在此模式下,若DLDP檢測到單向鏈路,則會自動關閉單通接口,並停止對鏈路的檢測;當用戶想知道鏈路是否恢複為雙向鏈路時,需要執行undo shutdown命令打開端口重新檢測鏈路,若檢測到鏈路恢複為雙向鏈路,則接口恢複正常。
表1-9 全局配置DLDP發現單向鏈路後接口的關閉模式
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
全局配置DLDP發現單向鏈路後接口的關閉模式 |
dldp unidirectional-shutdown { auto | hybrid | manual } |
缺省情況下,DLDP發現單向鏈路後接口的關閉模式為自動模式 |
表1-10 在接口上配置DLDP發現單向鏈路後接口的關閉模式
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
進入以太網接口視圖 |
interface interface-type interface-number |
- |
在接口上配置DLDP發現單向鏈路後接口的關閉模式 |
dldp port unidirectional-shutdown { auto | hybrid | manual } |
缺省情況下,DLDP發現單向鏈路後,接口的關閉模式采用全局配置 |
· 用戶既可在係統視圖下配置對所有接口都有效的關閉模式,也可在接口視圖下配置隻對當前接口有效的關閉模式,後者的配置優先級較高。
· 如果想在接口上配置以太網OAM遠端環回功能,建議先將DLDP發現單向鏈路後接口的關閉模式配置為手動模式,否則DLDP收到了由本接口發出的報文後會認為出現單向鏈路而自動關閉接口,從而導致以太網OAM遠端環回失敗。有關以太網OAM遠端環回的詳細介紹,請參見“可靠性配置指導”中的“以太網OAM”。
通過配置適當的DLDP認證模式和密碼,可以防止網絡攻擊和惡意探測。DLDP的認證模式包括:不認證、明文認證和MD5認證。
表1-11 配置DLDP的認證模式和密碼
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置當前設備與鄰居設備間的DLDP認證模式 |
dldp authentication-mode { md5 | none | simple } |
缺省情況下,當前設備與鄰居設備間的DLDP認證模式為不認證 |
配置當前設備與鄰居設備間的DLDP認證密碼 |
dldp authentication-password { cipher | simple } string |
缺省情況下,未配置當前設備與鄰居設備間的DLDP認證密碼 在配置認證模式為明文認證或MD5認證後若未配置認證密碼,則認證模式不生效 |
在完成上述配置後,在任意視圖下執行display命令可以顯示配置後DLDP的運行情況及報文統計信息,通過查看顯示信息驗證配置的效果。
在用戶視圖下執行reset命令可以清除DLDP報文統計信息。
表1-12 DLDP顯示和維護
操作 |
命令 |
顯示DLDP的全局配置信息和接口的DLDP信息 |
display dldp [ interface interface-type interface-number ] |
顯示接口的DLDP報文統計信息 |
display dldp statistics [ interface interface-type interface-number ] |
清除接口的DLDP報文統計信息 |
reset dldp statistics [ interface interface-type interface-number ] |
· Device A和Device B各自的接口GigabitEthernet1/0/1和GigabitEthernet1/0/2之間分別通過一對光纖進行連接。
· 要求通過配置DLDP功能,使接口上發生單向鏈路故障後由DLDP自動關閉故障接口,並在網絡管理員排除故障後,故障接口自動恢複。
圖1-5 DLDP配置組網圖(自動模式)
(1) 配置Device A
# 全局開啟DLDP功能。
<DeviceA> system-view
[DeviceA] dldp global enable
# 在接口GigabitEthernet1/0/1上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] duplex full
[DeviceA-GigabitEthernet1/0/1] speed 1000
[DeviceA-GigabitEthernet1/0/1] dldp enable
[DeviceA-GigabitEthernet1/0/1] quit
# 在接口GigabitEthernet1/0/2上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] duplex full
[DeviceA-GigabitEthernet1/0/2] speed 1000
[DeviceA-GigabitEthernet1/0/2] dldp enable
[DeviceA-GigabitEthernet1/0/2] quit
# 全局配置DLDP發現單向鏈路後接口的關閉模式為自動模式。
[DeviceA] dldp unidirectional-shutdown auto
(2) 配置Device B
# 全局開啟DLDP功能。
<DeviceB> system-view
[DeviceB] dldp global enable
# 在接口GigabitEthernet1/0/1上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] duplex full
[DeviceB-GigabitEthernet1/0/1] speed 1000
[DeviceB-GigabitEthernet1/0/1] dldp enable
[DeviceB-GigabitEthernet1/0/1] quit
# 在接口GigabitEthernet1/0/2上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceB] interface gigabitethernet 1/0/2
[DeviceB-GigabitEthernet1/0/2] duplex full
[DeviceB-GigabitEthernet1/0/2] speed 1000
[DeviceB-GigabitEthernet1/0/2] dldp enable
[DeviceB-GigabitEthernet1/0/2] quit
# 全局配置DLDP發現單向鏈路後接口的關閉模式為自動模式。
[DeviceB] dldp unidirectional-shutdown auto
配置完成後,通過使用display dldp命令可以查看DLDP的全局配置信息和接口上的DLDP信息。例如:
# 查看Device A上DLDP的全局配置信息和所有接口上的DLDP信息。
[DeviceA] display dldp
DLDP global status: Enabled
DLDP advertisement interval: 5s
DLDP authentication-mode: None
DLDP unidirectional-shutdown mode: Auto
DLDP delaydown-timer value: 1s
Number of enabled ports: 2
Interface GigabitEthernet1/0/1
DLDP port state: Bidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 1
Neighbor MAC address: 0023-8956-3600
Neighbor port index: 1
Neighbor state: Confirmed
Neighbor aged time: 11s
Neighbor echo time: -
Interface GigabitEthernet1/0/2
DLDP port state: Bidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 1
Neighbor MAC address: 0023-8956-3600
Neighbor port index: 2
Neighbor state: Confirmed
Neighbor aged time: 12s
Neighbor echo time: -
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2上的DLDP接口狀態均為Bidirectional,說明這兩個接口所在的鏈路均處於雙通狀態。
# 在Device A上配置允許日誌信息輸出到當前終端,且輸出的日誌信息最低為6級。
[DeviceA] quit
<DeviceA> terminal monitor
The current terminal is enabled to display logs.
<DeviceA> terminal logging level 6
<DeviceA>%Jul 11 17:40:31:089 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to down.
%Jul 11 17:40:31:091 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to down.
%Jul 11 17:40:31:677 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to down.
%Jul 11 17:40:31:678 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/2 changed to down.
%Jul 11 17:40:38:544 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to up.
%Jul 11 17:40:38:836 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to up.
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2的物理狀態都先down後up,而鏈路狀態則都down後未再up。網絡管理員進行進一步檢查:
# 查看Device A上DLDP的全局配置信息和所有接口上的DLDP信息。
<DeviceA> display dldp
DLDP global status: Enabled
DLDP advertisement interval: 5s
DLDP authentication-mode: None
DLDP unidirectional-shutdown mode: Auto
DLDP delaydown-timer value: 1s
Number of enabled ports: 2
Interface GigabitEthernet1/0/1
DLDP port state: Unidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 0 (Maximum number ever detected: 1)
Interface GigabitEthernet1/0/2
DLDP port state: Unidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 0 (Maximum number ever detected: 1)
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2上的DLDP接口狀態均為Unidirectional,說明這兩個接口所在的鏈路均處於單通狀態。
由此可知,DLDP在接口GigabitEthernet1/0/1和GigabitEthernet1/0/2上都檢測到了單向鏈路,並自動關閉了這兩個接口。經檢查,網絡管理員發現連接Device A和Device B的兩對光纖被錯誤地進行了交叉連接,於是他將這兩對光纖重新進行了正確連接。隨後,Device A上輸出了以下日誌信息:
<DeviceA>%Jul 11 17:42:57:709 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to down.
%Jul 11 17:42:58:603 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to down.
%Jul 11 17:43:02:342 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to up.
%Jul 11 17:43:02:343 2016 DeviceA DLDP/6/DLDP_NEIGHBOR_CONFIRMED: A neighbor was confirmed on interface GigabitEthernet1/0/1. The neighbor's system MAC is 0023-8956-3600, and the port index is 1.
%Jul 11 17:43:02:344 2016 DeviceA DLDP/6/DLDP_LINK_BIDIRECTIONAL: DLDP detected a bidirectional link on interface GigabitEthernet1/0/1.
%Jul 11 17:43:02:353 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to up.
%Jul 11 17:43:02:357 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to up.
%Jul 11 17:43:02:362 2016 DeviceA DLDP/6/DLDP_NEIGHBOR_CONFIRMED: A neighbor was confirmed on interface GigabitEthernet1/0/2. The neighbor's system MAC is 0023-8956-3600, and the port index is 2.
%Jul 11 17:43:02:362 2016 DeviceA DLDP/6/DLDP_LINK_BIDIRECTIONAL: DLDP detected a bidirectional link on interface GigabitEthernet1/0/2.
%Jul 11 17:43:02:368 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/2 changed to up.
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2的物理狀態和鏈路狀態均已up,並各自確定了DLDP鄰居,所在鏈路也變為雙通狀態。
· Device A和Device B各自的接口GigabitEthernet1/0/1和GigabitEthernet1/0/2之間分別通過一對光纖進行連接。
· 要求通過配置DLDP功能,使接口上發生單向鏈路故障後,需要由網絡管理員手工關閉和恢複故障接口。
圖1-6 DLDP配置組網圖(手動模式)
(1) 配置Device A
# 全局開啟DLDP功能。
<DeviceA> system-view
[DeviceA] dldp global enable
# 在接口GigabitEthernet1/0/1上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] duplex full
[DeviceA-GigabitEthernet1/0/1] speed 1000
[DeviceA-GigabitEthernet1/0/1] dldp enable
[DeviceA-GigabitEthernet1/0/1] quit
# 在接口GigabitEthernet1/0/2上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] duplex full
[DeviceA-GigabitEthernet1/0/2] speed 1000
[DeviceA-GigabitEthernet1/0/2] dldp enable
[DeviceA-GigabitEthernet1/0/2] quit
# 全局配置DLDP發現單向鏈路後接口的關閉模式為手動模式。
[DeviceA] dldp unidirectional-shutdown manual
(2) 配置Device B
# 全局開啟DLDP功能。
<DeviceB> system-view
[DeviceB] dldp global enable
# 在接口GigabitEthernet1/0/1上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] duplex full
[DeviceB-GigabitEthernet1/0/1] speed 1000
[DeviceB-GigabitEthernet1/0/1] dldp enable
[DeviceB-GigabitEthernet1/0/1] quit
# 在接口GigabitEthernet1/0/2上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceB] interface gigabitethernet 1/0/2
[DeviceB-GigabitEthernet1/0/2] duplex full
[DeviceB-GigabitEthernet1/0/2] speed 1000
[DeviceB-GigabitEthernet1/0/2] dldp enable
[DeviceB-GigabitEthernet1/0/2] quit
# 全局配置DLDP發現單向鏈路後接口的關閉模式為手動模式。
[DeviceB] dldp unidirectional-shutdown manual
配置完成後,通過使用display dldp命令可以查看DLDP的全局配置信息和接口上的DLDP信息。例如:
# 查看Device A上DLDP的全局配置信息和所有接口上的DLDP信息。
[DeviceA] display dldp
DLDP global status: Enabled
DLDP advertisement interval: 5s
DLDP authentication-mode: None
DLDP unidirectional-shutdown mode: Manual
DLDP delaydown-timer value: 1s
Number of enabled ports: 2
Interface GigabitEthernet1/0/1
DLDP port state: Bidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 1
Neighbor MAC address: 0023-8956-3600
Neighbor port index: 1
Neighbor state: Confirmed
Neighbor aged time: 11s
Neighbor echo time: -
Interface GigabitEthernet1/0/2
DLDP port state: Bidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 1
Neighbor MAC address: 0023-8956-3600
Neighbor port index: 2
Neighbor state: Confirmed
Neighbor aged time: 12s
Neighbor echo time: -
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2上的DLDP接口狀態均為Bidirectional,說明這兩個接口所在的鏈路均處於雙通狀態。
# 在Device A上配置允許日誌信息輸出到當前終端,且輸出的日誌信息最低為6級。
[DeviceA] quit
<DeviceA> terminal monitor
The current terminal is enabled to display logs.
<DeviceA> terminal logging level 6
此後某刻,網絡管理員在Device A上看到如下Log信息:
<DeviceA>%Jul 12 08:29:17:786 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to down.
%Jul 12 08:29:17:787 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to down.
%Jul 12 08:29:17:800 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to down.
%Jul 12 08:29:17:800 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/2 changed to down.
%Jul 12 08:29:25:004 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to up.
%Jul 12 08:29:25:005 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to up.
%Jul 12 08:29:25:893 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to up.
%Jul 12 08:29:25:894 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/2 changed to up.
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2的物理狀態和鏈路狀態都先down後up。網絡管理員進行進一步檢查:
# 查看Device A上DLDP的全局配置信息和所有接口上的DLDP信息。
<DeviceA> display dldp
DLDP global status: Enabled
DLDP advertisement interval: 5s
DLDP authentication-mode: None
DLDP unidirectional-shutdown mode: Manual
DLDP delaydown-timer value: 1s
Number of enabled ports: 2
Interface GigabitEthernet1/0/1
DLDP port state: Unidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 0 (Maximum number ever detected: 1)
Interface GigabitEthernet1/0/2
DLDP port state: Unidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 0 (Maximum number ever detected: 1)
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2上的DLDP接口狀態均為Unidirectional,說明這兩個接口所在的鏈路均處於單通狀態。
由此可知,DLDP在接口GigabitEthernet1/0/1和GigabitEthernet1/0/2上都檢測到了單向鏈路,但並未關閉這兩個接口。經檢查,網絡管理員發現連接Device A和Device B的兩對光纖被錯誤地進行了交叉連接,於是他分別將Device A的兩個接口手工關閉:
# 關閉接口GigabitEthernet1/0/1。
<DeviceA> system-view
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] shutdown
Device A上隨即輸出以下日誌信息:
[DeviceA-GigabitEthernet1/0/1]%Jul 12 08:34:23:717 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to down.
%Jul 12 08:34:23:718 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to down.
%Jul 12 08:34:23:778 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to down.
%Jul 12 08:34:23:779 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/2 changed to down.
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2的物理狀態和鏈路狀態均已變為down。
# 關閉接口GigabitEthernet1/0/2。
[DeviceA-GigabitEthernet1/0/1] quit
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] shutdown
然後,網絡管理員將連接Device A和Device B的兩對光纖重新進行了正確連接,檢查無誤後,他又分別將Device A的兩個接口重新打開:
# 打開接口GigabitEthernet1/0/2。
[DeviceA-GigabitEthernet1/0/2] undo shutdown
Device A上隨即輸出以下日誌信息:
[DeviceA-GigabitEthernet1/0/2]%Jul 12 08:46:17:677 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to up.
%Jul 12 08:46:17:678 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/2 changed to up.
%Jul 12 08:46:17:959 2016 DeviceA DLDP/6/DLDP_NEIGHBOR_CONFIRMED: A neighbor was confirmed on interface GigabitEthernet1/0/2. The neighbor's system MAC is 0023-8956-3600, and the port index is 2.
%Jul 12 08:46:17:959 2016 DeviceA DLDP/6/DLDP_LINK_BIDIRECTIONAL: DLDP detected a bidirectional link on interface GigabitEthernet1/0/2.
以上信息表明,接口GigabitEthernet1/0/2的物理狀態和鏈路狀態均已up,並確定了DLDP鄰居,所在鏈路也變為雙通狀態。
# 打開接口GigabitEthernet1/0/1。
[DeviceA-GigabitEthernet1/0/2] quit
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] undo shutdown
Device A上隨即輸出以下日誌信息:
[DeviceA-GigabitEthernet1/0/1]%Jul 12 08:48:25:952 2016 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to up.
%Jul 12 08:48:25:952 2016 DeviceA DLDP/6/DLDP_NEIGHBOR_CONFIRMED: A neighbor was confirmed on interface GigabitEthernet1/0/1. The neighbor's system MAC is 0023-8956-3600, and the port index is 1.
%Jul 12 08:48:25:953 2016 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to up.
%Jul 12 08:48:25:953 2016 DeviceA DLDP/6/DLDP_LINK_BIDIRECTIONAL: DLDP detected a bidirectional link on interface GigabitEthernet1/0/1.
以上信息表明,接口GigabitEthernet1/0/1的物理狀態和鏈路狀態均已up,並確定了DLDP鄰居,所在鏈路也變為雙通狀態。
· Device A和Device B各自的接口GigabitEthernet1/0/1和GigabitEthernet1/0/2之間分別通過一對光纖進行連接。
· 要求通過配置DLDP功能,使接口上發生單向鏈路故障後由DLDP自動關閉故障接口,並在網絡管理員排除故障後,手工恢複故障接口。
圖1-7 DLDP配置組網圖(混合模式)
(1) 配置Device A
# 全局開啟DLDP功能。
<DeviceA> system-view
[DeviceA] dldp global enable
# 在接口GigabitEthernet1/0/1上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] duplex full
[DeviceA-GigabitEthernet1/0/1] speed 1000
[DeviceA-GigabitEthernet1/0/1] dldp enable
[DeviceA-GigabitEthernet1/0/1] quit
# 在接口GigabitEthernet1/0/2上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] duplex full
[DeviceA-GigabitEthernet1/0/2] speed 1000
[DeviceA-GigabitEthernet1/0/2] dldp enable
[DeviceA-GigabitEthernet1/0/2] quit
# 全局配置DLDP發現單向鏈路後接口的關閉模式為混合模式。
[DeviceA] dldp unidirectional-shutdown hybrid
(2) 配置Device B
# 全局開啟DLDP功能。
<DeviceB> system-view
[DeviceB] dldp global enable
# 在接口GigabitEthernet1/0/1上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] duplex full
[DeviceB-GigabitEthernet1/0/1] speed 1000
[DeviceB-GigabitEthernet1/0/1] dldp enable
[DeviceB-GigabitEthernet1/0/1] quit
# 在接口GigabitEthernet1/0/2上配置雙工模式為全雙工、接口速率為1000Mbps,並開啟DLDP功能。
[DeviceB] interface gigabitethernet 1/0/2
[DeviceB-GigabitEthernet1/0/2] duplex full
[DeviceB-GigabitEthernet1/0/2] speed 1000
[DeviceB-GigabitEthernet1/0/2] dldp enable
[DeviceB-GigabitEthernet1/0/2] quit
# 全局配置DLDP發現單向鏈路後接口的關閉模式為混合模式。
[DeviceB] dldp unidirectional-shutdown hybrid
配置完成後,通過使用display dldp命令可以查看DLDP的全局配置信息和接口上的DLDP信息。例如:
# 查看Device A上DLDP的全局配置信息和所有接口上的DLDP信息。
[DeviceA] display dldp
DLDP global status: Enabled
DLDP advertisement interval: 5s
DLDP authentication-mode: None
DLDP unidirectional-shutdown mode: Manual
DLDP delaydown-timer value: 1s
Number of enabled ports: 2
Interface GigabitEthernet1/0/1
DLDP port state: Bidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 1
Neighbor MAC address: 0023-8956-3600
Neighbor port index: 1
Neighbor state: Confirmed
Neighbor aged time: 11s
Neighbor echo time: -
Interface GigabitEthernet1/0/2
DLDP port state: Bidirectional
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port’s neighbors: 1
Neighbor MAC address: 0023-8956-3600
Neighbor port index: 2
Neighbor state: Confirmed
Neighbor aged time: 12s
Neighbor echo time: -
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2上的DLDP接口狀態均為Bidirectional,說明這兩個接口所在的鏈路均處於雙通狀態。
# 在Device A上配置允許日誌信息輸出到當前終端,且輸出的日誌信息最低為6級。
[DeviceA] quit
<DeviceA> terminal monitor
The current terminal is enabled to display logs.
<DeviceA> terminal logging level 6
此後某刻,Device A上輸出了以下日誌信息:
<DeviceA>%Jan 4 07:16:06:556 2011 DeviceA DLDP/5/DLDP_NEIGHBOR_AGED: A neighbor on interface
GigabitEthernet1/0/1 was deleted because the neighbor was aged. The neighbor's system MAC is 0023-8956-3600, and the port index is 162.
%Jan 4 07:16:06:560 2011 DeviceA DLDP/5/DLDP_NEIGHBOR_AGED: A neighbor on interface
GigabitEthernet1/0/2 was deleted because the neighbor was aged. The neighbor's system MAC is 0023-8956-3600, and the port index is 165.
%Jan 4 07:16:06:724 2011 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to down.
%Jan 4 07:16:06:730 2011 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to down.
%Jan 4 07:16:06:736 2011 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to down.
%Jan 4 07:16:06:738 2011 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/2 changed to down.
%Jan 4 07:16:07:152 2011 DeviceA DLDP/3/DLDP_LINK_UNIDIRECTIONAL: DLDP detected a unidirectional link on interface GigabitEthernet1/0/1. DLDP automatically shut down the interface. Please manually bring up the interface.
%Jan 4 07:16:07:156 2011 DeviceA DLDP/3/DLDP_LINK_UNIDIRECTIONAL: DLDP detected a unidirectional link on interface GigabitEthernet1/0/2. DLDP automatically shut down the interface. Please manually bring up the interface.
以上信息表明,接口GigabitEthernet1/0/1的物理狀態與鏈路狀態都down了。網絡管理員進行進一步檢查:
# 查看Device A上DLDP的全局配置信息和所有接口上的DLDP信息。
<DeviceA> display dldp
DLDP global status: Enabled
DLDP advertisement interval: 5s
DLDP authentication-mode: None
DLDP unidirectional-shutdown mode: Hybrid
DLDP delaydown-timer value: 1s
Number of enabled ports: 2
Interface GigabitEthernet1/0/1
DLDP port state: Inactive
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port's neighbors: 0 (Maximum number ever detected: 1)
Interface GigabitEthernet1/0/2
DLDP port state: Inactive
DLDP port unidirectional-shutdown mode: None
DLDP initial-unidirectional-delay: 0s
Number of the port's neighbors: 0 (Maximum number ever detected: 1)
以上信息表明,接口GigabitEthernet1/0/1和GigabitEthernet1/0/2上的DLDP接口狀態均為Inactive,說明這兩個接口所在的鏈路均處於去激活狀態。
由此可知,DLDP在接口GigabitEthernet1/0/1和GigabitEthernet1/0/2上都檢測到了單向鏈路,且自動關閉了這兩個接口。
經檢查,網絡管理員發現Device B上連接DeviceA的兩個端口上的發光光纖被錯誤的進行了交叉連接。然後,網絡管理員將光纖重新進行正確連接,檢查無誤後,再將Device A的兩個接口重新打開:
# 打開接口GigabitEthernet1/0/1。
<DeviceA> system-view
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] undo shutdown
Device A上隨即輸出以下日誌信息:
[DeviceA-GigabitEthernet1/0/1]%Jan 4 07:33:26:574 2011 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to up.
%Jan 4 07:33:57:562 2011 DeviceA DLDP/6/DLDP_NEIGHBOR_CONFIRMED: A neighbor was confirmed on interface GigabitEthernet1/0/1. The neighbor's system MAC is 0023-8956-3600, and the port index is 162.
%Jan 4 07:33:57:563 2011 DeviceA DLDP/6/DLDP_LINK_BIDIRECTIONAL: DLDP detected a bidirectional link on interface GigabitEthernet1/0/1.
%Jan 4 07:33:57:590 2011 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to up.
%Jan 4 07:33:57:609 2011 DeviceA STP/6/STP_DETECTED_TC: Instance 0's port GigabitEthernet1/0/1 detected a topology change.
以上信息表明,接口GigabitEthernet1/0/1的物理狀態和鏈路狀態均已up,並確定了DLDP鄰居,所在鏈路也變為雙通狀態。
# 打開接口GigabitEthernet1/0/2。
[DeviceA-GigabitEthernet1/0/1] quit
[DeviceA] interface GigabitEthernet1/0/2
[DeviceA-GigabitEthernet1/0/2] undo shutdown
Device A上隨即輸出以下日誌信息:
[DeviceA-GigabitEthernet1/0/2]%Jan 4 07:35:26:574 2011 DeviceA IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/2 changed to up.
%Jan 4 07:35:57:562 2011 DeviceA DLDP/6/DLDP_NEIGHBOR_CONFIRMED: A neighbor was confirmed on interface GigabitEthernet1/0/2. The neighbor's system MAC is 0023-8956-3600, and the port index is 162.
%Jan 4 07:35:57:563 2011 DeviceA DLDP/6/DLDP_LINK_BIDIRECTIONAL: DLDP detected a bidirectional link on interface GigabitEthernet1/0/2.
%Jan 4 07:35:57:590 2011 DeviceA IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/2 changed to up.
%Jan 4 07:35:57:609 2011 DeviceA STP/6/STP_DETECTED_TC: Instance 0's port GigabitEthernet1/0/2 detected a topology change.
以上信息表明,接口GigabitEthernet1/0/2的物理狀態和鏈路狀態均已up,並確定了DLDP鄰居,所在鏈路也變為雙通狀態。
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!