把一台Cisco路由器配置为帧中继交换机
1、实验目的
通过本实验可以掌握
A.理解帧中继交换机工作原理;
B.理解PVC的概念;
C.用路由器模拟帧中继交换机的配置。
2、网络拓扑图:
3、实验步骤
本实验把路由器R2配置成帧中继交换机
(一)开启帧中继交换机功能
R2(config)#frame-relayswitching
(二)配置接口封装帧中继
R2(config)#interfaces0/0
R2(config-if)#clock rate128000
R2(config-if)#encapsulation frame-relay //配置接口封装帧中继
R2(config-if)#no shutdown
【提示】
配置接口封装为帧中继,接口上启用的默认帧中继封装为Cisco封装。如果要连接到另一台Cisco路由器,则使用该选项;如果连接到非Cisco路由器,要使用ietf参数。
R2(config)#interface serial 0/1
R2(config-if)#clock rate 128000
R2(config-if)#encapsulation frame-relay
R2(config-if)#no shutdown
R2(config)#interface serial 0/2
R2(config-if)#clock rate 128000
R2(config-if)#encapsulation frame-relay
R2(config-if)#no shutdown
(三)配置帧中继LMI类型和接口类型
R2(config)#interface s0/0
R2(config-if)#frame-relay lmi-typecisco//配置LMI类型
R2(config-if)#frame-relay intf-typedce//配置接口为帧中继的DCE
【技术要点】
A、命令“frame-relay lmi-type { cisco | ansi | q933a}”用来配置LMI的类型,默认时是Cisco类型;
B、命令“frame-relay intf-type { dce |dte}”用来配置接口是帧中继的DCE还是DTE。要注意的是:帧中继接口DCE和物理接口端是DCE还是DTE无关,也就是说即使接口是DTE端,也可以把它配置成帧中继是DCE。
R2(config)#interface serial 0/1
R2(config-if)#frame-relay lmi-typecisco
R2(config-if)#frame-relay intf-type dce
R2(config)#interface serial 0/2
R2(config-if)#frame-relay lmi-typecisco
R2(config-if)#frame-relay intf-type dce
(四)配置路由器两个接口之间的PVC
R2(config)#interface serial 0/0
R2(config-if)#frame-relay route 103 interface s0/1301
//定义接口S0/0和S0/1之间的PVC,建立帧中继交换表
R2(config-if)#frame-relay route 104 interface s0/2401
//定义接口S0/0和S0/2之间的PVC,建立帧中继交换表
R2(config)#interface serial 0/1
R2(config-if)#frame-relay route 301 interfaceserial 0/0 103
R2(config-if)#frame-relay route 304 interfaceserial 0/2 403
R2(config)#interface serial 0/2
R2(config-if)#frame-relay route 401 interfaceserial 0/0 104
R2(config-if)#frame-relay route 403 interfaceserial 0/1 304
4、实验调试
A、show frame-relayroute
R2#sh frame-relay route
Input IntfInput DlciOutput IntfOutput DlciStatus
Serial0/0103Serial0/1301inactive
Serial0/0104Serial0/2401inactive
Serial0/1301Serial0/0103inactive
Serial0/1304Serial0/2403inactive
Serial0/2401Serial0/0104inactive
Serial0/2403Serial0/1304inactive
R2#
以上输出表明了路由器R2上配置了3条PVC,状态都是活动的,其中
“Serial0/0103Serial0/1301inactive”的含义是路由器如果从S0/0接口收到DLCI=103的帧,要从S0/1接口交换出去,并且DLCI被替换为301。
B、show frame-relaypvc
该命令用于显示路由器上配置的所有PVC的统计信息。
R2#sh frame-relay pvc interfaces0/0
PVC Statistics forinterface Serial0/0 (Frame Relay DCE)
//该接口是帧中继的DCE
ActiveInactiveDeletedStatic
Local0000
Switched0200
Unused0000
//输出表明该接口有2条处于活动状态的PVC
DLCI = 103, DLCI USAGE = SWITCHED, PVCSTATUS = INACTIVE, INTERFACE = Serial0/0
//DLCI为103的PVC处于活动状态,本地接口是S0/0,DLCI用途是完成帧中继DLCI交换
input pkts0output pkts 0in bytes 0
out bytes0dropped pkts 0in pkts dropped 0
out pkts dropped0out bytes dropped 0
in FECN pkts0in BECN pkts 0out FECN pkts 0
out BECN pkts0in DE pkts 0out DE pkts 0
out bcast pkts0out bcast bytes 0
30 second input rate0 bits/sec, 0 packets/sec
30 second output rate0 bits/sec, 0 packets/sec
switched pkts0
Detailed packet dropcounters:
no out intf0out intf down 0 noout PVC 0
in PVC down0out PVC down 0pkt too big 0
shaping Q full0pkt above DE 0policing drop 0
pvc create time00:28:35, last time pvc status changed 00:28:35
//以上输出是DLCI为103的PVC的统计信息
DLCI = 104, DLCI USAGE = SWITCHED, PVCSTATUS = INACTIVE, INTERFACE = Serial0/0
input pkts0output pkts 0in bytes 0
out bytes0dropped pkts 0in pkts dropped 0
out pkts dropped0out bytes dropped 0
in FECN pkts0in BECN pkts 0out FECN pkts 0
out BECN pkts0in DE pkts 0out DE pkts 0
out bcast pkts0out bcast bytes 0
30 second input rate0 bits/sec, 0 packets/sec
30 second output rate0 bits/sec, 0 packets/sec
switched pkts0
Detailed packet dropcounters:
no out intf0out intf down 0no out PVC 0
in PVC down0out PVC down 0pkt too big 0
shaping Q full0pkt above DE 0policing drop 0
pvc create time00:26:45, last time pvc status changed 00:26:45
//以上输出是DLCI为104的PVC的统计信息
R2#
C、show frame-relaylmi
该命令用来查看LMI的统计信息。
R2#sh frame-relay lmi
LMI Statistics for interface Serial0/0(Frame Relay DCE) LMI TYPE = CISCO
//接口S0/0是帧中继的DCE,LMI类型为Cisco
Invalid Unnumberedinfo 0Invalid Prot Disc 0
Invalid dummy CallRef 0Invalid Msg Type 0
Invalid StatusMessage 0Invalid Lock Shift 0
Invalid InformationID 0Invalid Report IE Len 0
Invalid ReportRequest 0Invalid Keep IE Len 0
Num Status Enq. Rcvd0Num Status msgs Sent 0
//帧中继交换机收到的LMI状态查询消息的数量以及从帧中继交换机向路由器发送的LMI状态信息的数量
Num Update StatusSent 0Num St Enq. Timeouts 232
//以上7行显示了接口S0/0的LMI的统计信息
LMI Statistics for interface Serial0/1(Frame Relay DCE) LMI TYPE = CISCO
Invalid Unnumberedinfo 0Invalid Prot Disc 0
Invalid dummy CallRef 0Invalid Msg Type 0
Invalid StatusMessage 0Invalid Lock Shift 0
Invalid InformationID 0Invalid Report IE Len 0
Invalid ReportRequest 0Invalid Keep IE Len 0
Num Status Enq. Rcvd0Num Status msgs Sent 0
Num Update StatusSent 0Num St Enq. Timeouts 185
//以上7行显示了接口S0/1的LMI的统计信息
LMI Statistics for interface Serial0/2(Frame Relay DCE) LMI TYPE = CISCO
Invalid Unnumberedinfo 0Invalid Prot Disc 0
Invalid dummy CallRef 0Invalid Msg Type 0
Invalid StatusMessage 0Invalid Lock Shift 0
Invalid InformationID 0Invalid Report IE Len 0
Invalid ReportRequest 0Invalid Keep IE Len 0
Num Status Enq. Rcvd0Num Status msgs Sent 0
Num Update StatusSent 0Num St Enq. Timeouts 181
//以上7行显示了接口S0/2的LMI的统计信息
R2#