一 实验环境:C3640-IK9O3S-M Version 12.4(10)
二 实验拓扑
三 实验描述:
根据拓扑中区域的划分配置OSPF。OSPF的骨干区域在R1的loopback上。配置帧中继,R1与R2在Area 100,网络类型为点到点。R1与R3在Area 300,网络类型为NBMA,且Area 300 为NSSA类型。R2上的loopback在Area 200,且对路由进行汇总。将R3上的loopback口重分布进OSPF中。为了使全网都通,需要在Area 300上创建虚链路。
四 实验步骤:
1 R3上帧中继配置
//1 启动帧中继交换
frame-relay switching
!
//2 进入接口
interface Serial0/0
//3 删除IP地址
no ip address
//4 配置帧中继封装类型
encapsulation frame-relay IETF
//下面两条命令可不加
no ip route-cache cef
no ip route-cache
serial restart-delay 0
//5 配置时钟
clock rate 64000
//6 配置为DCE终端类型
frame-relay intf-type dce
//7 配置帧中继路由
frame-relay route 102 interface Serial0/1 201
frame-relay route 103 interface Serial0/2 301
//8 别忘了要启用接口,这里是不用显示no shutdown命令的
!
interface Serial0/1
no ip address
encapsulation frame-relay IETF
serial restart-delay 0
frame-relay intf-type dce
frame-relay route 201 interface Serial0/0 102
!
interface Serial0/2
no ip address
encapsulation frame-relay IETF
serial restart-delay 0
clock rate 64000
frame-relay intf-type dce
frame-relay route 301 interface Serial0/0 103
!
2 R1基本配置
interface Loopback1
ip address 10.1.1.9 255.255.255.252
ip ospf network point-to-point
!
interface Serial0/1
no ip address
encapsulation frame-relay IETF
serial restart-delay 0
!
interface Serial0/1.102 point-to-point
ip address 10.1.1.1 255.255.255.252
frame-relay interface-dlci 102
!
interface Serial0/1.103 point-to-point
ip address 10.1.1.5 255.255.255.252
frame-relay interface-dlci 103
!
3 R2 基本配置
interface Loopback101
ip address 10.1.1.101 255.255.255.252
ip ospf network point-to-point
!
interface Loopback105
ip address 10.1.1.105 255.255.255.252
ip ospf network point-to-point
!
interface Loopback109
ip address 10.1.1.109 255.255.255.252
ip ospf network point-to-point
!
interface Loopback113
ip address 10.1.1.113 255.255.255.252
ip ospf network point-to-point
!
interface Serial0/1
ip address 10.1.1.2 255.255.255.252
encapsulation frame-relay IETF
serial restart-delay 0
frame-relay interface-dlci 201
!
4 R4基本配置
interface Loopback3
ip address 10.1.1.13 255.255.255.252
!
interface Serial0/1
ip address 10.1.1.6 255.255.255.252
encapsulation frame-relay IETF
serial restart-delay 0
frame-relay interface-dlci 301
!
5 配置Area 0区域
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)network 10.1.1.8 0.0.0.3 area 0
6 配置Area100区域,网络类型为点到点
修改Serial0/1.102的接口类型
R1(config)#interface Serial0/1.102 point-to-point
R1(config-subif)ip ospf network point-to-point
注:如果不确定接口类型,可以使用sh ip os int s0/1.102命令进行查看
R1(config)#router ospf 1
R1(config-router)network 10.1.1.0 0.0.0.3 area 100
R2(config)router ospf 1
R2(config-router)router-id 2.2.2.2
R2(config-router)network 10.1.1.0 0.0.0.3 area 100
因为R2上s0/1的接口类型默认为点到点,所以无需修改
7 配置Area300区域,网络类型为NBMA,且为NSSA类型
修改Serial0/1.103的接口类型
R1(config)#interface Serial0/1.103 point-to-point
R1(config-subif)ip ospf network non-broadcast
R1(config)#router ospf 1
R1(config-router)network 10.1.1.4 0.0.0.3 area 300
R1(config-router)area 300 nssa
//在NBMA网络中需手工指点neighbor
R1(config-router)neighbor 10.1.1.6
R4(config)router ospf 1
R4(config-router)router-id 4.4.4.4
R4(config-router)network 10.1.1.4 0.0.0.3 area 300
R4(config-router)area 300 nssa
8 配置Area 200区域,且进行路由汇总
R2(config-router)network 10.1.1.96 0.0.0.31 area 200
R2(config-router)area 200 range 10.1.1.96 255.255.255.224
R1-R2配置为虚链路,实现全网互通
R1(config-router)area 100 virtual-link 2.2.2.2
R2(config-router) area 100 virtual-link 1.1.1.1
9 将R4回环口的路由重分布进OSPF中
R4(config-router)redistribute connected subnets
10 最后查看R1路由条目
R1# show ip route
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C 10.1.1.8/30 is directly connected, Loopback1
O N2 10.1.1.12/30 [110/20] via 10.1.1.6, 00:00:27, Serial0/1.103
C 10.1.1.0/30 is directly connected, Serial0/1.102
C 10.1.1.4/30 is directly connected, Serial0/1.103
O IA 10.1.1.96/27 [110/65] via 10.1.1.2, 00:00:27, Serial0/1.102