Community discussions

MikroTik App
 
Cablenut9
Long time Member
Long time Member
Topic Author
Posts: 542
Joined: Fri Jan 08, 2021 5:30 am

A weird routing problem

Sat Jun 05, 2021 10:49 pm

Let's say I have three Mikrotik routers, and each router has its own route to to to the Internet.

R1 --- Internet
|
R2 --- Internet
|
R3 --- Internet

I can set up OSPF so each router knows the best path to any destination on this routed network. However, I need a way for some traffic on R1 to reach the Internet when using R3 as the gateway. Normal L3 routing makes it easy to use R2 as a gateway, so don't think about that. However, without a L2 network to help, there's no way for R2 to tell between traffic destined toward it and then the Internet, and traffic going to R3 and then to the Internet. Is there a way to do this? I thought of a couple methods:
1. L2TP VPN. This would technically work, but is a nightmare to set up because it has to be done for every single multi-router link, and in my network, that's a lot of links.
2. MPLS. This could actually work better, but some kind of setup still has to be done on every link and I don't know how to do it. I need a simple setup where R2 would look at the MPLS packet and immediately know that this packet isn't intended for it, so it uses regular IP routing to send the packet to the destination, and only use MPLS to see if it should take that packet and send it to the Internet using its own gateway.

I would want to do this in order to set up a kind of load balancing for R1, so if I had a mesh network, I could take advantage of multiple routes to the Internet and have it dynamically recover from link losses with OSPF. Here's what it could look like:
Internet
|
R1 --- +
|      |
R2 ----|--- Internet
|      |
R3 --- R4 --- Internet
|
Internet
 
bugtoodd
just joined
Posts: 10
Joined: Thu Jun 29, 2017 5:54 pm

Re: A weird routing problem

Sat Jun 05, 2021 11:28 pm

Hey there,
I would create a vlan on the interface between R1 and R2, and put the VLAN in R2 into a separate VRF (only in R2), then assign a /30 on the vlan on the two R1 and R2 routers.
In R2 VRF routing table then install a default route with gateway R3@main (leaking R3 from the main routing table).
This allows for upstream traffic to go from R1 to R3 and then to the Internet. Traffic coming back to R1 from R3/Internet will follow the normal OSPF path.

More info: https://wiki.mikrotik.com/wiki/Manual:V ... Forwarding

Have fun!

Daniel
 
Cablenut9
Long time Member
Long time Member
Topic Author
Posts: 542
Joined: Fri Jan 08, 2021 5:30 am

Re: A weird routing problem

Sun Jun 06, 2021 12:01 am

If I add R3 as the default route on the R2 VRF, does that mean I can't use R2 as a gateway for some traffic from R1?
 
Cablenut9
Long time Member
Long time Member
Topic Author
Posts: 542
Joined: Fri Jan 08, 2021 5:30 am

Re: A weird routing problem

Sun Jun 06, 2021 2:45 am

Update: I think IPIP might work for this because it simply puts an IP header on top of the original IP packet. Then, the outer layer can be processed as if it were regular inter-network traffic, so normal routing will work for that. When the packet reaches the destination router, the inside gets extracted and sent to the Internet.
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: A weird routing problem

Sun Jun 06, 2021 7:38 pm

Traffic engineering in OSPF is a losing battle.

You can either use MPLE TE as previously stated or consider an eBGP design which gives you hop-by-hop control over routes and path selection.

Here is a MUM presentation I gave on that design:

https://mum.mikrotik.com/presentations/ ... 062656.pdf

Who is online

Users browsing this forum: FranMercedesG and 18 guests