- Nên xem lý thuyết CDP & LLDP tại đây trước khi xem phần này
- Sử dụng CDP trong Network Automation
Sơ đồ lab:
Yêu cầu:
1. Dùng các lệnh show cdp neighbors, show cdp neighbors detail trên R1 để xem thông tin của router láng giềng
2. Dùng các lệnh show cdp neighbors, show cdp entry * trên R2 để xem thông tin các router láng giềng
3. Tắt cdp trên Et0/0 của R1, dùng lệnh show cdp neighbors trên R2 kiểm tra và nhận xét
4. Cấu hình lldp trên R1 và R2, dùng lệnh show lldp neighbors để kiểm tra.
Chuẩn bị:
R1:
enableconf thostname R1interface Ethernet0/0description ===Connect to R2 Et0/1===ip address 192.168.12.1 255.255.255.0no shutdownexitdo wri
R2:
enableconf thostname R2interface Ethernet0/1description ===Connect to R1 Et0/0===ip address 192.168.12.2 255.255.255.0no shutdownexitinterface Ethernet0/2description ===Connect to R3 Et0/3===ip address 192.168.23.2 255.255.255.0no shutdownexitdo wri
R3:
enableconf thostname R3interface Ethernet0/3description ===Connect to R2 Et0/2===ip address 192.168.23.3 255.255.255.0no shutdownexitdo wri
Thực hiện:
1. Dùng các lệnh show cdp neighbors, show cdp neighbors detail trên R1 để xem thông tin của router láng giềng
R1:
R1>show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,D - Remote, C - CVTA, M - Two-port Mac RelayDevice ID Local Intrfce Holdtme Capability Platform Port IDR2 Eth 0/0 148 R B Linux Uni Eth 0/1Total cdp entries displayed : 1R1>
Nhận xét: R1 đang dùng port Eth 0/0 nối với port Eth 0/1 của R2. Platform: vì là làm trên lab ảo nên chổ này chỉ hiển thị là Linux Uni, nếu là thiết bị thật sẽ chổ này sẽ hiển thị đúng flatform của thiết bị
R1:
R1#show cdp neighbors detail
-------------------------Device ID: R2Entry address(es):IP address: 192.168.12.2Platform: Linux Unix, Capabilities: Router Source-Route-BridgeInterface: Ethernet0/0, Port ID (outgoing port): Ethernet0/1Holdtime : 158 secVersion :Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.4(1)T, DEVELOPMENT TEST SOFTWARETechnical Support: http://www.cisco.com/techsupportCopyright (c) 1986-2013 by Cisco Systems, Inc.Compiled Sat 23-Nov-13 03:28 by prod_rel_teamadvertisement version: 2Duplex: halfManagement address(es):IP address: 192.168.12.2Total cdp entries displayed : 1>R1#
Nhận xét: Láng giềng R2 có địa chỉ IP là: 192.168.12.2; hệ điều hành đang dùng là: I86BI_LINUX-ADVENTERPRISEK9-M
2. Dùng các lệnh show cdp neighbors, show cdp entry * trên R2 để xem thông tin các router láng giềng
R2#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,D - Remote, C - CVTA, M - Two-port Mac RelayDevice ID Local Intrfce Holdtme Capability Platform Port IDR3 Eth 0/2 136 R B Linux Uni Eth 0/3R1 Eth 0/1 138 R B Linux Uni Eth 0/0Total cdp entries displayed : 2R2#
R2#show cdp entry *-------------------------Device ID: R3Entry address(es):IP address: 192.168.23.3Platform: Linux Unix, Capabilities: Router Source-Route-BridgeInterface: Ethernet0/2, Port ID (outgoing port): Ethernet0/3Holdtime : 175 secVersion :Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.4(1)T, DEVELOPMENT TEST SOFTWARETechnical Support: http://www.cisco.com/techsupportCopyright (c) 1986-2013 by Cisco Systems, Inc.Compiled Sat 23-Nov-13 03:28 by prod_rel_teamadvertisement version: 2Duplex: halfManagement address(es):IP address: 192.168.23.3-------------------------Device ID: R1Entry address(es):IP address: 192.168.12.1Platform: Linux Unix, Capabilities: Router Source-Route-BridgeInterface: Ethernet0/1, Port ID (outgoing port): Ethernet0/0Holdtime : 174 secVersion :Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.4(1)T, DEVELOPMENT TEST SOFTWARETechnical Support: http://www.cisco.com/techsupportCopyright (c) 1986-2013 by Cisco Systems, Inc.Compiled Sat 23-Nov-13 03:28 by prod_rel_teamadvertisement version: 2Duplex: halfManagement address(es):IP address: 192.168.12.1R2#
R2#show cdp entry R3-------------------------Device ID: R3Entry address(es):IP address: 192.168.23.3Platform: Linux Unix, Capabilities: Router Source-Route-BridgeInterface: Ethernet0/2, Port ID (outgoing port): Ethernet0/3Holdtime : 165 secVersion :Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.4(1)T, DEVELOPMENT TEST SOFTWARETechnical Support: http://www.cisco.com/techsupportCopyright (c) 1986-2013 by Cisco Systems, Inc.Compiled Sat 23-Nov-13 03:28 by prod_rel_teamadvertisement version: 2Duplex: halfManagement address(es):IP address: 192.168.23.3R2#
int Et0/0
no cdp enable
R2#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,D - Remote, C - CVTA, M - Two-port Mac RelayDevice ID Local Intrfce Holdtme Capability Platform Port IDR3 Eth 0/2 173 R B Linux Uni Eth 0/3Total cdp entries displayed : 1R2#
conf tlldp run
R2#show lldp neighborsCapability codes:(R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device(W) WLAN Access Point, (P) Repeater, (S) Station, (O) OtherDevice ID Local Intf Hold-time Capability Port IDR1 Et0/1 120 R Et0/0Total entries displayed: 1R2#
R1#show lldp neighborsCapability codes:(R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device(W) WLAN Access Point, (P) Repeater, (S) Station, (O) OtherDevice ID Local Intf Hold-time Capability Port IDR2 Et0/0 120 R Et0/1Total entries displayed: 1R1#
No comments:
Post a Comment