温馨提示:欢迎对技术感兴趣的新手朋友们,希望这些知识点能对大家有帮助。如果有什么不解或疑惑或建议,可留言小编或邮件2355331040@qq.com,我将尽快给予解决。感谢大家的支持和关注,谢谢!!!
实验目的
1、了解链路层发现协议LLDP的运行原理
2、掌握链路层发现协议LLDP的配置方法
实验拓扑
实验需求
1、根据实验拓扑图,完成设备的基本配置;
2、在R1上使用LLDP查看SW1和R2的设备信息;
3、注意:LLDP默认关闭,需要手工打开。
实验步骤
步骤1:设备的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#exit
SW1(config)#interface vlan 1
SW1(config-if)#ip address 192.168.1.1 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#ip default-gateway 192.168.1.254
SW1(config)#end
SW1#
步骤2:配置LLDP
配置R1:
R1>enable
R1#configure terminal
R1(config)#lldp run //运行LLDP
配置R2:
R2>enable
R2#configure terminal
R2(config)#lldp run
配置SW1:
SW1>enable
SW1#configure terminal
SW1(config)#lldp run
步骤1:检查设备的接口状态
检查R1:
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 192.168.1.254 YES manual up up
Ethernet0/1 192.168.12.1 YES manual up up
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
R1使用到的接口已经配置好IP地址,并且是up up状态。
检查R2:
R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 192.168.12.2 YES manual up up
Ethernet0/1 unassigned YES TFTP administratively down down
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
R2使用到的接口已经配置好IP地址,并且是up up状态。
检查SW1:
SW1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 unassigned YES unset up up
Ethernet0/2 unassigned YES unset up up
Ethernet0/3 unassigned YES unset up up
Vlan1 192.168.1.1 YES manual up up
SW1使用到的接口已经配置好IP地址,并且是up up状态。
步骤2:使用LLDP查看物理相连的设备信息
检查R1上运行LLDP的接口:
R1#show lldp interface
Ethernet0/0:
Tx: enabled
Rx: enabled
Tx state: IDLE
Rx state: WAIT FOR FRAME
Ethernet0/1:
Tx: enabled
Rx: enabled
Tx state: IDLE
Rx state: WAIT FOR FRAME
Ethernet0/2:
Tx: enabled
Rx: enabled
Tx state: INIT
Rx state: WAIT PORT OPER
Ethernet0/3:
Tx: enabled
Rx: enabled
Tx state: INIT
--More--
R1的E0/0和E0/1接口已经运行LLDP。
- 检查R1上的LLDP邻居:
R1#show lldp neighbors
Capability codes:
(R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
(W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
Device ID Local Intf Hold-time Capability Port ID
SW1 Et0/0 120 R Et0/0
R2 Et0/1 120 R Et0/0
Total entries displayed: 2
R1上能够看到SW1和R2两个LLDP邻居。
检查R1上的LLDP条目:
R1#show lldp entry *
Capability codes:
(R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
(W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
Local Intf: Et0/0 //R1本端的接口
Chassis id: aabb.cc00.3000
Port id: Et0/0 //对端的接口
Port Description: Ethernet0/0
System Name: SW1 //对端设备的主机名
System Description:
Cisco IOS Software, Linux Software (I86BI_LINUXL2-ADVENTERPRISEK9-M), Version 15.2(CML_NIGHTLY_20190423)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to V152_6_0_81_E
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by
Time remaining: 103 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses:
IP: 192.168.1.1 //SW1的IP地址
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
Local Intf: Et0/1
Chassis id: aabb.cc00.2000
Port id: Et0/0
Port Description: Ethernet0/0
System Name: R2
System Description:
Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.7(3)M2, DEVELOPMENT TEST SOFTWARE
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisco Systems, Inc.
Compiled Wed 28-Mar-18 11:18 by prod_rel_te
Time remaining: 98 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses:
IP: 192.168.12.2
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
Total entries displayed: 2
R1有两个CDP邻居,分别是SW1和R2。
原文来自:微思网络
原文地址:https://mp.weixin.qq.com/s/eQ...
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。