Inserting default route into OSPF

This should be a well-known fact (and it's obliquely described in IOS documentation) - if you're redistributing a default route into OSPF (for example, you have a static default route configured with ip route 0.0.0.0 0.0.0.0 ... and you use redistribute static subnets within the OSPF process), the default route will not be entered into the OSPF database unless you configure default-information originate within the router ospf configuration.

Similarly, if you configure default-information originate always, the router will inject the type 5 LSA for the default route into the OSPF topology database even if the router itself does not have a default route (or gateway of last resort).

6 comments:

  1. Ivan,

    Which one is better comparing default-information originate with
    default-information originate always?
    Is there any scenario perhaps applicable to both commands?

    thanks in advance.

    ReplyDelete
  2. If you omit always it won't inject default route if it doesn't have default route itself. Which is better? It depends on your configuration.

    ReplyDelete
  3. Ivan,

    Thank you so much. Now it's better understanding! :)

    ReplyDelete
  4. Quick tip for people who are using OSPF with MPLS VPN.
    Let's say you want that all your branch offices access to the internet through your HQ office

    So you will use a default route and redistribute it within your OSPF domain

    be aware of this:

    MP BGP does not redistribute external routes "natively":
    You need : redistribute ospf 1 vrf X match internal external 1 external 2 route-map IMPORT_BGP within your address-family ipv4 vrf X

    Even if the PE have the 0.0.0.0/0 LSA type 5 within his OSPF database, he will not redistribute the route "natively":
    You need : default information-originate within your address-family ipv4 vrf X

    Be aware of that :D

    I am going to read Ivan's book regarding MPLS because I had a very hard time to find the answer on cisco.com ... and I found it elsewhere ... :()


    ReplyDelete
    Replies
    1. And you will definitely not find the answer in my book - I was not aware of this behavior ;)

      Thanks for sharing!
      Ivan

      Delete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.