This article describes how to deal with the Forwarding Address in the AS-External-LSA in the OSPF protocol and how the Forwarding Address affects OSPF routing, including the suboptimal path problem that the Forwarding Address may cause.
Forwarding Address is the information that identifies the external forwarding address carried in OSPF AS-External-LSA (hereinafter referred to as Type 5 LSA). Generally, the Forwarding Address is filled in as 0.0.0.0, and it is advertised to other OSPF routers to reach this external route. The other routers can know how to reach the ASBR through the OSPF route calculation. If certain conditions are met, Forwarding Address can be filled with a non-zero IP address. If other routers have a legal route to this IP address, they can reach the destination through this address without going through the ASBR, so as to achieve the purpose of path optimization.
Forwarding Address routing legitimacy
If the OSPF router calculates the path to the external route through Forwarding Address (hereinafter referred to as FA), then it must ensure that there is an OSPF intra-area route or OSPF inter-area route to the FA in its routing table, otherwise, The external route is invalid.
Forwarding Address Filling Principle
FA is set to none-0.0.0.0 when all the following conditions are met
1. OSPF is enabled on the next-hop interface of ASBR
2. ASBR's next-hop interface is not set as a passive interface
3. The next-hop interface of ASBR is not of OSPF P2P or P2MP type
In addition, in all other cases, FA is filled with 0.0.0.0
Path Optimization through Forwarding Address
Network as follows:

Router A is connected to Router B and Router C through a multi-access network. Router A and Router B run non-OSPF routing protocols. Router B, Router C, and Router D run OSPF routing protocols. Assuming Router B ’s 2.2.2.1 The interface and the 2.2.2.3 interface of Router C do not enable the OSPF routing protocol. Router B acts as an ASBR to introduce Route into the OSPF domain. When Route a is advertised, FA will be filled in as 0.0.0.0. When Router D accesses an It will find the route to ASBR Route B, and will eventually access a through Router C-Router B-Router A. If the OSPF protocol is enabled on the 2.2.2.1 and 2.2.2.3 interfaces of Router B and Router C, Router B also serves as an ASBR to advertise the Type 5 LSA of a route. At this time, Router B has satisfied the filling of non-zero FA when filling in FA. Conditions (see above), so FA is filled in as 2.2.2.2, Router D is accessing the network segment a, it will directly calculate the route to 2.2.2.2, and finally directly reach Router A through Router C, which achieves the purpose of path optimization. So if the 2.2.2.3 network segment of Router C does not start OSPF, how does Router D access the network segment? At this time, when Router B releases a, it still fills in FA as 2.2.2.2, and Router D still calculates the OSPF AS internal route to 2.2.2.2. The calculation result shows that 2.2.2.2 can be reached through Router B, so the final forwarding path is still Router C-Router B-Router A.
Understand the legality of Forwarding Address routing
If the OSPF router cannot find the route within or between the OSPF areas when calculating the path to the FA address, the corresponding external route cannot be added to the routing table, resulting in routing black holes.
Consider the following networking:

Router A runs non-OSPF routing protocols with Router B and Router C. As the ABR of area N and area 0, Router B cannot publish the routing information of the network segment 2.2.2.0 to area 0 for special reasons, so it is aggregated and not released. Router C learned the external route of 2.2.2.0 through Router A and published it to OSPF. Router B learns the external route Route a through Router A and fills in FA as 2.2.2.2 when it is injected into OSPF. Can Router D locate in area 0 reach Route a? Router D received the Type 5 LSA of Route and found that the FA address is 2.2.2.2. Therefore, it looks for whether there is an AS internal route to 2.2.2.2 in the routing table because Route C has published an external route of 2.2.2.2, so the Router D knows how to reach 2.2.2.2, but because this is an external route, not an AS internal route, which is contrary to the legality of the FA route, Router D cannot finally add Route a to its routing table, resulting in Routing black hole.
Forwarding Address leads to the sub-optimal path
The purpose of setting the Forwarding Address is to hope that the router can choose the fastest path to reach the destination, but the sometimes improper settings may also lead to the occurrence of sub-optimal paths.
Consider the following networking:

Router B, Router C, Router D, and Router E run the OSPF protocol, and Router B does not enable OSPF on the 2.2.2.1 interface, and Router C enables OSPF on the 2.2.2.3 interface. Router A is connected to Router B and Router C through Ethernet. Router B and Router C learn route Route a through external routes, and both inject this route into the OSPF domain as an ASBR. For Router E, he will learn two Type 5 LSAs about Route a. The difference is that the FA address in the LSA issued by Router B is all zeros, while the FA address in the LSA issued by Router C is 2.2.2.2. After the routing table, I found that I had an AS internal route to 2.2.2.2 and a route to ASBR Router B. Therefore, both routes are valid routes. By comparing the path cost, Router E finds that the cost to 2.2.2.2 is 30 and arrives. The cost of Router B is 25, so Router E chooses the path to Router B. However, from the perspective of the actual network topology, Router E chose a sub-optimal path.
Processing of Forwarding Address in NSSA
For the 7 types of LSAs generated by ASBR in the NSSA area, if you need to convert to 5 types of LSAs and publish them to other OSPF areas, then the FA must fill in a non-zero IP address. RFC3101 specifically requires this:
NSSA AS boundary routers may only originate Type-7 LSAs into NSSAs .. An NSSA internal AS boundary router must set the P-bit in the LSA. header's option field of any Type-7 LSA whose network it wants advertised into the OSPF domain's full transit topology. The LSAs of these networks must have a valid non-zero forwarding address.
There are two cases for filling in FA in 7 types of LSA:
1. If the ASBR that issued the 7 types of LSA meets the non-zero FA filling rule mentioned above, then fill in according to the rule.
2. If the ASBR that advertises this type 7 LSA does not meet the above conditions, then you need to select one of the interfaces that enable OSPF protocol on the router to fill in.
Although RFC3101 requires FA to fill in case 2, it is not clear how to fill in the FA. In some networking environments, due to improper filling of the FA address, sub-optimal routing may occur.
Consider the following networking:

Router A, Router B, and Router C form an NSSA area, and Router A imports the external route Route a and advertises it to Router B and Router C through the Type 7 LSA, because the RFC does not explicitly require the FA in the Type 7 LSA in this case. Fill in, Router A may choose the IP address of Int 1 to fill in FA, then for Router C, there are two paths to Int 1, one is through RouterA to reach the path Cost is 100, and the other is through Router B to reach the path Cost as 80, so Router C will choose the path through Router B. Obviously it actually chose a sub-optimal path.
If you use the loopback interface address to fill in the FA, you can solve the above problems.
If you have any problems, please post them in our Community. We are happy to solve them for you!



