實驗目的dom
實驗拓撲spa
實驗需求orm
實驗步驟接口
步驟1:設備的基本配置ip
配置R1:ci
Router>enableterminal
Router#configure terminalget
Router(config)#hostname R1it
R1(config)#no ip domain-lookupio
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#
實驗檢查
步驟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:使用CDP查看物理相連的設備信息
檢查R1上運行CDP的接口:
R1#show cdp interface
Ethernet0/0 is up, line protocol is up
Encapsulation ARPA
Sending CDP packets every 60 seconds //CDP報文每60秒發送一次
Holdtime is 180 seconds //CDP保持時間是180秒
Ethernet0/1 is up, line protocol is up
Encapsulation ARPA
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Ethernet0/2 is administratively down, line protocol is down
Encapsulation ARPA
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Ethernet0/3 is administratively down, line protocol is down
Encapsulation ARPA
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
cdp enabled interfaces : 4
interfaces up : 2
interfaces down : 2
R1的E0/0和E0/1接口已經運行CDP。
檢查R1上的CDP鄰居:
R1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW1 Eth 0/0 169 R S I Linux Uni Eth 0/0
R2 Eth 0/1 163 R B Linux Uni Eth 0/0
Total cdp entries displayed : 2
R1上可以看到SW1和R2兩個CDP鄰居。
檢查R1上的CDP條目:
R1#show cdp entry *
Device ID: SW1 //R1的CDP鄰居SW1
Entry address(es):
IP address: 192.168.1.1 //SW1的IP地址
Platform: Linux Unix, Capabilities: Router Switch IGMP
Interface: Ethernet0/0, Port ID (outgoing port): Ethernet0/0 //R1的E0/0鏈接到了SW1的E0/0
Holdtime : 132 sec
Version :
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 Cisco Systems, Inc.
Compiled Tue 23-Apr-19 02:38 by mmen
advertisement version: 2
VTP Management Domain: ''
Native VLAN: 1
Duplex: full
Management address(es):
IP address: 192.168.1.1
Device ID: R2 //R1的CDP鄰居R2
Entry address(es):
IP address: 192.168.12.2 //R2的IP地址
Platform: Linux Unix, Capabilities: Router Source-Route-Bridge
Interface: Ethernet0/1, Port ID (outgoing port): Ethernet0/0 //R1的E0/1鏈接到了R2的E0/0
Holdtime : 124 sec
Version :
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_team
advertisement version: 2
Management address(es):
IP address: 192.168.12.2
R1有兩個CDP鄰居,分別是SW1和R2。