【实验】Frame-Relay帧中继实验

本文最后一次被修改是在:2016年11月26日0:52:43

Frame-Relay实验
Frame-Relay实验

实验需求:

  • R2和R3模拟运营商网络,之间用以太网连接;
  • 要求R1<->R6、R1<->R4和R1<->R5之间能通信(R1是Hub,R4/R5/R6是Spoke);
  • R1<->R2之间用IETF封装,LMI类型是ANSI,R1的IP地址是192.168.1.1;
  • R2<->R6之间用Cisco封装,LMI类型是Q933A,R6的IP地址是192.168.1.6;
  • R2<->R4之间用IETF封装,LMI类型是Q933A,R4的IP地址是192.168.1.4;
  • R3<->R5之间用Cisco封装,LMI类型是Cisco,R5的IP地址是192.168.1.5。
  • 还有一个需求是:R4和R6的IP地址还是192.168.1.4和192.168.1.6,R1开启子接口,有一个子接口的IP地址是192.168.1.1,还有一个子接口的IP地址是172.16.1.1, R5的IP地址是172.16.1.5;现在要求R1均能分别访问R4、R5和R6(实验三)。

实验环境:

操作系统:Windows 10(当时最新正式版),模拟器:GNS3 IOU for Mac 1.5.0(当时最新正式版)
注:当然,只要有思科模拟器都可以做这个实验

思路:

运营商部分,R2和R4之间使用Tunnel进行连接即可。

实验步骤:

实验一(不关闭Inverse-ARP):

运营商R2和R4的配置:

R2:

conf t
frame-relay switching

int s 6/0
en frame-relay ietf
frame-relay lmi-type ansi
frame-relay intf-type dce
frame-relay route 100 int tunnel 23 888
frame-relay route 200 int s 6/2 60
frame-relay route 300 int s 6/3 70
no sh

int s 6/2
en frame-relay ietf
frame-relay lmi-type q933a
frame-relay intf-type dce
frame-relay route 60 int s 6/0 200
no sh

int s 6/3
en frame-relay
frame-relay lmi-type q933a
frame-relay intf-type dce
frame-relay route 70 int s 6/0 300
no sh

int f 0/0
ip add 23.1.1.2 255.255.255.0
no sh

interface Tunnel23
tunnel source FastEthernet0/0
tunnel destination 23.1.1.3
no sh

R3:

conf t
frame-relay switching

int s 6/2
en frame-relay
frame-relay lmi-type cisco
frame-relay intf-type dce
frame-relay route 50 int tunnel 23 888
no sh

int f 0/0
ip add 23.1.1.3 255.255.255.0
no sh

interface Tunnel23
tunnel source FastEthernet0/0
tunnel destination 23.1.1.2
no sh

R1:

conf t

int s 6/0
en frame-relay ietf
frame-relay lmi-type ansi
ip add 192.168.1.1 255.255.255.0
no sh

R6:

conf t

int s 6/3
en frame-relay
frame-relay lmi-type q933a
ip add 192.168.1.6 255.255.255.0
no sh

R4:

conf t

int s 6/2
en frame-relay ietf
frame-relay lmi-type q933a
ip add 192.168.1.4 255.255.255.0
no sh

R5:

conf t

int s 6/2
en frame-relay
frame-relay lmi-type cisco
ip add 192.168.1.5 255.255.255.0
no sh

测试:

 R1#p 192.168.1.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/40 ms

R1#p 192.168.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/52/100 ms

R1#p 192.168.1.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/31/44 ms

一些show命令:

show frame-relay route 用在模拟帧中继交换机的路由器上,用来查看Frame-Relay的路由表:

R2#sh frame-relay route
Input Intf      Input Dlci      Output Intf     Output Dlci     Status
Serial6/0       100             Tunnel23        888             active
Serial6/0       200             Serial6/2       60              active
Serial6/0       300             Serial6/3       70              active
Serial6/2       60              Serial6/0       200             active
Serial6/3       70              Serial6/0       300             active
Tunnel23        888             Serial6/0       100             active

show frame-relay pvc 用在客户端上,可以查看客户端上收到的DLCI号和状态:

R1#sh frame-relay pvc

PVC Statistics for interface Serial6/0 (Frame Relay DTE)

              Active     Inactive      Deleted       Static
  Local          3            0            0            0
  Switched       0            0            0            0
  Unused         0            0            0            0

DLCI = 100, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial6/0

  input pkts 9             output pkts 9            in bytes 862       
  out bytes 862            dropped pkts 0           in pkts dropped 0         
  out pkts dropped 0                out bytes dropped 0         
  in FECN pkts 0           in BECN pkts 0           out FECN pkts 0         
  out BECN pkts 0          in DE pkts 0             out DE pkts 0         
  out bcast pkts 1         out bcast bytes 30        
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
  pvc create time 00:03:34, last time pvc status changed 00:03:34

