拓扑图:
R1:
int lo0
ip add 1.1.1.4.1 255.255.255.0
ip ospf network point-to-point
int lo1
ip add 1.1.5.1 255.255.255.0
ip ospf network point-to-point
int lo2
ip add 1.1.6.1 255.255.255.0
ip ospf network point-to-point
int lo3
ip add 1.1.7.1 255.255.255.0
ip ospf network point-to-point
int s0/0/0
ip add 192.168.12.1 255.255.255.0
no shut
router ospf 1
router-id 1.1.1.1
network 1.1.4.0 255.255.252.0 area 1
network 192.168.12.0 0.0.0.255 area 1
R2:
int lo0
ip add 2.2.2.2 255.255.255.0
ip ospf network point-to-point
int s0/0/0
ip add 192.168.12.2 255.255.255.0
no shut
int s0/0/1
ip add 192.168.23.2 255.255.255.0
no shut
router ospf 1
router-id 2.2.2.2
network 192.168.12.0 0.0.0.255 area 1
network 192.168.23.0 0.0.0.255 area 0
network 2.2.2.0 0.0.0.255 area 0
area 1 range 1.1.4.0 255.255.252.0 //配置区域间路由汇总只需在ABR(区域边界路由器)配置
R3:
int lo0
ip add 3.3.3.3 255.255.255.0
ip ospf network point-to-point
int s0/0/1
ip add 192.168.23.3 255.255.255.0
no shut
int s0/0/0
ip add 192.168.34.3 255.255.255.0
no shut
router ospf 1
router-id 3.3.3.3
network 192.168.23.0 0.0.0.255 area 0
network 3.3.3.0 0.0.0.255 area 0
summary-address 4.4.0.0 255.255.252.0 //配置外部自治系统路由汇总
redistribute rip subnets
router rip
verison 2
network 192.168.34.0
redistribute ospf 1 metric 2 //将OSPF重发布到RIP中,设置跳数为2,此处必须设置metric值,否则发布不进去,原因是rip默认值为infinite(无穷大),即不存在
R4:
int lo0
ip add 4.4.0.4 255.255.255.0
int lo1
ip add 4.4.1.4 255.255.255.0
int lo2
ip add 4.4.2.4 255.255.255.0
int lo3
ip add 4.4.3.4 255.255.255.0
int s0/0/0
ip add 192.168.34.4 255.255.255.0
no shut
router rip
version 2
network 4.0.0.0
network 192.168.34.0 //RIP通告主类网络号
配置区域间路由汇总只需在ABR(区域边界路由器)配置;外部路由汇总必须在ASBR(自治系统边界路由器)上完成