路由外部路由汇总
R1上的配置
interface Loopback1
ip address 1.1.1 .1 255.255.255.0
!
interface Loopback2
ip address 1.1.2 .1 255.255.255.0
!
interface Serial1/0
ip address 12.1.1 .1 255.255.255.0
!
router ospf 1
network 1.1.1 .0 0.0.0.255 area 1
network 1.1.2 .0 0.0.0.255 area 1
network 12.1.1 .0 0.0.0.255 area 1
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
end
R2上的配置
interface Serial1/0
ip address 12.1.1 .2 255.255.255.0
!
interface Serial1/1
ip address 23.1.1 .2 255.255.255.0
!
router ospf 1
network 12.1.1 .0 0.0.0.255 area 1
network 23.1.1 .0 0.0.0.255 area 0
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
R3上的配置
interface Serial1/0
ip address 34.1.1.3 255.255.255.0
!
interface Serial1/1
ip address 23.1.1 .3 255.255.255.0
!
router ospf 1
summary-address 4.4.0 .0 255.255.0.0
redistribute rip metric 200 subnets
network 23.1.1 .0 0.0.0.255 area 0
!
router rip
version 2
redistribute ospf 1 metric 10
network 34.0.0.0
no auto-summary
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
End
R4上的配置
interface Loopback1
ip address 4.4.1 .4 255.255.255.0
!
interface Loopback2
ip address 4.4.2 .4 255.255.255.0
!
interface Serial1/0
ip address 34.1.1.4 255.255.255.0
!
router rip
version 2
network 4.0.0 .0
network 34.0.0.0
no auto-summary
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
End
实验是想关闭ripv2的自动汇总,而要在ospf中对外部路由进行汇总
在这个实验中,关闭R4中rip2的自动汇总,R3上也关闭
4.0.0 .0/24 is subnetted, 2 subnets
O E2 4.4.1 .0 [110/200] vi a 12.1.1 .2, 00:08:58, Serial1/0
O E2 4.4.2 .0 [110/200] vi a 12.1.1 .2, 00:08:58, Serial1/0
然后在R3上做自动汇总
R3(config)#router ospf 1
R3(config-router)#summary-address 4.4.0 .0 255.255.0.0
结果R1路由表
4.0.0 .0/16 is subnetted, 1 subnets
O E2 4.4.0 .0 [110/200] vi a 12.1.1 .2, 00:07:21, Serial1/0
实验刚刚开始,使用的时候RIPv1,结果出现问题,ver1是有类的,R3上做重分布时,是无类的,因此实验总会进行自动汇总。