[RT2]ospf router-id 2.2.2.2 [RT2-ospf-1]area 0
[RT2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0 [RT2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255 [RT2-ospf-1-area-0.0.0.0]network 192.168.0.1 0.0.0.0 [RT2-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0 [RT2-ospf-1-area-0.0.0.0]quit [RT2-ospf-1]quit [RT2]
RT3的配置如下: [H3C]sysname RT3
[RT3]interface Serial 0/2/0
[RT3-Serial0/2/0]ip address 10.1.1.2 24 [RT3-Serial0/2/0]quit [RT3]interface LoopBack 1
[RT3-LoopBack1]ip address 3.3.3.3 32 [RT3-LoopBack1]quit [RT3]interface Serial 0/2/2
[RT3-Serial0/2/2]ip address 20.1.1.1 24 [RT3-Serial0/2/2]quit [RT3]ospf router-id 3.3.3.3 [RT3-ospf-1]area 0
[RT3-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255 [RT3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0 [RT3-ospf-1-area-0.0.0.0]quit [RT3-ospf-1]area 1
[RT3-ospf-1-area-0.0.0.1]network 20.1.1.0 0.0.0.255 [RT3-ospf-1-area-0.0.0.1]quit RT4的配置如下: [H3C]sysname R4
[R4]interface Serial 0/2/0
[R4-Serial0/2/0]ip address 20.1.1.2 24 [R4-Serial0/2/0]quit [R4]interface LoopBack 1
[R4-LoopBack1]ip address 4.4.4.4 32 [R4-LoopBack1]quit
[R4]ospf router-id 4.4.4.4 [R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]network 20.1.1.0 0.0.0.255 [R4-ospf-1-area-0.0.0.1]network 4.4.4.4 0.0.0.0 [R4-ospf-1-area-0.0.0.1]quit [R4-ospf-1]quit [R4]
在RT3上配置3类LSA的聚合:
[RT3]ospf
[RT3-ospf-1]area 0
[RT3-ospf-1-area-0.0.0.0]abr-summary 192.168.0.0 23 配置好了之后在RT4上查看一下路由表: [R4]display ip routing-table Routing Tables: Public
Destinations : 10 Routes : 10
Destination/Mask Proto Pre Cost Interface
2.2.2.2/32 OSPF 10 3124 S0/2/0
3.3.3.3/32 OSPF 10 1562 S0/2/0
4.4.4.4/32 Direct 0 0 127.0.0.1 InLoop0
10.1.1.0/24 OSPF 10 3124 S0/2/0
20.1.1.0/24 Direct 0 0 S0/2/0
20.1.1.1/32 Direct 0 0 NextHop 20.1.1.1 20.1.1.1 20.1.1.1 20.1.1.2 20.1.1.1
S0/2/0
20.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.0.0/23 OSPF 10 3124 20.1.1.1 S0/2/0
如上标识除了学到的路由信息,查看路由表发现网段已经进行了聚合。
配置5类LSA的聚合:
之前RT2上对网段进行了network宣告,现在undo掉: [RT2]ospf
[RT2-ospf-1]area 0
[RT2-ospf-1-area-0.0.0.0]undo network 192.168.0.1 0.0.0.0 [RT2-ospf-1-area-0.0.0.0]undo network 192.168.1.1 0.0.0.0 [RT2-ospf-1-area-0.0.0.0]quit [RT2-ospf-1]quit [RT2]
[RT2-ospf-1]import-route direct
[RT2-ospf-1]asbr-summary 192.168.0.0 23
配置好了之后在RT4路由器上查看路由表发现已经把5类LSA进行了聚合,聚合成了一个大的网段,如下图所示: [RT4]display ip routing-table Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Interface
2.2.2.2/32 OSPF 10 3124 S0/2/0
3.3.3.3/32 OSPF 10 1562 S0/2/0
4.4.4.4/32 Direct 0 0 127.0.0.1 InLoop0
10.1.1.0/24 OSPF 10 3124 S0/2/0
10.1.1.2/32 O_ASE 150 1 S0/2/0
20.1.1.0/24 Direct 0 0 S0/2/0
NextHop 20.1.1.1 20.1.1.1 20.1.1.1 20.1.1.1 20.1.1.2