需求:R4RIP网络的路由重发布进OSPF,并且OSPF内看到RIP过来的一条汇总路由
注意这里RIP网络内的路由器都要关闭自动汇总,下面实验结果可显示在没有关闭自动汇总的输出:
配置:
R1
interface Loopback0
ip address 1.1.1.1 255.255.255.0
interface FastEthernet0/0
no ip address
shutdown
duplex half
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 12
network 12.1.1.1 0.0.0.0 area 12
R2
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 23.1.1.1 255.255.255.0
serial restart-delay 0
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 12.1.1.2 0.0.0.0 area 12
network 23.1.1.1 0.0.0.0 area 0
R3
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip address 23.1.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 34.1.1.1 255.255.255.0
serial restart-delay 0
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
summary-address 4.1.0.0 255.255.252.0
redistribute rip metric 300 subnets
network 3.3.3.3 0.0.0.0 area 0
network 23.1.1.2 0.0.0.0 area 0
!
router rip
version 2
redistribute ospf 1 metric 5
network 34.0.0.0
no auto-summary
R4
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Loopback1
ip address 4.1.1.1 255.255.255.0
!
interface Loopback2
ip address 4.1.2.1 255.255.255.0
!
interface Loopback3
ip address 4.1.3.1 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip address 34.1.1.2 255.255.255.0
serial restart-delay 0
router rip
version 2
network 4.0.0.0
network 34.0.0.0
no auto-summary
验证配置:
没有在R4上关闭自动汇总时的显示结果:
R1#show ip route
Gateway of last resort is not set
34.0.0.0/24 is subnetted, 1 subnets
O E2 34.1.1.0 [110/300] via 12.1.1.2, 00:03:40, Serial1/0
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 IA 2.2.2.2 [110/65] via 12.1.1.2, 00:17:56, Serial1/0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/129] via 12.1.1.2, 00:12:36, Serial1/0
O E2 4.0.0.0/8 [110/300] via 12.1.1.2, 00:00:52, Serial1/0
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.1.1.0 [110/128] via 12.1.1.2, 00:14:05, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
RIP网络—R3和R4都关闭了自动汇总后:
R1#show ip route
Gateway of last resort is not set
34.0.0.0/24 is subnetted, 1 subnets
O E2 34.1.1.0 [110/300] via 12.1.1.2, 00:07:59, Serial1/0
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 IA 2.2.2.2 [110/65] via 12.1.1.2, 00:22:14, Serial1/0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/129] via 12.1.1.2, 00:16:54, Serial1/0
4.0.0.0/24 is subnetted, 4 subnets
O E2 4.4.4.0 [110/300] via 12.1.1.2, 00:04:11, Serial1/0
O E2 4.1.1.0 [110/300] via 12.1.1.2, 00:04:11, Serial1/0
O E2 4.1.3.0 [110/300] via 12.1.1.2, 00:04:11, Serial1/0
O E2 4.1.2.0 [110/300] via 12.1.1.2, 00:04:11, Serial1/0
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.1.1.0 [110/128] via 12.1.1.2, 00:18:28, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
在R3—ASBR路由器上进行外部路由汇总
summary-address 4.1.0.0 255.255.252.0
查看确认路由表
R1#show ip route
Gateway of last resort is not set
34.0.0.0/24 is subnetted, 1 subnets
O E2 34.1.1.0 [110/300] via 12.1.1.2, 00:14:38, Serial1/0
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 IA 2.2.2.2 [110/65] via 12.1.1.2, 00:28:54, Serial1/0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/129] via 12.1.1.2, 00:23:34, Serial1/0
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O E2 4.4.4.0/24 [110/300] via 12.1.1.2, 00:10:51, Serial1/0
O E2 4.1.0.0/22 [110/300] via 12.1.1.2, 00:00:19, Serial1/0
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.1.1.0 [110/128] via 12.1.1.2, 00:25:03, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0