DLCI = 200, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial6/0

  input pkts 16            output pkts 16           in bytes 1590      
  out bytes 1590           dropped pkts 0           in pkts dropped 0         
  out pkts dropped 0                out bytes dropped 0         
  in FECN pkts 0           in BECN pkts 0           out FECN pkts 0         
  out BECN pkts 0          in DE pkts 0             out DE pkts 0         
  out bcast pkts 1         out bcast bytes 30        
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
  pvc create time 00:03:54, last time pvc status changed 00:03:54

DLCI = 300, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial6/0

  input pkts 11            output pkts 11           in bytes 1070      
  out bytes 1070           dropped pkts 0           in pkts dropped 0         
  out pkts dropped 0                out bytes dropped 0         
  in FECN pkts 0           in BECN pkts 0           out FECN pkts 0         
  out BECN pkts 0          in DE pkts 0             out DE pkts 0         
  out bcast pkts 1         out bcast bytes 30        
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
  pvc create time 00:03:34, last time pvc status changed 00:03:34

Frame-Relay的四种DLCI状态:

  • ACTIVE状态:表示客户端(R1)连接到帧中继交换机(R2)这一段链路,和对端的帧中继交换机(R2/R3)连接到对端的客户端(R4/R5/R6)这一段链路,这两段链路都是正常的;
  • INACTIVE状态:表示客户端(R1)连接到帧中继交换机(R2)这段链路是正常的,但是对端的帧中继交换机(R2/R3)连接到对端的客户端(R4/R5/R6)这段链路是不正常的;
  • DELETED状态:表示客户端上配置了一个静态的DLCI映射,但是这个DLCI号在帧中继交换机上是不存在的。
  • STATIC状态:如果客户端和帧中继交换机两端都关闭了保活机制(配置命令是接口下敲no keepalive),那么这段链路就处在STATIC状态。
实验二(关闭Inverse-ARP):

Inverse-ARP指的是IARP反向地址解析协议 (Inverse Address Resolution Protocol) 。Inverse-ARP用于帧中继网络中IP地址和虚电路号的映射关系的动态维护主要用于帧中继网络。是一种在网络中建立动态路由的方法,让接入服务器能够知道与虚电路相关联的设备的网络地址。简而言之,Inverse-ARP用于在帧中继网络中自动建立路由器IP地址与帧中继DLCI的映射关系。

在实验二中,我们会关闭Inverse-ARP,所以IP地址与帧中继DLCI的之间映射关系我们需要手工写入。

注意:R2和R3的配置与实验一相同。

R1:

conf t

int s 6/0
en frame-relay ietf
frame-relay lmi-type ansi
ip add 192.168.1.1 255.255.255.0
no frame-relay inverse-arp
frame-relay map ip 192.168.1.5 100
frame-relay map ip 192.168.1.4 200
frame-relay map ip 192.168.1.6 300
no sh

R6:

conf t

int s 6/3
en frame-relay
frame-relay lmi-type q933a
ip add 192.168.1.6 255.255.255.0
no frame-relay inverse-arp
frame-relay map ip 192.168.1.1 70
no sh

R4:

conf t

int s 6/2
en frame-relay ietf
frame-relay lmi-type q933a
ip add 192.168.1.4 255.255.255.0
no frame-relay inverse-arp
frame-relay map ip 192.168.1.1 60
no sh

R5:

conf t

int s 6/2
en frame-relay
frame-relay lmi-type cisco
ip add 192.168.1.5 255.255.255.0
no frame-relay inverse-arp
frame-relay map ip 192.168.1.1 50
no sh

测试:

R1#p 192.168.1.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/26/40 ms

R1#p 192.168.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/49/92 ms

R1#p 192.168.1.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/32/44 ms

现在只建立了3个PVC,R1分别去连接R4/R5/R6,每两个Spoke之间都没有PVC,所以两个Spoke之间是没法通信的:

R4#p 192.168.1.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.6, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

R4#p 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/35/80 ms

在不添加额外的PVC的基础上,要想在两个Spoke之间进行通信,可以这么做:

R4:

int s 6/2
frame-relay map ip 192.168.1.6 60

R6:

int s 6/3
frame-relay map ip 192.168.1.4 70

因为关闭了Inverse-ARP,所以添加两条DLCI和IP地址的静态Inverse-ARP映射即可。让去往Spoke的数据发往Hub,让Hub去中转Spoke之间的数据。下面是测试:

R4#p 192.168.1.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/84/156 ms

R4#tra 192.168.1.6
Type escape sequence to abort.
Tracing the route to 192.168.1.6
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.1.1 8 msec 52 msec 76 msec
  2 192.168.1.6 84 msec 52 msec 84 msec
实验三(子接口,关闭Inverse-ARP):

注意:R2和R3的配置与实验一相同。

R1:

conf t

int s 6/0
en frame-relay ietf
frame-relay lmi-type ansi
no sh

int s 6/0.146 multipoint
ip add 192.168.1.1 255.255.255.0
no frame-relay inverse-arp
frame-relay map ip 192.168.1.4 200
frame-relay map ip 192.168.1.6 300

int s 6/0.5 point-to-point
ip add 172.16.1.1 255.255.255.0
no frame-relay inverse-arp
frame-relay interface-dlci 100 ietf

R6:

conf t

int s 6/3
en frame-relay
frame-relay lmi-type q933a
no sh

int s 6/3.123 point-to-point
ip add 192.168.1.6 255.255.255.0
no frame-relay inverse-arp
frame-relay interface-dlci 70

R4:

conf t

int s 6/2
en frame-relay ietf
frame-relay lmi-type q933a
no sh

int s 6/2.123 point-to-point
ip add 192.168.1.4 255.255.255.0
no frame-relay inverse-arp
frame-relay interface-dlci 60 ietf

R5:

conf t

int s 6/2
en frame-relay
frame-relay lmi-type cisco
no sh

int s 6/2.5 point-to-point
ip add 172.16.1.5 255.255.255.0
no frame-relay inverse-arp
frame-relay interface-dlci 50 cisco

测试:

完成以上配置后,R1不仅可以ping通同网段的R4和R6,还可以ping通不同网段的R5:

R1#p 192.168.1.4       
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/32/52 ms

R1#p 192.168.1.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/29/52 ms

R1#p 172.16.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/41/44 ms

R4和R6之间其实也是可以相互ping通的:

R4#p 192.168.1.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/92/132 ms
为什么R4能ping通R6呢?

首先我们看一下这三条Frame-Relay命令:

  1. frame-relay route 50 int tunnel 23 888:frame-relay route这条命令是在模拟帧中继交换机的路由器上配置的,用于创建frame-relay route。
  2. frame-relay map ip 192.168.1.1 50 或者 frame-relay map ip 192.168.1.1 50 broadcast:frame-relay map ip这条命令是在客户端上配置的。在关闭了Inverse-ARP以后,通过这条命令创建DLCI和IP地址的静态Inverse-ARP映射。如果在后面添加broadcast参数,表示可以转发组播和广播数据(因为Frame-Relay是NBMA网络,默认不支持广播或组播)。
  3. frame-relay interface-dlci 100 或者 frame-relay interface-dlci 100 ietf:frame-relay interface-dlci这条命令是在客户端上的点对点子接口(通过点对点子接口实现Frame-Relay)下配置的,这条命令表示通过该接口出去的数据默认都打上这个DLCI号,包括组播和广播数据。如果主接口用的IETF封装,建议在配置这条命令的时候多打上一个ietf参数(不打确实也可以通,IOS会继承主接口的封装,但是为了规范建议打上)。

通过上面对第三条命令(frame-relay interface-dlci 100 或者 frame-relay interface-dlci 100 ietf)的解释我们可以知道,R4在ping 192.168.1.6的时候,查路由表,然后就直接通过这个Frame-Relay接口出去了(同时打上frame-relay interface-dlci命令所指定的DLCI号),而这个DLCI号代表的PVC就是去往Hub(R1)的,Hub(R1)直接就可以转发这个数据给另一个Spoke(R6),所以就不需要额外的配置命令去实现Spoke和Spoke之间的通信了。

但是R4还不能ping通R5:

R4#p 192.168.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.5, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
为什么R4ping不通R5呢?

因为R4查路由表,不知道怎么去往172.16.1.0/24这个网段:

R4#sh ip route 
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set

      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Serial6/2.123
L        192.168.1.4/32 is directly connected, Serial6/2.123

R4和R5分别添加一条默认路由或者静态路由就可以通了:

R4:

ip route 172.16.1.0 255.255.255.0 192.168.1.1

R5:

ip route 192.168.1.0 255.255.255.0 172.16.1.1

现在R4可以ping通R5了:

R4#p 172.16.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 84/108/168 ms

R4#tra 172.16.1.5
Type escape sequence to abort.
Tracing the route to 172.16.1.5
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.1.1 80 msec 44 msec 28 msec
  2 172.16.1.5 108 msec 80 msec 76 msec

 

本文完。如有疑问,欢迎在下方留言;如本文有什么错误,欢迎在下方留言指正,谢谢。

Was this article helpful?

Related Articles

1 Comment

  1. 今天(2016年11月26日0:52:43)对本篇文章进行了修改,除了修复一些文章中原有的小错误以外,还增加了对 Inverse-ARP 的解释。

Leave A Comment?

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据