实验要求:
1.设置1号线路的路由器名称为sibo1、 2号的线路sibo2、 3号线路为sibo3
2.配置路由器,以保证3层连通性
3.使用CDP命令观察路由器的连接
实验过程:
1. sibo1的配置
Router>enable
Password:
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname sibo1
2.查看路由器端口状态
sibo1#show ip interface brief
Interface IP-Address OK? Method StatusProtocol
Serial0/0 unassigned YES unset administrativelydowndown
Serial0/1 unassigned YES unset administratively down dow
注:status和protocol分别表示物理端口状态数据链路层状态。默认情况下,路由器的端口为“管理员性关闭”
3.设置路由器的一层连通性
sibo1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
sibo1(config)#interface serial 0
sibo1(config-if)#no shutdown------------------把端口手工打开
sibo1(config-if)#end
等待约30秒时间后
sibo1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Serial0 unassigned YES unset downdown
Serial1 unassigned YES unset administratively down down
注:现在的端口状态变成了物理down
虽然我们再端口下使用了no shutdown的命令,但是端口状态依然还是down,现实中原因可能有端口问题,线缆问题等物理问题。我们这个时候为了排错需要,把线路切换到2号线路。
Router>enable
Router#showip interface brief
Interface IP-Address OK? Method Status Protocol
Serial0 unassigned YES unset administratively downdown
Serial1 unassigned YES unset administratively downdown
注:连接到sibo1的serial 0端口为“管理员性关闭”,也就是说这个端口还没有电压载入,所以对端的状态就是物理性down
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname sibo2
sibo2(config)#interface serial 0
sibo2(config-if)#no shutdown
sibo2(config-if)#end
等待约30秒的网络延迟后
sibo2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Serial0 unassigned YES unset updown
Serial1 unassigned YES unset administratively down down
注:双方都手工打开了端口,这个时候状态为up。这个时候数据链路层为down,原因是线路中的DCE端口没有配置时钟频率
4.设置路由器的二层连通性
查看某一端口的线缆连接情况
sibo2#show controllers serial 0
省略
line state: up
cable type : V.11 (X.21) DCE cable, received clockrate 2015232
base0 registers=0x
mxt_ds=0x62AD6220, rx ring entries=78, tx ring entries=128
rxring=0x5D18580, rxr shadow=0x62619EF8, rx_head=40
txring=0x5D18820, txr shadow=0x
注:这个端口连接的是DCE端,需要在这个端口上配置时钟频率
省略
sibo2(config)#int s0
sibo2(config-if)#clock rate 64000
注:设置端口的时钟频率为64000 bit/s(
sibo2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Serial0 unassigned YES unset upup
Serial1 unassigned YES unset administratively down down
注:数据链路层UP
5.设置路由器的三层连通性
sibo1(config)#int s0
sibo1(config-if)#ip address 192.168.12.1 255.255.255.0
注:配置IP地址和子网掩码
sibo1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Serial0 192.168.12.1 YES manual up up
Serial1 unassigned YES unset administratively down down
注:查看到在serial0端口配置的IP地址为192.168.12.1
sibo2(config)#int serial 0
sibo2(config-if)#ip address 192.168.12.2 255.255.255.0
sibo2#ping 192.168.12.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
!!!!!------------ PING成功,不成功则为“…..”
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/70/108 ms
6.CDP的相关命令
sibo2#show cdp
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is enabled
注:路由器每60秒发送一次CDP信息抑制时间为180秒,也就是说经过180的时间依然没有接受到对方发来的CDP信息,则把对方从CDP邻居表中删除
sibo2#show cdp neighbors
Capability Codes: R - Router, T -
S - Switch, H - Host, I - IGMP, r - Repeater
Device ID Local IntrfceHoldtmeCapability Platform Port ID
sibo1Ser 0 122 R 2500 Ser 0
sibo1------对端路由器的名称
Ser 0--------连接到对端的本地接口名称
R------------对端为路由器
2500---------对端路由器的型号为2500系列
Ser 0------连接到本地路由器的对端接口名称
sibo2#show cdp entry *
*代表所有与本地路由器连接的情况,也可以查看和对端某一具体路由器的连接情况
Device ID: sibo1
Entry address(es):
IP address: 192.168.12.1------------对端的IP地址为192.168.12.1
Platform: Cisco 2500, Capabilities: Router Switch IGMP
Interface: Serial0, Port ID (outgoing port): Serial0
Holdtime : 179 sec
注意:要使用CDP信息,至少要保证二层连通性,也就是说,你的数据链路层至少要UP
设为首页 | 加入收藏 | 邮箱登陆 南京君诺鑫成网络科技有限公司版权所有 Copyright © 2008-2014 ICP备案号:苏ICP备10109038号
地址: 江苏省南京市珠江路435号华海大厦709室 邮编: 210018 电话: (86)25-83156292(10线) 传真: (86)25-83156290 邮箱: master@junovation.com