VMware NSX 6.1 for vSphere – Configuring OSPF route distribution

Caution: Articles written for technical not grammatical accuracy, If poor grammar offends you proceed with caution ;-)

In my previous NSX articles we covered installing and configuring NSX, We discussed deploying/configuring Transport Zones, Logical Switches, Logical RoutersEdge Gateways, and connecting the Logical and Edge Gateways.  With all these completed we now have an environment that with the appropriate routes and transport traffic from our physical network to our logical networks that we deployed.  The missing price is the routes.  We could go and configure a bunch of static routes throughout all the NSX routers and our physical routers, but that wouldn’t be fun.  It also wouldn’t be automated.  In this post I am going to walk through configuring the NSX routers to use OSPF for route distribution.

Configuring OSPF on a Distributed Logical Router

  1. Navigate to the NSX Edges menu and double click on your logical routerimage
  2. Now select Routing from the top menu, then Global Configuration from the left menu and click the Edit button above Dynamic Routing Configurationimage
  3. When the dialog opens select the uplink network that is connected to the Edge Router, optionally enable logging, and then click OK.image
  4. Click Publish Changes and then select OSPF from the left menu.
    *Note – If you look at Dynamic Routing Configuration you will see that your router has an ID that is it’s IP address on the network that was chosenimage
  5. Next select the Green + under Area Definition.image
  6. Enter a value for Area ID.  Do not use 0 or 51.  I’m going to use 20.  Click OK when finished.image
  7. Next Click the Green + under Area to Interface Mapping.

  8. Next to interface select the interface that connects to the Edge Router, then select the area that we just created and click OK.image
  9. Click Publish Changes.  Once the settings are published click edit next to OSPF Configurationimage
  10. On the OSPF Configuration dialog check Enable OSPF and then we will need to input two IP addresses.  The forwarding address should be the IP address we assigned to the Uplink interface of the logical router.  If you remember in the article connecting logical and edge routers the network that we created between the two routers was a /29 not a /30.  This is the reason why.  We need to assign another IP address on the subnet to the Protocol address.   Once Finished click OK.*Note –  The protocol addresses in needed because the routing stack is a function of the control vm and the IP address it uses for updates needs to be local, unlike the forwarding address which is distributed across all ESXi hosts.image
  11. Finally select Route Redistribution from the left menu and make sure in the route redistribution table you have an OSPF entry that is set to redistribute static and connected for any.image
  12. The OSPF configuration of the Distributed Logical Router is now complete.  The Distribute Logical Router is now sharing OSPF routing information over the Uplink interface that connects it to the Edge Gateway.  We now need to configure OSPF on the Edge Gateway.


Configuring OSPF on an Edge Gateway

  1. Much like the we did on the logical router we need to configure a router ID on the Edge Gateway.  Only on the Edge Gateway you will choose it’s uplink interface, not the interface that connects it to the Logical Router.   On Routing menu select Global Configuration from the left menu, then click edit.  When the dialog opens select the uplink network, optionally enable logging and click ok.  When you are finished don’t forget to publish your changes.image
  2. Next we need to add the Area Definitions.  We will need to add a definition ID the same as the one that we added to the logical router.  I used 20 when I configured my logical router.  We also need to add Area 0 if it doesn’t already exist.  Once they are both created we need to add area to interface mappings.  We will need to map area 20 to the interface that connects us to our logical router and area 0 to the interface that connects us to the physical infrastructure.  Don’t forget to click publish changes when you are finished.image
  3. Next click Edit next to OSPF Configuration and enable OSPF then click OK.  Don’t forget to publish changes when finished.
    *Note – Take note that we don’t need to specify any IP addresses on an Edge Router.  That is because the Edge router is an appliance and it handles it’s own routing.  It’s not distributed.image
  4. Finally select Route Redistribution from the left menu and make sure in the route redistribution table you have an OSPF entry that is set to redistribute static and connected for any.image
  5. OSPF is now configured on the Edge Gateway to share routes with the Logical Router as well as your physical network over the Edge Gateways Physical interface.  You will need to have your physical router configured of OSPF and to share OSPF for area 0 on the same network that the Edge Gateway is.  In the MoaC lab we have a transit network between the Edge Gateway and the Physical Router much like we did for the logical router to Edge Gateway.We are using a Ubiquiti EdgeMax LIte router.  Below if a screenshot of it’s OSPF router and you will see the routes for the networks we created for use in this example.image

Now to challenge yourself go ahead and create another logical switch and attach it to your Distributed Logical Router.  Your new network should automatically appear in your OSPF routing table for your physical router within seconds.]

Leave a Reply