1、
通过本实验可以掌握:
A.
B.
C.
D.
E.
2、
3、
R1:
R1#conf t
Enter configuration commands, one per line.
R1(config)#int s1/0
R1(config-if)#ip address 192.168.134.1 255.255.255.0
R1(config-if)#encapsulation frame-relay
R1(config-if)#frame-relay lmi-type cisco
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#int lo0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.168.134.0
R1(config-router)#network 192.168.1.0
【提示】
如果采用的Cisco路由器的IOS是11.2及以后版本的,路由器可以自动协商LMI的类型,所以可以不配置。
R3:
R3#conf t
Enter configuration commands, one per line.
R3(config)#int s1/1
R3(config-if)#ip address 192.168.134.3 255.255.255.0
R3(config-if)#encapsulation frame-relay
R3(config-if)#frame-relay lmi-type cisco
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#int lo0
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.134.0
R3(config-router)#network 192.168.3.0
R4:
R4#conf t
Enter configuration commands, one per line.
R4(config)#int s1/2
R4(config-if)#ip address 192.168.134.4 255.255.255.0
R4(config-if)#encapsulation frame-relay
R4(config-if)#frame-relay lmi-type cisco
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#int lo0
R4(config-if)#ip address 192.168.4.1 255.255.255.0
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#network 192.168.134.0
R4(config-router)#network 192.168.4.0
R2:帧中继配置
R2#conf t
Enter configuration commands, one per line.
R2(config)#frame-relay switching
R2(config)#int s1/0
R2(config-if)#clock rate 64000
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#frame-relay intf-type dce
R2(config-if)#frame-relay route 103 interface s1/1 301
R2(config-if)#frame-relay route 104 interface s1/2 401
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int s1/1
R2(config-if)#clock rate 64000
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay route 301 interface s1/0 103
R2(config-if)#frame-relay route 304 interface s1/2 403
R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#frame-relay intf-type dce
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int s1/2
R2(config-if)#clock rate 64000
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#frame-relay intf-type dce
R2(config-if)#frame-relay route 401 interface s1/0 104
R2(config-if)#frame-relay route 403 interface s1/1 304
R2(config-if)#no sh
4、
A、 show frame-relay map
该命令用来查看帧中继的映射
R1#show frame-relay map
Serial1/0 (up): ip 192.168.134.3 dlci 103(0x67,0x1870), dynamic,
Serial1/0 (up): ip 192.168.134.4 dlci 104(0x68,0x1880), dynamic,
R1#
R3#show frame-relay map
Serial1/1 (up): ip 192.168.134.1 dlci 301(0x12D,0x48D0), dynamic,
Serial1/1 (up): ip 192.168.134.4 dlci 304(0x130,0x4C00), dynamic,
R3#
R4#show frame-relay map
Serial1/2 (up): ip 192.168.134.1 dlci 401(0x191,0x6410), dynamic,
Serial1/2 (up): ip 192.168.134.3 dlci 403(0x193,0x6430), dynamic,
R4#
以上输出显示了帧中继逆向ARP的作用结果,表明路由器R1、R3和R4每个封装帧中继的接口都包含2条处于活动(active)状态的DLCI;每条记录都显示了远端的IP地址和本地的DLCI的映射关系;“broadcast”参数允许在PVC上传输广播货组播流量;“dynamic”表明是动态映射。
【提示】
以上实验我们注意到,每天路由器都不能ping通自己的串行口IP地址,但是可以ping通远端封装帧中继的串行口IP地址,因为自己的帧中继映射表中没有自己接口IP地址和DLCI的映射条目。采用逆向ARP做动态映射是解决不了该问题的,只有通过静态映射解决。
B、 show frame-relay pvc
R1#show frame-relay pvc
PVC Statistics for interface Serial1/0 (Frame Relay DTE)
//接口是帧中继的DTE
//输出表明该接口有2条处于活跃状态的PVC
DLCI = 103, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial1/0
//DLCI为103的PVC处于活跃状态,本地接口是S1/0,DLCI用途是LOCAL
DLCI = 104, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial1/0
【技术要点】
PVC状态有如下3种,每种的含义如下所述:
C、 show frame-relay lmi
R1#show frame-relay lmi
LMI Statistics for interface Serial1/0 (Frame Relay DTE) LMI TYPE = CISCO
//接口S1/0是帧中继的DTE,LMI类型为Cisco
//路由器向帧中继交换机发送的LMI状态查询消息的数量以及路由器从帧中继交换机收到到LMI状态信息的数量
R1#
D、 show ip route rip
R1#show ip route rip
R
R
R1#
R3#sh ip route rip
R
R
R3#
R4#sh ip route rip
R
R
R4#
以上输出表明各路由器的RIP路由信息正确。在本实验中,帧中继交换机在路由器R2上采用了PVC全互联的拓扑结构,但是在实际应用中,为了节省费用,一般采用中心-分支(Hub-and-Spoke)的拓扑结构,即只有分支到中心的PVC,假如路由器R1是中心路由器,路由器R2和R3是分支路由器,在路由器R2的配置修改如下:
R2(config)#int s1/1
R2(config-if)#no frame-relay route 304
R2(config)#int s1/2
R2(config-if)#no frame-relay route 403
此时再次查看路由表:
R1#show ip route rip
R
R
R1#
R3#sh ip route rip
R
R
R3#
R4#sh ip route rip
R
R
R4#
E、
R1(config)#int s1/0
R1(config-if)#no frame-relay inverse-arp
R1(config-if)#frame-relay map ip 192.168.134.3 103 broadcast
//配置帧中继静态映射
R1(config-if)#frame-relay map ip 192.168.134.4 104 broadcast
R1(config-if)#frame-relay map ip 192.168.134.1 104 broadcast
//配置到自己接口的IP地址的映射,目的是允许ping路由器该接口的IP地址
R3(config)#int s1/1
R3(config-if)#no frame-relay inverse-arp
R3(config-if)#frame-relay map ip 192.168.134.1 301 broadcast
R3(config-if)#frame-relay map ip 192.168.134.3 301 broadcast
R3(config-if)#frame-relay map ip 192.168.134.4 301 broadcast
R4(config)#int s1/2
R4(config-if)#no frame-relay inverse-arp
R4(config-if)#frame-relay map ip 192.168.134.1 401 broadcast
R4(config-if)#frame-relay map ip 192.168.134.3 401 broadcast
R4(config-if)#frame-relay map ip 192.168.134.4 401 broadcast
R1#show frame-relay map
Serial1/0 (up): ip 192.168.134.1 dlci 104(0x68,0x1880), static,
Serial1/0 (up): ip 192.168.134.3 dlci 103(0x67,0x1870), static,
Serial1/0 (up): ip 192.168.134.4 dlci 104(0x68,0x1880), static,
R1#
R3#show frame-relay map
Serial1/1 (up): ip 192.168.134.1 dlci 301(0x12D,0x48D0), static,
Serial1/1 (up): ip 192.168.134.3 dlci 301(0x12D,0x48D0), static,
Serial1/1 (up): ip 192.168.134.4 dlci 301(0x12D,0x48D0), static,
R3#
R4#show frame-relay map
Serial1/2 (up): ip 192.168.134.1 dlci 401(0x191,0x6410), static,
Serial1/2 (up): ip 192.168.134.3 dlci 401(0x191,0x6410), static,
Serial1/2 (up): ip 192.168.134.4 dlci 401(0x191,0x6410), static,
R4#
以上输出表明路由器R1、R3和R4每个封装了帧中继的接口下都采用静态映射
R1#sh ip route rip
R
R
R1#
R3#sh ip route rip
R
R
R3#
R4#sh ip route rip
R
R
R4#
以上输出表明各路由器的RIP路由信息正确,但是与上面动态映射实验的路由表相比,路由器R3的路由表中路由器R4环回口网络和路由器R4的路由表中路由器R3环回口网络的下一跳发生了变化,都指向路由器R1。
F、
R1#sh ip int s1/0
Serial1/0 is up, line protocol is up
在R1上重新打开水平分割,在各路由器上检查路由表
R1(config)#int s1/0
R1(config-if)#ip split-horizon
R1#clear ip route *
R1#sh ip route rip
R
R
R1#
//R1可以获得路由器R3和R4的环回口网络的路由
R3#sh ip route rip
R
R3#
R4#sh ip route rip
R
R4#
//同理,路由器R4也只能获得路由器R1的环回口网络的路由。