Community discussions

MikroTik App
User avatar
Member Candidate
Member Candidate
Topic Author
Posts: 155
Joined: Fri Dec 02, 2011 3:01 am
Location: Ithaca, NY

OSPF and default routes.

Sun Jan 13, 2019 8:19 am

We have a 4 router network that looks like a baseball diamond, with a router at home (R0), first (R1), second (R2) and third (R3) bases.

They are connected as a single area0. There are no cross connections across the diamond.

The internet is connected to the outward facing interface on R0 at home base.

There are presently static default routes at R2 second base pointing to R1 at first base, and a default at R1 pointing to R0 at Home. Home of course has a default route pointing to the internet.

In the same manner R3 at third base also has a default route pointing to R0 at home.

Let's say the link between R2 and R1 goes down. Now i want the traffic to automagically go from R2 to R3 to R0, but the static default route at R2 still points to R1 which now goes nowhere.

How do I set up ospf to allow my default routes to 'float' and rearrange themselves to the best configuration so
nothing goes down during this outage?


Homer W Smith, CEO Lightlink Internet.
Last edited by homerwsmith on Wed Apr 10, 2019 9:46 pm, edited 1 time in total.
Long time Member
Long time Member
Posts: 535
Joined: Mon May 27, 2013 2:05 am

Re: OSPF and default routes.

Sun Jan 13, 2019 10:21 am

If your redistributing default via OSPF, and all links are equal cost, then it should do this automatically anyways. However - a router will not install an OSPF default route if a static one exists, so you'll have to remove the static one and let the default come in - an easy way to test this if you dont have OOB, is static route the IP you are coming from and delete default, see if OSPF automatically installs one, if not check your configs to make sure its allowing defaults to redistribute.
Frequent Visitor
Frequent Visitor
Posts: 51
Joined: Fri Jun 22, 2018 8:32 am

Re: OSPF and default routes.  [SOLVED]

Mon Jan 14, 2019 10:12 am

There are 2 concepts you can use:

1. distribute default
  • Install a default static route (or receive one from your upstream provider via DHCP/PPP etc)
    Modify the OSPF instance on the R0 router to include the following: /routing ospf instance distribute-default=if-installed-as-type1 default (assuming your instance name is 'default'
This will propagate the default route via OSPF as an External Type 1. You can then set your preferred traffic controls via OSPF cost

2. You can install a floating static
  • On every router with the exception of R0, you install 2 default routes.
    One with a default distance (your preferred path)
    And another facing in the other direction with a elevated distance value
The problem with floating statics if you are at 2nd base and your preferred path is 1st base, but the link from 1st to home is down, then the route will get stuck in a routing loop (bad). Not to mention that scaling that is a nightmare.

I would set up OSPF as described in option 1 and remove the static routes once convergence is completed from all routers with the exception of the internet peer router.

Note: OSPF (by default) has a dead time of 40, meaning that if no links drop, your time to reconverge the routing table will take the expiry of that timer (40 seconds). If you signal BFD you can lower that significantly.
Hope this helps
Network Solutions Engineer and Trainer
Cisco | Juniper | Mikrotik | Ubiquiti
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Wed Oct 31, 2018 5:07 pm

Re: OSPF and default routes.

Thu Jan 17, 2019 9:31 pm

Hi TheCiscoGuy,
what if we have just ether 1 on each routers interface and using unmanaged switches so all the routers are connected to each other on ether1(there is one public ip and one private).So with just one link how we are gonna do cost change for load balancing I am attaching an image what I am trying to say.We are using pppoe servers on the the tower and there is no need for any tunnels and all ip addresses for pppoe clients are public ip addresses. I am so confused with this load balancing.
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: YaCy [Bot] and 10 guests