Community discussions

MikroTik App
 
User avatar
mojiro
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Sun Jul 24, 2005 9:21 pm

[BGP] How to connect two bgp networks ...

Sun Mar 27, 2011 9:00 pm

Hello,

I have a problem with two(or more) networks that are using BGP (with lots of AS in every network) and they have to be connected using BGP.

Notes:
a) I have to use only BGP.
b) The following is a simplified example, of course I do not have only six routers or six AS.
c) Aggregation and Confederations does not solutes the problem.
d) I want to reconfigure only border routers.

=======================================================

Networks:
Network1
* Router1 - AS1 - 10.1.1.0/24
* Router2 - AS2 - 10.1.2.0/24
* Router3 - AS3 - 10.1.3.0/24

Network2
* Router4 - AS4 - 10.1.4.0/24
* Router5 - AS5 - 10.1.5.0/24
* Router6 - AS1 - 10.1.6.0/24

Connections:
R1<->R2<->R3 <=> R4<->R5<->R6

=======================================================

Question:
How, I could make R4 to advertise R5 and R6 networks to R3 with AS path "4" instead of "4 5 1"?

or...

How, I could make R3 to advertise R4, R5, R6 networks to R2 with AS path "3" instead of "3 4 5 1"?


Edit:
Note (d) added and confederation word on (c)
Last edited by mojiro on Mon Mar 28, 2011 6:09 am, edited 2 times in total.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: [BGP] How to connect two bgp networks ...

Mon Mar 28, 2011 12:06 am

I am far from a BGP expert, but it is my impression that you shouldn't be able to do that. BGP uses the AS path attribute of a route it receives from a peer to guarantee loop free topology (if the AS path contains the AS of the receiving router the route update is discarded). If some AS were able to rewrite the AS path of a route by removing AS numbers from the path you could no longer guarantee loop free paths.
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: [BGP] How to connect two bgp networks ...

Mon Mar 28, 2011 3:50 am

How, I could make R4 to advertise R5 and R6 networks to R3 with AS path "4" instead of "4 5 1"?
If all of the routers in 'network 2' are under a common administration then it seems what you're describing is BGP Confederations. If you are, I can show you how to do it in MikroTik.

If not, then I don't know of a way to achieve what you're wanting to do. Besides, its probably a bad idea for exactly the same reasons as fewi described.
 
User avatar
mojiro
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Sun Jul 24, 2005 9:21 pm

Re: [BGP] How to connect two bgp networks ...

Mon Mar 28, 2011 6:08 am

Confederation is not a solution, because:
a) I do not want it, because I have to make changes on every router. I want to reconfigure only border routers.
b) It does not advertises what you really believe...

Example
AS10 - Network 1 Confederation

Router4 AS Table:
10.1.1.0/24 - 10 (3 2 1)
10.1.2.0/24 - 10 (3 2)
10.1.3.0/24 - 10 (3)
10.1.4.0/24 - ~
10.1.5.0/24 - (5)
10.1.6.0/24 - (5 1)

Its a bit complicated to explain, but it have been tested, and Confederations does not act as "AS-NAT".
Note: I am not sure if Mikrotik is able to show a result like the above, since we had tested on Cisco.
Last edited by mojiro on Mon Mar 28, 2011 11:25 am, edited 1 time in total.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7053
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: [BGP] How to connect two bgp networks ...

Mon Mar 28, 2011 10:20 am

You can change advertised AS-path with routing filters.
 
User avatar
mojiro
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Sun Jul 24, 2005 9:21 pm

Re: [BGP] How to connect two bgp networks ...

Mon Mar 28, 2011 11:40 am

You can change advertised AS-path with routing filters.
Could you please provide me an example?

Using set-bgp-prepend, you add N times your AS to the end of path...
Using set-bgp-prepend-path, you add a path, at the end of the existing...

I need to rebuild the path. Match and replace.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7053
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: [BGP] How to connect two bgp networks ...

Mon Mar 28, 2011 12:08 pm

Sorry my mistake, it is not possible even with routing filters for the reason fewi mentioned.

If you are not using confederations then your setup is not valid, you can't divide one AS into two (R1 and R6 has the same AS and are not interconnected) and expect it to work.
 
User avatar
mojiro
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Sun Jul 24, 2005 9:21 pm

Re: [BGP] How to connect two bgp networks ...

Mon Mar 28, 2011 12:57 pm

thanks anyway ...

Who is online

Users browsing this forum: No registered users and 41 guests