Community discussions

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

OSPF confusion

Sat Apr 08, 2017 11:31 am

Running 5 RB1100x's 6.38.3

4 routers are in a baseball shaped diamond consisting of one router at each of home, first, second, and third bases.

Internet is connected to home, home is connected to third and first, and third and first are connected to second, all by
PTP wireless links.

A 5th router is connected to first base forming a leaf community that runs on 10.16.2.0/24 which is ether2 of the leaf router.

OSPF by default routes the leaf subnet from home to first to the leaf.

But the link from home to first fills up at night, and so I have taken to installing a static route at 7pm every night,
to send the leaf bound subnet to third base first directly from home. Third sends it to second, then to first then to the leaf.

However it takes over an hour for the route to start working.

Shortly have adding the static route, the OSPF routes on second base show

10.16.2.0/24 third, first

Third is probably showing up because that is the route back to home where the static is, and its LSA indicates that is where
the data came from. But this is NOT a proper route for the packet to go.

First is showing up because that is the correct next hop to the leaf, and the LSA on second for that route shows that it came from the leaf router which is correct.

However a traceroute shows that the packets are now going from home -> third -> second -> third -> second -> third over and over
again causing a serious loop, they never get to the leaf.

After about an hour, the packets start traveling properly to the leaf, even though the OSPF on second has not changed its display at all.

What don't I understand? If you all need prints, let me know what to give you, so I don't waste your time.

Homer
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: OSPF confusion

Sun Apr 09, 2017 6:03 pm

This is probably better achieved with costing. Increase the cost of the link between home and first base at 7PM instead of installing a static route. You actually want the router to prefer a path to 10.16.2.0/24 that is learned naturally through OSPF that travels from first -> second -> third -> home. It's also a lot safer. The lowest cost route wins.

Try adjusting the cost of the link on first base going to home to be higher than the cost would be to take the round-about path. So on the first base router.
/routing ospf interface set X cost=BiggerNumber
^^ I believe this is it. Not in a situation where I can test.
 
User avatar
homerwsmith
Member Candidate
Member Candidate
Topic Author
Posts: 166
Joined: Fri Dec 02, 2011 3:01 am
Location: Ithaca, NY
Contact:

Re: OSPF confusion

Mon Apr 10, 2017 10:47 am

Thank you for your answer.

I have solved the problem by using 0.0.0.0/0 as the network statement for all the routers in the baseball diamond. Apparently
witth this setup static routes redirecting traffic do not confuse OSPF and the change over happens instantaneously and second base does not show two routes for the subnet, one back to home which is undesired.

The problem with changing costs, is there are many such subnets on the same route from home to the leaf, but I wish to only
redirect the heaviest used one, thus a per subnet solution is better than a per interface solution.

Thanks again for taking your time with me, I really appreciate it.

Homer W. Smith
CEO Lightlink Internet
 
User avatar
paolopoz
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Thu Oct 31, 2013 6:38 pm

Re: OSPF confusion

Mon Apr 10, 2017 11:01 am

I second idlemind: path cost is the way to go.
You can also take advantage of Equal Cost Multi Path (ECMP) from OSPF: if a router sees two paths with same total cost it will equally distribute the streams in both links. However keep in mind this is working only for new data streams, so it will take time to balance the traffic. Also the more streams the more it will balance equally.

On a side note, if you want your actual configuration to work maybe (and if it doesn't break anything else) you should set redistribute-static=no inside OSPF instance of the routers with the added route.
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: OSPF confusion

Mon Apr 10, 2017 3:31 pm

Another option would be to use routing filters to set override the next-hop on the prefix.
/routing filter add chain=ospf-in prefix=x.x.x.x/y protocol=ospf set-in-nexthop=DesiredNextHop
If the leaf is off of 1st base do this on home and 3rd.