5. Setting OSPF Forwarding Address and BGP NEXT_HOP attribute
Forwarding addresses are used to avoid extra hops between multiple routers that share a common network and that speak different routing protocols with each other.
Both BGP and OSPF have equivalents of forwarding addresses. In BGP, the NEXT_HOP attribute is a well-known, mandatory attribute. OSPF has a Forwarding address field. We will discuss how these are to be filled in various situations.
Consider the 4 router situation below:
+-----+ +-----+
| RT1 | | RT2 |
+-----+ +-----+
| | common network
---+-----------------------+--------------------------
<BGP> | |
+-----+ <OSPF> +-----+
| RT3 | | RT4 |
+-----+ +-----+
RT1 and RT2 are in one autonomous system, RT3 and RT4 are in another.
RT1 and RT3 are talking BGP with each other.
RT3 and RT4 are talking OSPF with each other.
- Importing network X to OSPF:
Consider an external network X, learnt via BGP from RT1.
RT3 must always fill the OSPF Forwarding Address with the BGP NEXT_HOP attribute for the route to network X.
- Exporting network Y to BGP:
Consider a network Y, internal to the OSPF routing domain, RT3's route to network Y is via RT4, and network Y is to be exported via BGP to RT1.
If network Y is not a subnetted network, RT3 must fill the NEXT_HOP attribute for network Y with the address of RT4. This is to avoid requiring packets to take an extra hop through RT3 when traversing the AS boundary. This is similar to the concept of indirect neighbour support in EGP [RFC888, RFC827].