Unlike EIGRP, summarization can only be done at ABR and ASBR.
Before summarization
R2 is the ABR of Area 0 and 10
R2#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
172.16.0.0/24 is subnetted, 4 subnets
O E2 172.16.0.0 [110/200] via 172.30.0.1, 00:00:03, FastEthernet0/0
O E2 172.16.1.0 [110/200] via 172.30.0.1, 00:00:03, FastEthernet0/0
O E2 172.16.2.0 [110/200] via 172.30.0.1, 00:00:03, FastEthernet0/0
O E2 172.16.3.0 [110/200] via 172.30.0.1, 00:00:03, FastEthernet0/0
172.30.0.0/24 is subnetted, 3 subnets
O IA 172.30.20.0 [110/201] via 172.30.0.3, 00:00:03, FastEthernet0/0
C 172.30.0.0 is directly connected, FastEthernet0/0
C 172.30.10.0 is directly connected, Serial0/0
10.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
O 10.10.1.1/32 [110/201] via 172.30.10.5, 00:00:04, Serial0/0
O 10.10.0.0/22 is a summary, 00:00:04, Null0
O 10.10.0.1/32 [110/201] via 172.30.10.5, 00:00:04, Serial0/0
O 10.10.3.1/32 [110/201] via 172.30.10.5, 00:00:06, Serial0/0
O 10.10.2.1/32 [110/201] via 172.30.10.5, 00:00:06, Serial0/0
O IA 10.20.3.1/32 [110/202] via 172.30.0.3, 00:00:06, FastEthernet0/0
O IA 10.20.2.1/32 [110/202] via 172.30.0.3, 00:00:06, FastEthernet0/0
O IA 10.20.1.1/32 [110/202] via 172.30.0.3, 00:00:06, FastEthernet0/0
O IA 10.20.0.1/32 [110/202] via 172.30.0.3, 00:00:06, FastEthernet0/0
R2#
R1 is the ASBR in Area 0
R1#sh ip route ospf
172.30.0.0/24 is subnetted, 3 subnets
O IA 172.30.20.0 [110/201] via 172.30.0.3, 00:01:18, FastEthernet0/0
O IA 172.30.10.0 [110/201] via 172.30.0.2, 00:01:18, FastEthernet0/0
10.0.0.0/32 is subnetted, 8 subnets
O IA 10.10.1.1 [110/202] via 172.30.0.2, 00:00:08, FastEthernet0/0
O IA 10.10.0.1 [110/202] via 172.30.0.2, 00:00:08, FastEthernet0/0
O IA 10.10.3.1 [110/202] via 172.30.0.2, 00:00:08, FastEthernet0/0
O IA 10.10.2.1 [110/202] via 172.30.0.2, 00:00:08, FastEthernet0/0
O IA 10.20.3.1 [110/202] via 172.30.0.3, 00:01:18, FastEthernet0/0
O IA 10.20.2.1 [110/202] via 172.30.0.3, 00:01:18, FastEthernet0/0
O IA 10.20.1.1 [110/202] via 172.30.0.3, 00:01:18, FastEthernet0/0
O IA 10.20.0.1 [110/202] via 172.30.0.3, 00:01:18, FastEthernet0/0
R1#
After summarization at R2 ABR:
R2(config)#router ospf 1
R2(config-router)#area 10 range 10.10.0.0 255.255.252.0
R2(config-router)#end
R2#sh ip route ospf
172.16.0.0/24 is subnetted, 4 subnets
O E2 172.16.0.0 [110/200] via 172.30.0.1, 00:00:36, FastEthernet0/0
O E2 172.16.1.0 [110/200] via 172.30.0.1, 00:00:36, FastEthernet0/0
O E2 172.16.2.0 [110/200] via 172.30.0.1, 00:00:36, FastEthernet0/0
O E2 172.16.3.0 [110/200] via 172.30.0.1, 00:00:36, FastEthernet0/0
172.30.0.0/24 is subnetted, 3 subnets
O IA 172.30.20.0 [110/201] via 172.30.0.3, 00:00:36, FastEthernet0/0
10.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
O 10.10.1.1/32 [110/201] via 172.30.10.5, 00:00:36, Serial0/0
O 10.10.0.0/22 is a summary, 00:00:36, Null0
O 10.10.0.1/32 [110/201] via 172.30.10.5, 00:00:36, Serial0/0
O 10.10.3.1/32 [110/201] via 172.30.10.5, 00:00:36, Serial0/0
O 10.10.2.1/32 [110/201] via 172.30.10.5, 00:00:36, Serial0/0
O IA 10.20.3.1/32 [110/202] via 172.30.0.3, 00:00:36, FastEthernet0/0
O IA 10.20.2.1/32 [110/202] via 172.30.0.3, 00:00:36, FastEthernet0/0
O IA 10.20.1.1/32 [110/202] via 172.30.0.3, 00:00:37, FastEthernet0/0
O IA 10.20.0.1/32 [110/202] via 172.30.0.3, 00:00:37, FastEthernet0/0
R1#sh ip route ospf
172.30.0.0/24 is subnetted, 3 subnets
O IA 172.30.20.0 [110/201] via 172.30.0.3, 00:03:36, FastEthernet0/0
O IA 172.30.10.0 [110/201] via 172.30.0.2, 00:03:36, FastEthernet0/0
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O IA 10.10.0.0/22 [110/202] via 172.30.0.2, 00:01:20, FastEthernet0/0
O IA 10.20.3.1/32 [110/202] via 172.30.0.3, 00:03:36, FastEthernet0/0
O IA 10.20.2.1/32 [110/202] via 172.30.0.3, 00:03:36, FastEthernet0/0
O IA 10.20.1.1/32 [110/202] via 172.30.0.3, 00:03:36, FastEthernet0/0
O IA 10.20.0.1/32 [110/202] via 172.30.0.3, 00:03:36, FastEthernet0/0
Do the same summarization for R3 ABR:
R3(config)#router ospf 1
R3(config-router)#area 20 range 10.20.0.0 255.255.252.0
R3(config-router)#end
R1#sh ip route ospf
172.30.0.0/24 is subnetted, 3 subnets
O IA 172.30.20.0 [110/201] via 172.30.0.3, 00:05:18, FastEthernet0/0
O IA 172.30.10.0 [110/201] via 172.30.0.2, 00:05:18, FastEthernet0/0
10.0.0.0/22 is subnetted, 2 subnets
O IA 10.10.0.0 [110/202] via 172.30.0.2, 00:03:01, FastEthernet0/0
O IA 10.20.0.0 [110/202] via 172.30.0.3, 00:00:35, FastEthernet0/0
R1#
Routing table is shortened.