I am planning to configure Fail-Over using Multi-Homing (with Single ISP) with BGP in Mikrotik,please find the below requirements :
Peering with 2 Juniper Routers at ISP side
We dont have a Public AS
ISP will provide 2 physical 10Mbps links from both their BGP Routers which will be terminating on Mikrotik
Need to configure Mikrotik in such a way that one of the link will be Primary and the second as Back-Up which comes UP immediately when the primary goes down.
ISP will provide a 3 Public /27 Networks.
Please suggest the required configuration to be done in Mikrotik and revert if you need any additional information…
I have a simlilar configuration here, think the major difference is I’m using two boards.
As said before, my setup has two RB1000 and I have one BGP session established with my ISP on each
board. Then, to use only one link I’m sending different a greater matric on my backup session.
At the LAN side I made a VRRP interface to establish default gateway fail-over.
Good tips for that configuration are:
Keep both BGP sessions up all the time, when primary goes down your ISP will automatically use the backup one
Remember to set a bigger metric on BGP outgoing polices at you backup session
You can keep an extra BGP session between your boards, so if primary session with your ISP goes down and local
interface of your master board still up you can get all routes from your backup dinamically. If you dont have memory to do that, just send default route thru BGP or use an static route with low preference.
Well, if you want to use only one board all you need to do is establish two sessions and at your backup session polices you will send a higher metric for outgoing prefixes and set a lower local-preference for received prefixes.
Thanks George for your prompt response…I am running Mikrotik v3.28 on X-86 Server with RAM-2GB and 4 Processors and 4 NIC cards,so I suppose there wont be any Device level constraints.
Will be great if you can provide me with the detailed IBGP configuration of my setup with the below example parameters as this is the first time I am going for BGP in Mikrotik :
metric is not the best way to influence incoming traffic (in fact there’s no best way at all to do this) - it depends if upstream ISP accepts MED (some don’t - they just reset MED to 0 for any external peering and they’re allowed to do that - it’s their AS and they don’t really have to trust other ASes). Another way would be to modify AS-PATH (AS-PATH prepending). I’m pretty sure it can be done with Mikrotik.
In general - there’s no best way to control incoming traffic and that’s because incoming traffic is something that we don’t have full control on…
Any another suggestion - if you have two uplinks to two separate routers - use two routers on your side. Youd have much, much better resilience (I’d say you’ve got much better chance for your RB to go down than their Junipers or links…)
Yet another suggestion - if you don’t have BGP experience be very, very carefull… Your ISP won’t be happy if you start advertising something that you don’t own or if you start flapping the link constantly
I have done it before.
Make sure you create peer setup to 192.168.1.1 & 192.168.2.1
To do FAIL-OVER for the UPSTREAM :
You need to receive Internet full prefix from your main peer (192.168.1.1). It is about 300k prefix today.
Block any prefix received from backup peer (192.168.2.1)
Set your default gateway to backup gateway(192.168.2.1)
By doing this, on normal situation, your routing table will have 300k prefix routes with 192.168.1.1 as the next hop. These routes have higher priority than the default gateway (192.168.2.1). So any packet goes to internet will use 192.168.1.1 as the gateway.
When the main link fail and peer to main gateway terminated, those routes will be removed from routing tables after 180 seconds (default “hold-time” setting. You can set it smaller) then any packet goes to internet will use the default gateway (192.168.2.1).
To do FAIL-OVER for DOWNSTREAM
OK we know that route with smaller segment has higher priority.
For example, if we have 2 routes on our router like these:
202.46.150.0/24 via 202.0.0.1
202.46.150.0/25 via 202.0.0.2
Any packet directed to 202.46.150.5 will be passed to 202.0.0.2 by our router, right.
So what you need to do is :
Advertise 172.16.1.0/27 & 172.16.1.128/25 to your backup peer (192.168.2.1).
And advertise 172.16.1.0/28, 172.16.1.16/28 ,172.16.1.128/26, 172.16.1.192/26 to your main peer (192.168.1.1).
By doing this, on normal situation, your isp main router (I believe this router located above 192.168.1.1(R1) & 192.168.2.1(R2) and closer to the internet), will have 6 active routes :
172.16.1.0/28 via (R1)
172.16.1.16/28 via (R1)
172.16.1.128/26 via (R1)
172.16.1.192/26 via (R1)
172.16.1.0/27 via (R2)
172.16.1.128/25 via (R2)
In this situation, first 4 routes have higher priority, right? Isp main router will always use R1 to reach your network.
When your main link goes down, first 4 routes will be removed from isp main router and your ispmain router will use R2 to reach your network. And how long the router will remove the routes is depend on the isp main router hold-time setting and you can not do anything. What you have to do is just wait.
If your isp set the hold-time to 30 minutes so you have to wait 30 minutes before your backup work.
I hope you get the idea. It is work good for me. What we need to worry is ISP hold-time setting. So make sure you ask ISP about their hold-time setting.
Actually, AS prepending is also work to fail-over the Downstream, but since I’m using public AS and not all router in the internet allow as prepending, so I do not use it. Just make sure you consult to your ISP when you want to use AS prepending.
===============================================
Don’t forget to make the right filters for con01 too!
I’m using med for one reason, if you have a 3th connection with any other ISP the
prepends can force traffic to that ISP when your master connection goes down.
All good ISP’s have the following polices for metrics:
Metric FROM customers: Accept changes
Metric TO customers: Send default
Metric FROM peers: Do NOT accept changes
Metric TO peers: Do NOT send changes
but you always can use prepend if you prefer or your ISP don’t like metrics!