Community discussions

MikroTik App
 
ubuntu118
newbie
Topic Author
Posts: 29
Joined: Wed Sep 30, 2015 11:56 am

OSPF: Manual cost on PPTP

Sat Sep 15, 2018 10:57 am

Hi
I have two routers connected via PPTP running OSPF. This link is defined as a transit area. I want to set this path's cost to 100, in order to force traffic flow via my main link (this is backup). Main link has one more hop, causing traffic to be flown via this PPTP. I don't want to disable connected and static redistribution on any of my 6 routers, because of frequent network changes and many other connected subnets (This makes managing my network much harder). Any advise?
Thanks
 
kriszos
just joined
Posts: 23
Joined: Thu Dec 21, 2017 3:08 pm

Re: OSPF: Manual cost on PPTP

Sat Sep 15, 2018 1:32 pm

Make sratic pptp interfaces and add them to /routing ospf interface with cost highier than sum of costs on your main link

Wysłane z mojego SM-J510FN przy użyciu Tapatalka

 
ubuntu118
newbie
Topic Author
Posts: 29
Joined: Wed Sep 30, 2015 11:56 am

Re: OSPF: Manual cost on PPTP

Sat Sep 15, 2018 1:56 pm

I did this, added a network and transit area for that interface, but no luck. When I disconnect main link, there is no more route between subnets.
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: OSPF: Manual cost on PPTP

Sat Sep 15, 2018 2:15 pm

Can you post your config? That might be helpful.

Also please post the output of these commands on each router:
routing ospf interface print detail
routing ospf network print detail
routing ospf lsa print detail
 
ubuntu118
newbie
Topic Author
Posts: 29
Joined: Wed Sep 30, 2015 11:56 am

Re: OSPF: Manual cost on PPTP

Sat Sep 15, 2018 2:47 pm

Well, in fact my network is almost complex. Here is the complete scenario and exact problems I have:

HQ - (PPTP over Intranet) - HAS - (Wireless Link) - K1 - (PPTP over Intranet) - K2
And also:
HQ - (PPTP over Intranet) - K1Backup - (Cable) - K1
HQ - (PPTP over Intranet) - K2Backup - (Cable) - K2

K1Backup and K2Backups are connected through LTE for failover connecting to HQ.

Subnets:
HQ: 192.168.134.0/24
K1: 192.168.125.0/25
K2: 192.168.179.0/25

OSPF Configurations:

HQ:
/routing ospf area
add area-id=0.0.0.1 name=HQ-HAS-Transit
add area-id=0.0.0.5 name=K1-HQ-Transit
add area-id=0.0.0.7 name=K2-HQ-Transit
/routing ospf instance
set [ find default=yes ] metric-connected=1 metric-static=10 redistribute-connected=as-type-1 redistribute-static=as-type-1 router-id=172.15.0.1
/routing ospf interface
add cost=100 interface=K1 network-type=point-to-point
add cost=100 interface=K2 network-type=point-to-point
/routing ospf network
add area=backbone network=192.168.0.0/16
add area=backbone network=172.16.0.0/12
add area=HQ-HAS-Transit network=172.16.2.4/30
add area=K1-HQ-Transit network=10.0.0.0/30
add area=K2-HQ-Transit network=10.0.0.4/30
/routing ospf virtual-link
add neighbor-id=172.15.0.2 transit-area=HQ-HAS-Transit
add disabled=yes neighbor-id=172.15.0.5 transit-area=K1-HQ-Transit
add disabled=yes neighbor-id=172.15.0.6 transit-area=K2-HQ-Transit

HAS:
/routing ospf area
add area-id=0.0.0.1 name=HQ-HAS-Transit
add area-id=0.0.0.2 name=HAS-K1-Transit
/routing ospf instance
set [ find default=yes ] metric-connected=1 metric-static=10 redistribute-connected=as-type-1 redistribute-static=as-type-1 router-id=172.15.0.2
/routing ospf network
add area=backbone network=172.27.2.0/24
add area=HAS-K1-Transit network=172.27.3.0/24
add area=backbone network=172.27.5.0/24
add area=HQ-HAS-Transit network=172.16.2.4/30
/routing ospf virtual-link
add neighbor-id=172.15.0.1 transit-area=HQ-HAS-Transit
add neighbor-id=172.15.0.3 transit-area=HAS-K1-Transit

K1:
/routing ospf area
add area-id=0.0.0.2 name=HAS-K1-Transit
add area-id=0.0.0.3 name=K1-K2-Transit
add area-id=0.0.0.4 name=K1-Backup-Transit
/routing ospf instance
set [ find default=yes ] metric-connected=1 metric-static=10 redistribute-connected=as-type-1 redistribute-static=as-type-1 router-id=172.15.0.3
/routing ospf network
add area=backbone network=192.168.125.0/25
add area=backbone network=172.19.0.0/24
add area=backbone network=172.20.0.0/24
add area=HAS-K1-Transit network=172.27.3.0/24
add area=K1-K2-Transit network=172.16.9.0/30
add area=K1-Backup-Transit network=172.16.5.0/30
/routing ospf virtual-link
add neighbor-id=172.15.0.2 transit-area=HAS-K1-Transit
add neighbor-id=172.15.0.4 transit-area=K1-K2-Transit
add neighbor-id=172.15.0.5 transit-area=K1-Backup-Transit

