Community discussions

MikroTik App
 
hci
Long time Member
Long time Member
Topic Author
Posts: 674
Joined: Fri May 28, 2004 5:10 pm

How To Setup BGP with a Single Peer

Wed Apr 27, 2011 10:13 pm

I am asking if I have this right for setting up BGP with a single peer.

First enable BGP:

/routing bgp instance set default as=MyASN redistribute-static=no

redistribute-connected, redistribute-static, redistribute-rip, redistribute-ospf and redistribute-other-bgp should all be no.

Then add a peer:

/routing bgp peer add remote-address=peer_ip_address remote-as=peer_ASN

Then add my IP's to advertise:

/routing bgp network add network=my_/24

This is what I skimmed from the manual. Can someone tell me what I have wrong on this? Or perhaps its all right?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: How To Setup BGP with a Single Peer

Wed Apr 27, 2011 10:28 pm

That's basically it, but best practice would probably also include manually choosing a router-id. If possible it should be a static, public IP address on one of the router interfaces.
 
hci
Long time Member
Long time Member
Topic Author
Posts: 674
Joined: Fri May 28, 2004 5:10 pm

Re: How To Setup BGP with a Single Peer

Wed Apr 27, 2011 10:45 pm

That's basically it, but best practice would probably also include manually choosing a router-id. If possible it should be a static, public IP address on one of the router interfaces.
Our first and maybe only peer will be Hurricane depending on how they perform. Everyone I talk to that uses them is happy though. I imagine they will assign us a single IP with the circuit. Should I assign that IP as a router-id or one I own that I will advertise? Can the router-id be changed later?

Is adding a 2nd peer as simple as doing this again:

/routing bgp peer add remote-address=peer_ip_address remote-as=peer_ASN

And the big question, how do I add IPv6 to this?

Thanks.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: How To Setup BGP with a Single Peer

Wed Apr 27, 2011 11:15 pm

I'd choose an IP address you own. Yes, it can be changed.

Yes, adding a second peer is that simple.

See this (http://wiki.mikrotik.com/wiki/Manual:IPv6_Overview#BGP) manual entry for how to add IPv6. Basically, add the address family to the peer, and then add the IPv6 networks as you would add IPv4 networks.
 
gregsowell
Member Candidate
Member Candidate
Posts: 128
Joined: Tue Aug 28, 2007 1:24 am
Contact:

Re: How To Setup BGP with a Single Peer

Fri Apr 29, 2011 6:18 am

fewi is on the case, so there is most likely very little I can add :) But I love to force my opinion on others, so here goes.

As per the question of adding a second peer, I would add outbound filters to my BGP advertisements. I only send to the providers what I want them to have. If you are sending two providers everything in your BGP tables, you run the risk of becoming a transit point between their systems which is not good for your bandwidth bills :) It's also a best practice, so you might as well start now.

I've found manually setting the router ID is more a best practice when doing IBGP, which it doesn't appear you have a major need for at the moment.

If you bring on a second provider I would suggest using a second router. This allows for software updates and hardware issues while still maintaining network uptime.

Those are the first things that popped into my head.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: How To Setup BGP with a Single Peer

Fri Apr 29, 2011 4:24 pm

Ouch, forgetting outbound filtering is a pretty big thing to forget. No wonder they don't trust me with WAN routers ;o)
 
hci
Long time Member
Long time Member
Topic Author
Posts: 674
Joined: Fri May 28, 2004 5:10 pm

Re: How To Setup BGP with a Single Peer

Mon May 09, 2011 6:59 pm

I would add outbound filters to my BGP advertisements. I only send to the providers what I want them to have. If you are sending two providers everything in your BGP tables, you run the risk of becoming a transit point between their systems which is not good for your bandwidth bills :) It's also a best practice, so you might as well start now.
Doesn't unchecking 'route reflect' on the peer and all the 'redistributes' under BGP config solve this?
 
hci
Long time Member
Long time Member
Topic Author
Posts: 674
Joined: Fri May 28, 2004 5:10 pm

Re: How To Setup BGP with a Single Peer

Mon May 09, 2011 7:01 pm

If I have two peers and want to prefer one over the other how do I do that?
 
gregsowell
Member Candidate
Member Candidate
Posts: 128
Joined: Tue Aug 28, 2007 1:24 am
Contact:

Re: How To Setup BGP with a Single Peer

Mon May 09, 2011 7:06 pm

If you have two peers and you want to set precedence of one over the other, you want to change how they are evaluated.

By default, BGP will use AS-path, or how many AS paths away a route is. If you want to defy this, the easiest thing to do is to use something that is evaluated before AS path is, which would be local preferece or weight.

Weight is nontransitive, which means it is significant only on the router you configure it on.

Local preference is transitive and will be sent to all other IBGP neighbors.

Create a route filter and assign it accordingly: http://wiki.mikrotik.com/wiki/Manual:Ro ... ng_filters.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: How To Setup BGP with a Single Peer

Mon May 09, 2011 7:11 pm

If you also need to influence inbound routing - weight and local preference will influence outbound routing - with more than one ISP you can use AS prepending (example here: http://wiki.mikrotik.com/wiki/Manual:Si ... ng_Filters) to send a longer AS path to one of the peers. The Internet at large will pick up both routes, but prefer the one through the ISP that receives a shorter AS path from you.

If both peers are with the same ISP you can use MED, but should probably get with the ISP to coordinate that and make sure they don't use weights on their side, which would override your MED settings.
 
gregsowell
Member Candidate
Member Candidate
Posts: 128
Joined: Tue Aug 28, 2007 1:24 am
Contact:

Re: How To Setup BGP with a Single Peer

Mon May 09, 2011 7:40 pm

fewi FTW...if they could only combine our brains we could take over the world. Lets use your body, though...you have better hair.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: How To Setup BGP with a Single Peer

Mon May 09, 2011 7:48 pm

I don't know about that. This here hairline is receding at a pace that has physicists reconsider whether the speed of light is an absolute barrier.
 
hci
Long time Member
Long time Member
Topic Author
Posts: 674
Joined: Fri May 28, 2004 5:10 pm

Re: How To Setup BGP with a Single Peer

Mon May 09, 2011 11:29 pm

Been studying this:

http://wiki.mikrotik.com/wiki/Manual:Routing/BGP

And looking at this link:

http://wiki.mikrotik.com/wiki/Manual:Si ... ring_setup

Very useful, thanks. But doing this:

add chain=isp2-out prefix=10.1.1.0/24 action=accept set-bgp-prepend=3

Should slow my inbond traffic on isp2 connection. It also says: "use policy routing to force outgoing packets over the same link as incoming" which makes sense. But there is no good example how to do that.

Also, is there a way to simply weight the outgoing traffic on ISP2 similiar to prepend=3 but effective on outbound?

Thanks.

Who is online

Users browsing this forum: No registered users and 29 guests