思科帧中继试验:
R1是中心,R2R3是分支,R4是FRSW
R1—102—FR—201—R2
R1—103—FR—301—R3
FR-SW:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname FR-SW
FR-SW(config)#frame-relay switching (开启帧中继交换机功能)
FR-SW(config)#interface serial 2/0
FR-SW(config-if)#encapsulation frame-relay ietf (选择使用标准)
FR-SW(config-if)#frame-relay intf-type dce (设置为DCE端)
FR-SW(config-if)#frame-relay lmi-type ansi (LMI使用ansi)
FR-SW(config-if)#no shutdown
FR-SW(config-if)#exit
FR-SW(config)#interface serial 2/1
FR-SW(config-if)#encapsulation frame-relay
FR-SW(config-if)#frame-relay intf-type dce
FR-SW(config-if)#frame-relay lmi-type cisco
FR-SW(config-if)#no shutdown
FR-SW(config-if)#exit
FR-SW(config)#interface serial 2/2
FR-SW(config-if)#encapsulation frame-relay
FR-SW(config-if)#frame-relay intf-type dce
FR-SW(config-if)#frame-relay lmi-type cisco
FR-SW(config-if)#no shutdown
FR-SW(config-if)#frame-relay route 301 interface serial 2/0 103 ——R3到R1
FR-SW(config-if)#exit
FR-SW(config)#interface serial 2/0
FR-SW(config-if)#frame-relay route 102 interface serial 2/1 201 ——R1到R2
FR-SW(config-if)#frame-relay route 103 interface serial 2/2 301 ——R1到R3
FR-SW(config-if)#exit
FR-SW(config)#interface serial 2/1
FR-SW(config-if)#frame-relay route 201 interface serial 2/0 102 ——R3到R1
FR-SW(config-if)#exit
FR-SW(config)#end
FR-SW#show ip interface b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset administratively down down
Ethernet0/1 unassigned YES unset administratively down down
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
Serial1/0 unassigned YES unset administratively down down
Serial1/1 unassigned YES unset administratively down down
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Serial2/0 unassigned YES unset up down
Serial2/1 unassigned YES unset up down
Serial2/2 unassigned YES unset up down
FR-SW#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset administratively down down
Ethernet0/1 unassigned YES unset administratively down down
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
Serial1/0 unassigned YES unset administratively down down
Serial1/1 unassigned YES unset administratively down down
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Serial2/0 unassigned YES unset up up
Serial2/1 unassigned YES unset up up
Serial2/2 unassigned YES unset up up
Serial2/3 unassigned YES unset administratively down down
FR-SW#
FR-SW#show frame-relay pvc
PVC Statistics for interface Serial2/0 (Frame Relay DCE)
Active Inactive Deleted Static
Local 0 0 0 0
Switched 2 0 0 0
Unused 0 0 0 0
DLCI = 102, DLCI USAGE = SWITCHED, PVC STATUS = ACTIVE, INTERFACE = Serial2/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 0 out bcast bytes 0
30 second input rate 0 bits/sec, 0 packets/sec
30 second output rate 0 bits/sec, 0 packets/sec
switched pkts 11
Detailed packet drop counters:
no out intf 0 out intf down 0 no out PVC 0
in PVC down 0 out PVC down 0 pkt too big 0
shaping Q full 0 pkt above DE 0 policing drop 0
connected to interface Serial2/1 201
pvc create time 00:06:26, last time pvc status changed 00:02:05
DLCI = 103, DLCI USAGE = SWITCHED, PVC STATUS = ACTIVE, INTERFACE = Serial2/0
input pkts 15 output pkts 15 in bytes 1486
out bytes 1486 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 0 out bcast bytes 0
30 second input rate 0 bits/sec, 0 packets/sec
30 second output rate 0 bits/sec, 0 packets/sec
switched pkts 15
Detailed packet drop counters:
no out intf 0 out intf down 0 no out PVC 0
in PVC down 0 out PVC down 0 pkt too big 0
shaping Q full 0 pkt above DE 0 policing drop 0
connected to interface Serial2/2 301
pvc create time 00:06:07, last time pvc status changed 00:01:15
PVC Statistics for interface Serial2/1 (Frame Relay DCE)
Active Inactive Deleted Static
Local 0 0 0 0
Switched 1 0 0 0
Unused 0 0 0 0
DLCI = 201, DLCI USAGE = SWITCHED, PVC STATUS = ACTIVE, INTERFACE = Serial2/1
input pkts 12 output pkts 11 in bytes 1104
out bytes 1070 dropped pkts 2 in pkts dropped 2
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 0 out bcast bytes 0
30 second input rate 0 bits/sec, 0 packets/sec
30 second output rate 0 bits/sec, 0 packets/sec
switched pkts 11
Detailed packet drop counters:
no out intf 0 out intf down 0 no out PVC 0
in PVC down 0 out PVC down 2 pkt too big 0
shaping Q full 0 pkt above DE 0 policing drop 0
connected to interface Serial2/0 102
pvc create time 00:05:41, last time pvc status changed 00:02:08
PVC Statistics for interface Serial2/2 (Frame Relay DCE)
Active Inactive Deleted Static
Local 0 0 0 0
Switched 1 0 0 0
Unused 0 0 0 0
DLCI = 301, DLCI USAGE = SWITCHED, PVC STATUS = ACTIVE, INTERFACE = Serial2/2
input pkts 16 output pkts 15 in bytes 1520
out bytes 1486 dropped pkts 2 in pkts dropped 2
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 0 out bcast bytes 0
30 second input rate 0 bits/sec, 0 packets/sec
30 second output rate 0 bits/sec, 0 packets/sec
switched pkts 15
Detailed packet drop counters:
no out intf 0 out intf down 0 no out PVC 0
in PVC down 0 out PVC down 2 pkt too big 0
shaping Q full 0 pkt above DE 0 policing drop 0
connected to interface Serial2/0 103
pvc create time 00:07:01, last time pvc status changed 00:01:24
FR-SW#
R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#interface serial 1/0
R1(config-if)#encapsulation frame-relay ietf
R1(config-if)#frame-relay intf-type dte (默认是DTE)
R1(config-if)#frame-relay lmi-type ansi (要与FRSW设置相对应)
R1(config-if)#no shutdown
R1(config-if)#ip address 123.1.1.1 255.255.255.0
R1(config-if)#exit
R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#interface serial 1/0
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay intf-type dte
R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#ip address 123.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R3:
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#interface serial 1/0
R3(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay intf-type dte
R3(config-if)#frame-relay lmi-type cisco
R3(config-if)#no shutdown
R3(config-if)#ip address 123.1.1.3 255.255.255.0
R3(config-if)#exit
PING:
R1>ping 123.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 123.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 19/20/21 ms
R1>ping 123.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 123.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 19/21/25 ms
R1>
show:
R1#show frame-relay map
Serial1/0 (up): ip 123.1.1.2 dlci 102(0x66,0x1860), dynamic,
broadcast,
IETF, status defined, active
Serial1/0 (up): ip 123.1.1.3 dlci 103(0x67,0x1870), dynamic,
broadcast,
IETF, status defined, active
R2与R3联通:(并启用微广播特性)
R2:
R2(config)#interface serial 1/0
R2(config-if)#frame-relay map ip 123.1.1.3 201 broadcast (+ietf改为ietf的)
R3:
R3(config)#interface serial 1/0
R3(config-if)#frame-relay map ip 123.1.1.2 301 broadcast
R3(config-if)#end
R3#ping 123.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 123.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 39/42/45 ms
R3#
若ping自己IP则需要添加
R1:
R1(config)interface serial 1/0
R1(config-if)#frame-relay map ip 123.1.1.1 103 broadcast ietf
R2与R3同R1
添加环回口,启用RIP协议
loopback0:
R1:1.1.1.1/32
R2:2.2.2.2/32
R3:3.3.3.3/32
R1/2/3启用RIP:
router rip
version 2
no auto-summary
network x.x.x.x(宣告接口)
show ip route 查看路由条目,会有个个路由器的环回口的路由条目
开启水平分割,在中心节点开启
R1:
R1(config)#interface serial 1/0 ——(在中心节点路由开启水平分割)
R1(config-if)#ip split-horizon ——(接口开启)
R2和R3:clear ip route * 清空路由表
当水平分割开启时,启用子接口,
在之前的试验使用:default interface serial 1/0(清除接口的设置)
启用子接口时先关闭inverse-arp
R1在serial 1/0接口:
no frame-relay inverse-arp
no arp frame-relay
no shutdown
exit
R1(config)#default interface serial 1/0
Interface Serial1/0 set to default configuration
R1(config)#interface serial 1/0
R1(config-if)#encapsulation frame-relay ietf
R1(config-if)#frame-relay lmi-type ansi
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial 1/0.102 multipoint ——(R1到R2的子接口,启用多点连接)
R1(config-subif)#no frame-relay inverse-arp
R1(config-subif)#no arp frame-relay ——(子接口关闭inverse-arp可不敲,当主接口关闭子接口也会关闭)
R1(config-subif)#ip address 12.1.1.1 255.255.255.0
R1(config-subif)#frame-relay map ip 12.1.1.2 102 broadcast (做手工映射,)
R1(config-subif)#no shutdown
R1(config-subif)#exit
R1(config)#interface serial 1/0.103 point-to-point (R1到R3的子接口,点到点)
R1(config-subif)#no frame-relay inverse-arp
R1(config-subif)#no arp frame-relay
R1(config-subif)#ip address 13.1.1.1 255.255.255.0 (点到点不需要做帧中继映射,但需要做dlci绑定)
R1(config-subif)#frame-relay interface-dlci 103 (将这个子接口与103绑定,只要子接口发包就会标记该数据包,让FRSW知道怎么转发)
R1(config-fr-dlci)#exit
R1(config-subif)#no shutdown
R1(config-subif)#exit
R1(config)#router rip
R1(config-router)#network 12.0.0.0
R1(config-router)#network 13.0.0.0
R1(config-router)#exit
R1(config)#end
R2:
R2(config)#default interface serial 1/0
Interface Serial1/0 set to default configuration
R2(config)#interface serial 1/0
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#no frame-relay inverse-arp
R2(config-if)#no arp frame-relay
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#frame-relay map ip 12.1.1.1 201 broadcast
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#netw
R2(config-router)#network 2.0.0.0
R2(config-router)#network 12.0.0.0
R2(config-router)#exit
R3:
R3(config)#default interface serial 1/0
Interface Serial1/0 set to default configuration
R3(config)#interface serial 1/0
R3(config-if)#encapsulation frame-relay
R3(config-if)#frame-relay lmi-type cisco
R3(config-if)#no frame-relay inverse-arp
R3(config-if)#no arp frame-relay
R3(config-if)#ip address 13.1.1.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#frame-relay map ip 13.1.1.1 301 broadcast
R3(config-if)#exit
R3(config)#router rip
R3(config-router)#network 3.0.0.0
R3(config-router)#network 13.0.0.0
R3(config-router)#exit
R3>show 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
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 13.1.1.1, 00:00:25, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
R 2.2.2.0 [120/2] via 13.1.1.1, 00:00:25, Serial1/0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.0/24 is directly connected, Loopback0
L 3.3.3.3/32 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
R 12.1.1.0 [120/1] via 13.1.1.1, 00:00:25, Serial1/0
13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 13.1.1.0/24 is directly connected, Serial1/0
L 13.1.1.3/32 is directly connected, Serial1/0
R3#ping 2.2.2.2 source 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 39/40/42 ms
R3#
华为帧中继试验:
帧中继交换机配置:
帧中继交换机不需要配置,只需要配置R1R2R3
AR1:
interface serial 1/0/0
link-protocol fr(改为帧中继)
Y
fr interface type dte(默认都是DTE端)
ip address 123.1.1.1 24
AR2:
interface serial 1/0/0
link-protocol fr
Y
ip address 123.1.1.2 24
AR3:
interface serial 1/0/0
link-protocol fr
Y
ip address 123.1.1.3 24
AR1:
display fr pvc-info
display fr map-info(查看)
若AR2ping通AR3,AR2到AR3的手工映射
AR2:
interface serial 1/0/0
fr map ip 123.1.1.3 201 broadcast
AR3:
interface serial 1/0/0
fr map ip 123.1.1.2 301 broadcast
display fr map-info(查看)
AR1/2/3:
interface loopback 0
ip address 1.1.1.1 24(2.2.2.2、3.3.3.3)
AR1:
rip 100
version 2
undo summary
network 1.0.0.0
network 123.0.0.0(只能主类宣告)
AR2:
rip 100
version 2
undo summary
network 2.0.0.0
network 123.0.0.0
AR3:
rip 100
version 2
undo summary
network 3.0.0.0
network 123.0.0.0
水平分割默认关闭,开启水平分割:
AR1:
interface serial 1/0/0
rip split-horizon
rip poison-reverse
开启后清理路由缓存
(bug:ensp中有可能一个有路由,一个没有,但是能得到结果不能ping通)
开启水平分割后启用子接口(重启所有路由器清空配置进行试验,也可以undo掉配置)
AR1:
interface loopback 0
ip address 1.1.1.1 24
interface serial 1/0/0
link-protocol fr
undo fr inarp(关闭自动映射)
quit
interface serial 1/0/0.102 p2mp
ip address 12.1.1.1 24
fr map 12.1.1.2 102 broadcast
AR2:
interface serial 1/0/0
link-protocol ppp(在上面几个试验的基础上清除该接口的命令)
link-protocol fr
undo ip address
ip address 12.1.1.2 24
undo fr inarp
fr map ip 12.1.1.1 201 broadcast
AR3:
interface serial 1/0/0
link-protocol ppp(在上面几个试验的基础上清除该接口的命令)
link-protocol fr
undo ip address
ip address 13.1.1.2 24
undo fr inarp
fr map ip 13.1.1.1 301 broadcast
AR1:
interface serial 1/0/0.103 p2p(p2p不能关inarp)
ip address 13.1.1.1 24
fr dlci 103 (绑定DLCI)
查看配置:
display current-configuration interface serial 1/0/0.102(3)
display fr map-info
运行rip
AR1:
rip 1
version 2
undo summary
network 1.0.0.0
network 12.0.0.0
network 13.0.0.0
AR2:
rip 100
version 2
undo summary
network 2.0.0.0
network 12.0.0.0
AR3:
rip 100
version 2
undo summary
network 3.0.0.0
network 13.0.0.0
PING:
[AR2]ping -a 2.2.2.2 3.3.3.3
PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=40 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 time=20 ms
--- 3.3.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/28/40 ms
[AR2]ping -a 2.2.2.2 13.1.1.3
PING 13.1.1.3: 56 data bytes, press CTRL_C to break
Reply from 13.1.1.3: bytes=56 Sequence=1 ttl=254 time=50 ms
Reply from 13.1.1.3: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 13.1.1.3: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 13.1.1.3: bytes=56 Sequence=4 ttl=254 time=50 ms
Reply from 13.1.1.3: bytes=56 Sequence=5 ttl=254 time=40 ms
--- 13.1.1.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/40/50 ms