2009年5月7日

CCNA - CDP Cisco Discovery Protocol

CCNA - CDP Cisco Discovery Protocol

幫管理員蒐集相連網路設備的相關資訊
用來產生網路拓樸圖(Network Topology)

顯示 Router CDP 的設定參數
Router#show cdp
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is enabled


cdp run 或 no cdp run 是針對整部 Router 設定是否開啟 CDP 功能
Router(config)#cdp ?

想設定某個介面開啟或不開啟CDP,則必須進入到該介面,利用 cdp enable 開啟CDP,或 no cdp enable 關閉這個介面的CDP
Router(config-if)#cdp ?
enable  Enable CDP on interface


CDP 兩個重要的參數分別為 timer 與 holdtime
CDP timer :設定每幾秒送出一次 CDP 訊息 (default 60s)
CDP holdtime :設定所收到的 CDP 訊息要保留幾秒 (default 180s)
變更設定
Router(config)#cdp timer 120
Router(config)#cdp ?holdtime 240


顯示直接連接網路設備的相關資訊(由CDP所傳送過來的)
Router#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
Router       Fas 0/1          135            R       C2800       Fas 0/0


更詳細的資訊
Router#show cdp neighbors detail
如果 detail 寫得太囉唆,你也可以用
show cdp entry * protocol 看直接相連鄰居的IP
show cdp entry * version  看直接相連輪居的 IOS 版本

觀看執行 CDP 介面,若某一PORT被 no cdp enable 就不會出現在 show cdp interface 的資訊中
Router#show cdp interface
Vlan1 is administratively down, line protocol is down
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
FastEthernet0/0 is up, line protocol is down
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
FastEthernet0/1 is up, line protocol is up
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds


最後來說說,如何利用 CDP 找出 Network Topology
   1. show running-conf 找出每個界面的IP位址
   2. show cdp neighbor 找出直接相連的 Router 鄰居
   3. show cdp neighbors detail 或 show cdp entry * protocol 找出直接相連設備的IP
   4. 再用 Step 3 所找到的 IP ,recursive 的延伸下去,直到把整個網路拓樸圖建完
註:CDP 這通訊協定無法「穿過」router ,所以找到(收到)的資訊都來自直接相連的網路設備。
甘蔗築夢田 -Cisco CDP - 探索協定 Cisco Discovery Protocol
http://blog.xuite.net/tolarku/blog/20422806

What are two reasons a network administrator would use CDP? (Choose two.)
一個網路管理員使用 CDP 的兩個原因?
A. to verify the type of cable interconnecting two devices
來證實鏈接兩台設備的電纜類型
B. to determine the status of network services on a remote device
為了在遠程設備上查看網路服務的狀態
C. to obtain VLAN information from directly connected switches
為了從直連的交換器上獲取 VLAN的訊息
D. to verify Layer 2 connectivity between two devices when Layer 3 fails
為了在兩台設備間當 3 層 down 掉的時候查看 2 層的連通性
E. to obtain the IP address of a connected device in order to telnet to the device
為了獲取一個直連設備的 IP地址以 telnet那個設備
F. to determine the status of the routing protocols between directly connected routers
為了在直連路由器之間查看路由協議的狀態

Answer: DE

沒有留言: