GNS3模拟帧中继的两种方法.docx
GNS3模拟帧中继的两种方法一、 使用帧中继交换机 1.1 实验拓扑 1.2 配置示例 1. 帧中继交换机配置 2. 路由器配置脚本 Ø R1 R1>en R1#conf t R1(config)#int R1(config)#interface s 1/0 R1(config-if)#no sh R1(config-if)#ip add 192.168.1.1 255.255.255.0 R1(config-if)#encapsulation frame-relay /设置封装模式 R1(config-if)#serial restart-delay 0 R1(config-if)#frame-relay map ip 192.168.1.2 102 /创建映射 R1(config-if)#frame-relay map ip 192.168.1.3 103 R1(config-if)#no frame-relay inverse-arp /关闭inverse-arp R1(config-if)# Ø R2 R2> R2>en R2#conf t R2(config)#int s 1/0 R2(config-if)#ip add 192.168.1.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#encapsulation frame-relay R2(config-if)#frame-relay map ip 192.168.1.1 201 R2(config-if)#frame-relay map ip 192.168.1.3 203 R2(config-if)#no frame-relay inverse-arp R2(config-if)# Ø R3 R3>en R3#conf t R3(config)#int s 1/0 R3(config-if)#ip add 192.168.1.3 255.255.255.0 R3(config-if)#no sh R3(config-if)#encapsulation frame-relay R3(config-if)#frame-relay map ip 192.168.1.1 301 R3(config-if)#frame-relay map ip 192.168.1.2 302 R3(config-if)#no frame-relay inverse-arp R3(config-if)# 3. 验证 R3(config-if)#do ping 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 = 32/61/88 ms R3(config-if)#do ping 192.168.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: ! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/47/88 ms R3(config-if)# 全网互通 R3(config-if)#do show fram ma Serial1/0 (up): ip 192.168.1.1 dlci 301(0x12D,0x48D0), static, CISCO, status defined, active Serial1/0 (up): ip 192.168.1.2 dlci 302(0x12E,0x48E0), static, CISCO, status defined, active R3(config-if)# 使用的是静态映射 二、 使用路由器模拟帧中继交换机 2.1 实验拓扑 2.2 配置示例 1. R1模拟帧中继交换机配置脚本 配置如下 R1>en R1#conf t R1(config)#frame-relay switching /把路由器设置为帧中继交换机 R1(config)#int s 1/0 R1(config-if)#no sh R1(config-if)#no ip add R1(config-if)#encapsulation frame-relay R1(config-if)#clock rate 64000 R1(config-if)#frame-relay lmi-type ansi /设置帧中继协议为ansi R1(config-if)#frame-relay intf-type dce /帧中继交换机作为DCE端 R1(config-if)#serial restart-delay 0 R1(config-if)#frame-relay route 203 interface s 1/1 302/设置帧中继内部交换 R1(config-if)#frame-relay route 204 interface s 1/2 402 R1(config-if)#int s 1/1 R1(config-if)#no sh R1(config-if)#no ip add R1(config-if)#encapsulation frame-relay R1(config-if)#frame-relay lmi-type ansi R1(config-if)#frame-relay intf-type dce R1(config-if)#serial restart-delay 0 R1(config-if)#frame-relay route 302 interface serial 1/0 203 R1(config-if)#frame-relay route 304 interface s 1/2 403 R1(config-if)#int s 1/2 R1(config-if)#no sh R1(config-if)#no ip add R1(config-if)#encapsulation frame-relay R1(config-if)#serial restart-delay 0 R1(config-if)#clock rate 64000 R1(config-if)#frame-relay lmi-type ansi R1(config-if)#frame-relay intf-type dce R1(config-if)#frame-relay route 402 int s 1/0 204 R1(config-if)#fra route 403 int s 1/1 304 2. 其他路由器配置脚本 Ø R2 R2>en R2#conf t R2(config)#int s 1/0 R2(config-if)#no sh R2(config-if)#ip add 192.168.1.2 255.255.255.0 R2(config-if)#encapsulation frame-relay R2(config-if)#serial restart-delay 0 Ø R3 R3> R3>en R3#conf t Enter configuration commands, one per line. End with CNTL/Z. R3(config)#int s 1/0 R3(config-if)#no sh R3(config-if)#ip add 192.168.1.3 255.255.255.0 R3(config-if)#encapsulation frame-relay Ø R4 R4>en R4#conf t R4(config)#int s 1/0 R4(config-if)#no sh R4(config-if)#ip add 192.168.1.4 255.255.255.0 R4(config-if)#encapsulation frame-relay 3. 验证 R4(config-if)#do show fram ma Serial1/0 (up): ip 192.168.1.2 dlci 402(0x192,0x6420), dynamic, broadcast, status defined, active Serial1/0 (up): ip 192.168.1.3 dlci 403(0x193,0x6430), dynamic, broadcast, status defined, active R4(config-if)# 使用的是动态的映射,inverse-arp R4(config-if)#do ping 192.168.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: ! Success rate is 100 percent (5/5), round-trip min/avg/max = 64/95/132 ms R4(config-if)#do ping 192.168.1.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds: ! Success rate is 100 percent (5/5), round-trip min/avg/max = 56/107/144 ms R4(config-if)# 全网互通 ² 备注: Inverse ARP用于帧中继网络中IP地址和虚电路号的映射关系的动态维护 4. 关闭Inverse ARP 使用静态map映射 R2(config-if)#no frame-relay inverse-arp R2(config-if)#do cle fram in /清除动态学到哦映射 R3(config-if)#no frame-relay inverse-arp R3(config-if)#do cle fram in R4(config-if)#no frame-relay inverse-arp R4(config-if)#do cle fram in R4(config-if)#do ping 192.168.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: . Success rate is 0 percent (0/5) R4(config-if)#do ping 192.168.1.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds: . Success rate is 0 percent (0/5) R4(config-if)# 配置静态映射 R2(config-if)#frame-relay map ip 192.168.1.3 203 R2(config-if)#frame-relay map ip 192.168.1.4 204 R2(config-if)# R3(config-if)#frame-relay map ip 192.168.1.2 302 R3(config-if)#frame-relay map ip 192.168.1.3 304 R3(config-if)#frame-relay map ip 192.168.1.4 304 R3(config-if)#no frame-relay map ip 192.168.1.3 304 R3(config-if)# R4(config-if)#frame-relay m R4(config-if)#frame-relay ma R4(config-if)#frame-relay map ip 192.168.1.2 402 R4(config-if)#fram R4(config-if)#frame-relay ma R4(config-if)#frame-relay map ip 192.168.1.3 403 R4(config-if)# R4(config-if)#do ping 192.168.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: ! Success rate is 100 percent (5/5), round-trip min/avg/max = 60/87/140 ms R4(config-if)#do ping 192.168.1.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds: ! Success rate is 100 percent (5/5), round-trip min/avg/max = 48/83/144 ms R4(config-if)# R4(config-if)#do show fram ma Serial1/0 (up): ip 192.168.1.2 dlci 402(0x192,0x6420), static, CISCO, status defined, active Serial1/0 (up): ip 192.168.1.3 dlci 403(0x193,0x6430), static, CISCO, status defined, active R4(config-if)#