An external LSA (Class 5 LSA) is used to advertise each external route that is redistributed from other protocols (such as OSPF) to OSPF. In ASBR, five types of LSA can be summarized and injected into the OSPF domain.
R1 Configuration:
Interface Loopback1
Ip address 1.1.1.1 255.255.255.255
!
Interface Loopback2
Ip address 1.1.2.1 255.255.255.255
!
Interface Loopback3
Ip address 1.1.3.1 255.255.255.255
!
Interface Loopback4
Ip address 1.1.4.1 255.255.255.255
!
Interface Serial1/1
Ip address 10.0.1.1 255.255.255.0
Serial restart-delay 0
!
Router ospf 1
Log-adjacency-changes
Network 1.1.1.0 0.0.0.255 area 0
Network 1.1.2.0 0.0.0.255 area 0
Network 1.1.3.0 0.0.0.255 area 0
Network 1.1.4.0 0.0.0.255 area 0
Network 10.0.1.0 0.0.0.255 area 0
!
R2 Configuration:
Interface Serial1/0
Ip address 10.0.1.2 255.255.255.0
Serial restart-delay 0
!
Interface Serial1/1
Ip address 10.0.2.1 255.255.255.0
Serial restart-delay 0
!
Router VPN 1
Network 10.0.2.0 0.0.0.255
Auto-summary
!
Router ospf 1
Redistribute Fig 1 subnets // route the route of the OSPF network to the OSPF
Network 10.0.1.0 0.0.0.255 area 0
!
R3 Configuration:
Interface Loopback1
Ip address 3.3.3.3 255.255.255.255
!
Interface Loopback2
Ip address 3.3.2.3 255.255.255.0
!
Interface Loopback3
Ip address 3.3.1.3 255.255.255.0
!
Interface Loopback4
Ip address 3.3.4.3 255.255.255.0
!
Interface Serial1/0
Ip address 10.0.2.2 255.255.255.0
Serial restart-delay 0
!
Router VPN 1
Network 3.3.1.0 0.0.0.255
Network 3.3.2.0 0.0.0.255
Network 3.3.3.0 0.0.0.255
Network 3.3.4.0 0.0.0.255
Network 10.0.2.0 0.0.0.255
No auto-summary
!
Ip route 0.0.0.0 0.0.0.0 10.0.2.1 // create a default route
After the preceding configuration is complete, view the R1 route table:
R1 # show ip route
Codes: C-connected, S-static, R-RIP, M-mobile, B-BGP
D-OSPF, EX-VPN 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, su-IS summary, L1-IS-level-1, L2-IS level-2
Ia-IS inter area, *-candidate default, U-per-user static route
O-ODR, P-periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 4 subnets
C 1.1.1.1 is directly connected, Loopback1
C 1.1.3.1 is directly connected, Loopback3
C 1.1.2.1 is directly connected, Loopback2
C 1.1.4.1 is directly connected, Loopback4
3.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O E2 3.3.3.3/32 [110/20] via 10.0.1.2, 00:00:10, Serial1/1
O E2 3.3.1.0/24 [110/20] via 10.0.1.2, 00:00:10, Serial1/1
O E2 3.3.2.0/24 [110/20] via 10.0.1.2, 00:00:10, Serial1/1
O E2 3.3.4.0/24 [110/20] via 10.0.1.2, 00:00:10, Serial1/1
10.0.0.0/24 is subnetted, 2 subnets
O E2 10.0.2.0 [110/20] via 10.0.1.2, 00:29:44, Serial1/1
C 10.0.1.0 is directly connected, Serial1/1
The detailed route entries in the network are displayed. 3.3.1.0-3.3.4.0 is a continuous CIDR block. We can route the route entry 3.3.3.0.0/21 to R1, which will reduce the number of Route entries in R1.
OSPF route summary on R2 (ASBR:
R2 # conf ter
R2 (config) # router ospf 1
R2 (config-router) # summary-address 3.3.0.0 255.255.248.0
View the R1 route table again:
R1 # show ip route
Codes: C-connected, S-static, R-RIP, M-mobile, B-BGP
D-OSPF, EX-VPN 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, su-IS summary, L1-IS-level-1, L2-IS level-2
Ia-IS inter area, *-candidate default, U-per-user static route
O-ODR, P-periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 4 subnets
C 1.1.1.1 is directly connected, Loopback1
C 1.1.3.1 is directly connected, Loopback3
C 1.1.2.1 is directly connected, Loopback2
C 1.1.4.1 is directly connected, Loopback4
3.0.0.0/21 is subnetted, 1 subnets
O E2 3.3.0.0 [110/20] via 10.0.1.2, 00:02:42, Serial1/1
10.0.0.0/24 is subnetted, 2 subnets
O E2 10.0.2.0 [110/20] via 10.0.1.2, 00:27:40, Serial1/1
C 10.0.1.0 is directly connected, Serial1/1
From: renzhongming's BLOG