Configuring OSPF on a logical router enables VM connectivity across logical routers and from logical routers to edge services gateways (ESGs).
OSPF routing policies provide a dynamic process of traffic load balancing between routes of equal cost.An OSPF network is divided into routing areas to optimize traffic flow and limit the size of routing tables. and an area is a logical collection of OSPF networks, routers, and links that have the same area identification. basically areas are identified by an Area ID.
Before we proceed with OSPF configuration , first on our deployed DLR, a Router ID must be configured , a to configure Router ID:
1- Log in to the vSphere Web Client and click Networking & Security.
2- Select NSX Edges under the Networking & Security section.
3 – Double-click the distributed logical router on which to configure OSPF.
4 – On the Manage tab:
- Select the Routing
- Select Global Configuration section from the options on the left.
- Under the Dynamic Routing Configuration section, click Edit.
5 – In the Edit Dynamic Routing Configuration dialog box:
- Select an interface from the Router ID drop-down menu to use as the OSPF Router ID.
- Select the Enable Logging check box.
- Select Info from the Log Level drop-down menu.
- Click OK.
6 – Click Publish Changes.
Now you have configured Router ID , now let’s configure OSPF:
1 – Select the OSPF section from the options on the left:
- Under the Area Definitions section, click the green + icon to add an OSPF area.
2 – In the New Area Definition dialog box:
- Enter the OSPF area ID in the Area ID text box.
- Select the required OSPF area type from the Type drop-down menu:
- Normal
- NSSA, which prevents the flooding of AS-external link-state advertisements (LSAs) into NSSAs.
- Select the required authentication type from the Authentication drop-down menu and enter a password, this is optional.
- Click OK.
3 – Under the Area to Interface Mapping section, click the green + icon.
4 – In the New Area to Interface Mapping dialog box:
- Select an appropriate uplink interface in the Interface drop-down menu.
- Select the OSPF area from the Area drop-down menu.
- Enter 1 in the Hello Interval text box.
- Enter 3 in the Dead Interval text box.
- Enter 128 in the Priority text box.
- Enter 1 in the Cost text box.
- Click OK.
5 – Under the OSPF Configuration section, click Edit.
- In the OSPF Configuration dialog box:
- Select the Enable OSPF check box.
- Enter the OSPF protocol address in the Protocol Address text box.
- Enter the OSPF forwarding address in the Forwarding Address text box.
- Select the Enable Graceful Restart check box for packet forwarding to be uninterrupted during restart of OSPF services.
- Select the Enable Default Originate check box to allow the NSX Edge to advertise itself as a default gateway to its peers .(optional)
- Click OK.
6 – Click Publish Changes.
7 – Select the Route Redistribution section from the options on the left:
- Click Edit.
- Select OSPF.
- Click OK.
8 – Under the Route Redistribution table section, click the green + In the New Redistribution criteria dialog box:
- Select the IP prefixes from the Prefix Name drop-down menu
- Select OSPF from the Learner Protocol drop-down menu.
- Select the necessary appropriate Allow Learning From
- Select Permit from the Action drop-down menu.
- Click OK.
9 – Click Publish Changes.
Our Lab topology will be as below , in my other posts , where i have created Logical switches , add one interface to this DLR as per below topology , this will allow VMs connected to both the logical switches will now be able to talk to each other because the logical router’s connected routes (172.16.10.0/24 and 172.16.20.0/24) are advertised into OSPF.