Thứ Tư, 21 tháng 9, 2011

CCNA – LAB 3: CDP


Trong bài lab này bạn sẽ dùng giao thức Cisco Discovery Protocol (CDP) để xem thông tin của các router hàng xóm.
1.    Để thực hành bạn sử dụng hai router kết nối với nhau bằng cáp serial, đặt ip như trong bài lab 2.
Router>enable
Router#configure terminal
Router(config)#hostname Router1
Router1(config)#interface Serial2/0
Router1(config-if)#ip address 192.168.100.1 255.255.255.0
Router1(config-if)#clock rate 64000
Router1(config-if)# no shutdown
Router>enable
Router#configure terminal
Router(config)#hostname Router2
Router2(config)#
Router2(config)#interface Serial2/0
Router2(config-if)#ip address 192.168.100.2 255.255.255.0
Router2(config-if)#no shutdown
2.    Trên Router1, để xem thông tin các hàng xóm cảu nó qua giao thức CDP.  Bạn dùng lệnh  sh cdp neighbors
Router1#sh 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
Router2 Ser 2/0          171            R       PT1000      Ser 2/0
3.    Nếu muốn xem chi tiết hơn bạn dùng lệnh show cdp neighbors detail hoặc lệnhshow cdp entry *
Router1#sh cdp neighbors detail
Device ID: Router2
Entry address(es):
IP address : 192.168.100.2
Platform: cisco PT1000, Capabilities: Router
Interface: Serial2/0, Port ID (outgoing port): Serial2/0
Holdtime: 156
Version :
Cisco Internetwork Operating System Software
IOS ™ PT1000 Software (PT1000-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Wed 27-Apr-04 19:01 by miwang
advertisement version: 2
Duplex: full
4.    Cũng trên Router1, để xem những interface nào đang được kích hoạt dịch vụ CDP dùng lệnh show cdp interface.
Router1#sh cd interface
FastEthernet0/0 is administratively down, line protocol is down
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
FastEthernet1/0 is administratively down, line protocol is down
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Serial2/0 is up, line protocol is up
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Serial3/0 is administratively down, line protocol is down
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
FastEthernet4/0 is administratively down, line protocol is down
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
FastEthernet5/0 is administratively down, line protocol is down
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
5.    Từ lệnh trên bạn thấy cứ 60 giây thì router gửi thông tin của nó cho hàng xóm, và cứ 180 giây không liên lạc với hàng xóm được thì nó ngắt kết nối. Để thay đổi hai thông số này thành 50 và 170 bạn dùng các lệnh cdp timer 50 và cdp holdtime 170.
Router1(config)#  cdp timer 50
Router1(config)#  cdp holdtime 170
Router1(config)#  exit
Router1# sh cdp interface

0 nhận xét:

Đăng nhận xét