需求把FR配置成为帧中继交换机,R1与R2上运行OSPF,并交换信息,使R1与R2的环回口可以互通。
1.把FR配置成为帧中继交换机
frame-relay switching //全局开启帧中继交换
interface Serial1/0
no ip address
encapsulation frame-relay //定义封装类型为:frame-relay
serial restart-delay 0
clock rate 64000 //定义DCE(网络连接设备速率)
frame-relay lmi-type cisco //配置LMI类型为cisco
frame-relay intf-type dce //配置串口接口类型为DCE
frame-relay route 100 interface Serial1/1 200 // 建立对应关系,将DLCI 100从串口S1/1映射出去,对应路由器R2的DLCI 200
!
interface Serial1/1
no ip address
encapsulation frame-relay
serial restart-delay 0
clock rate 64000
frame-relay lmi-type cisco
frame-relay intf-type dce
frame-relay route 200 interface Serial1/0 100 // 建立对应关系,将DLCI 200从串口S1/0映射出去,对应路由器R1的DLCI 100
FR#sh frame-relay route //全部配置完的结果
Input Intf Input Dlci Output Intf Output Dlci Status
Serial1/0 100 Serial1/1 200 active
Serial1/1 200 Serial1/0 100 active
R1与R2上的配置
R1:
interface Serial1/1
ip address 192.168.1.1 255.255.255.0
encapsulation frame-relay //定义封闭类型为 frame-relay
serial restart-delay 0
frame-relay map ip 192.168.1.2 100 CISCO //建立静态映射,100是本点DLCI,IP为对端IP
no frame-relay inverse-arp //关闭逆向ARP
frame-relay lmi-type cisco
router ospf 100
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 10.10.10.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
neighbor 192.168.1.2 //指定邻居,因为Hello包不能穿越FR,与R2建立邻居,而且在实验中得知只有一台路由器也会选举DR,和BDR
!
未指定邻居之间的DEBUG 信息
R1(config-router)#
*Aug 27 11:25:04.999: OSPF: end of Wait on interface Serial1/1
*Aug 27 11:25:04.999: OSPF: DR/BDR election on Serial1/1
*Aug 27 11:25:04.999: OSPF: Elect BDR 1.1.1.1
*Aug 27 11:25:04.999: OSPF: Elect DR 1.1.1.1
*Aug 27 11:25:05.003: OSPF: Elect BDR 0.0.0.0
*Aug 27 11:25:05.003: OSPF: Elect DR 1.1.1.1
*Aug 27 11:25:05.003: DR: 1.1.1.1 (Id) BDR: none
*Aug 27 11:25:05.507: OSPF: No full nbrs to build Net Lsa for interface Serial1/1
指定完后:
Aug 27 15:31:05.094: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on Serial1/1 from LOADING to FULL, Loading Done
下面是R2的配置:
R2:
interface Serial1/0
ip address 192.168.1.2 255.255.255.0
encapsulation frame-relay
serial restart-delay 0
frame-relay map ip 192.168.1.1 200 CISCO
no frame-relay inverse-arp
frame-relay lmi-type cisco
router ospf 100
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 20.20.20.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
neighbor 192.168.1.1
R1(config-router)#do sh ip route
Codes: 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
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 192.168.1.2, 00:00:23, Serial1/1
20.0.0.0/32 is subnetted, 1 subnets
O 20.20.20.1 [110/65] via 192.168.1.2, 00:00:23, Serial1/1
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.10.0 is directly connected, Loopback1
C 192.168.1.0/24 is directly connected, Serial1/1
R1(config-router)#
R1#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 = 8/22/44 ms
R1#
实验完毕!