K2:
/routing ospf area
add area-id=0.0.0.3 name=K1-K2-Transit
add area-id=0.0.0.6 name=K2-Backup-Transit
/routing ospf instance
set [ find default=yes ] metric-connected=1 metric-static=10 redistribute-connected=as-type-1 redistribute-static=as-type-1 router-id=172.15.0.4
/routing ospf network
add area=backbone network=172.21.0.0/24
add area=backbone network=192.168.179.0/25
add area=K1-K2-Transit network=172.16.9.0/30
add area=K2-Backup-Transit network=172.16.6.0/30
/routing ospf virtual-link
add neighbor-id=172.15.0.3 transit-area=K1-K2-Transit
add neighbor-id=172.15.0.6 transit-area=K2-Backup-Transit

K1Backup:
/routing ospf area
add area-id=0.0.0.4 name=K1-Backup-Transit
add area-id=0.0.0.5 name=K1-HQ-Transit
/routing ospf instance
set [ find default=yes ] metric-connected=1 metric-static=10 redistribute-connected=as-type-1 redistribute-static=as-type-1 router-id=172.15.0.5
/routing ospf interface
add cost=80 interface=HQ network-type=point-to-point
/routing ospf network
add area=K1-Backup-Transit network=172.16.5.0/30
add area=K1-HQ-Transit network=10.0.0.0/30
/routing ospf virtual-link
add neighbor-id=172.15.0.3 transit-area=K1-Backup-Transit

K2Backup:
/routing ospf area
add area-id=0.0.0.6 name=K2-Backup-Transit
add area-id=0.0.0.7 name=K2-HQ-Transit
/routing ospf instance
set [ find default=yes ] metric-connected=1 metric-static=10 redistribute-connected=as-type-1 redistribute-static=as-type-1 router-id=172.15.0.6
/routing ospf interface
add cost=100 interface=HQ network-type=point-to-point
/routing ospf network
add area=K2-Backup-Transit network=172.16.6.0/30
add area=K2-HQ-Transit network=10.0.0.4/30
/routing ospf virtual-link
add neighbor-id=172.15.0.4 transit-area=K2-Backup-Transit


Now, this is the problem: When all links are connected, all routes are OK. Traffic from 134 to 125 goes through HQ-HAS-K1, from 134 to 179 goes through HQ-HAS-K1-K2 and from 125 to 179 goes through K1-K2, and vice-versa. All of these are main links. But when I drop link e.g. between HAS and K1, 125 and 179 subnets completely disappear from routing tables and completely disconnect from the entire network. In theory, when this link is dropped, traffic from 134 to 125 should go through K1Backup-K1 and traffic from 134 to 179 should go through K2Backup-K2.
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: OSPF: Manual cost on PPTP

Sat Sep 15, 2018 3:05 pm

At first glance, the main issue is with your design.

If you look at the MIkroTik Wiki on OSPF area design, you'll see that multiple areas are all attached to the backbone area.But not Area 1 going to Area 2

Image

OSPF is not intended for areas other than backbone to transit another area. It looks like you've already dealt with this because you built virtual links but even that will break down at some point. Virtual links are intended to be a last resort or to be used in network migrations. They aren't designed to overcome a fundamental design issue.

Questions I have to be able to give you some direction
What is the intent of your area design?
How many routes do you have in the OSPF table?
How many other OSPF routers are there besides the ones you posted?
 
ubuntu118
newbie
Topic Author
Posts: 29
Joined: Wed Sep 30, 2015 11:56 am

Re: OSPF: Manual cost on PPTP

Sat Sep 15, 2018 3:15 pm

First of all, I should tell you that I am completely new to OSPF and I have configured all routers according to manuals and posts in forums.

My backbone is partitioned over 3 physical sites: HQ, K1 and K2. All of the subnets in these sites (of which I have mentioned only important ones) should be able to see each other. HAS router is connected to other sites which I don't own and only provide static routes for. When All links are OK, I have 42 routes in OSPF window. And there is absolutely no other OSPF router in my network. What approach do you suggest instead of virtual links?
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: OSPF: Manual cost on PPTP  [SOLVED]

Sat Sep 15, 2018 3:55 pm

No problem! OSPF can be very complicated and takes a while to learn :-)

To makes things much easier for yourself, here is what I would do.

1. Put all subnets that connect routers together into the backbone area aka transit links like your PPTP interfaces/subnets
2. Put all subnets that aren't involved in connecting routers together into Area 1 at every site
3. Remove all virtual links

After you do that, OSPF cost will work properly.
 
ubuntu118
newbie
Topic Author
Posts: 29
Joined: Wed Sep 30, 2015 11:56 am

Re: OSPF: Manual cost on PPTP

Sat Sep 15, 2018 4:12 pm

Many many thanks for your great help and idea! It did exactly what I wanted!
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: OSPF: Manual cost on PPTP

Sat Sep 15, 2018 5:10 pm

Many many thanks for your great help and idea! It did exactly what I wanted!
Perfect, glad I could help...just update the status of the thread to 'Solved' :-)

Who is online

Users browsing this forum: No registered users and 18 guests