Community discussions

MikroTik App
 
bejcd
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Oct 27, 2005 7:26 pm

redistribute OSPF to BGP ...

Sun Dec 18, 2005 8:51 pm

Hi,

I would like to know how to redistribute /20 network subnetted and internally advertised by OSPF to BGP ?
I have tried to make a configuration but encountered problems in configuration. In fact, BGP works well and I can see more than 150000 routes injected externally.
I can also see a default gateway propagated by BGP but it seems that BGP cann't "see" the internal OSPF network.

My configuration includes:
1) MT v2.9.9 + routing test package
2) BGP and OSPF installed on the same "edge" router (p4, 2.4Ghz, 512Mb)
3) 4 x 10M/100M/1G ethernet cards - 2 for upstreams ("peer's") and 2 for a local network
I've tried to configure a BGP section as following:
. . .
redistribute-static: no
redistribute-connected: no
redistribute-rip: no
redistribute-ospf: yes
I have also added Null static route for the /20 prefix in the "ip route" section (created Null Bridge, assigned IP and defined a static route) but it seems a redistribution doesn't work.

Does anybody have a solution how to filter out injected routes from BGP - just to advertise my prefix (x.y.z.w/20) ?


Thank you .
D.
 
ysam
just joined
Posts: 22
Joined: Fri Sep 02, 2005 9:26 pm

Mon Dec 19, 2005 12:15 am

Hi,

Just to understand the situation, do you want to advertise your /20 or your /20 and the rest of your highier prefixes from your OSPF Network?

One hint for the routing-test setup is. Make sure that you see an ACTIVE route (the one you created with your null interface.) in the "ip route" list this should include an "A" symbol wich denotes an Active route. Then you will actualy be able to advertise it.

Second hint for your /20 is that if you just want to advertise only that route (and should be, unless you are looking for a more complex setup) you just do the following in your BGP setings

redistribute-static: no
redistribute-connected: yes
redistribute-rip: no
redistribute-ospf: no

and create a filter to allow your /20 and deny the rest and apply it outgoing to your external links.

sample

/routing prefix-list add prefix-list=bgp-out prefix=yournetwork/20 prefix-length=20 action=accept comment="my network"
/routing prefix-list add prefix-list=bgp-out prefix=0.0.0.0/0 prefix-length=0-0 action=reject comment="reject the rest higher prefixes"

Then go to your bgp outgoing peers and apply that filter. ( Assume that the peers are peer 0 and 1)

/routing bgp peer print
/routing bgp peer set 0 prefix-list-out=bgp-out keepalive-timer=30 hold-timer=90
/routing bgp peer set 1 prefix-list-out=bgp-out keepalive-timer=30 hold-timer=90

Also note the suggestion for keepalive and hold-time as the defaults are both 0 (infinity). There have been many problems with thouse 0 defaults.

I hope that helps..

-Yiannis
 
bejcd
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Oct 27, 2005 7:26 pm

redistribute OSPF to BGP ...

Mon Dec 19, 2005 7:29 am

Thank you for your help and suggestions.

I want to advertise only my /20 network not higher prefixes from OSPF.

My /20 is subnetted and locally advertised through OSPF so I want to "summarize" all those subnets (on my 'edge' OSPF/BGP router) and advertise them as a 'mynetwork/20' to my BGP peers (upstreams). The only problem is dependant on 'unused' subnets so it was the reason why I tried with Null-bridge just to simply prevent routing loops as well as advertising itself. On my router I have 2 network adapters with installed and enabled BGP (two peers) and 2 of them with configured OSPF (connected to my internal network) with subnets from my /20 network.

After testing I will inform you about results.

Again, thank you so much.
D.
 
bejcd
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Oct 27, 2005 7:26 pm

redistribute OSPF to BGP ...

Tue Dec 20, 2005 5:13 pm

Hi,

briefly, the above mentioned scenario seems to work fine though I had to reinstall the basic routing package instead of (routing-test experiences some bugs during a OSPF configuration). "redistribute-ospf" works also well !

But, something weird occurs every time when I open "ip route" in my Winbox - CPU load goes to 100% ... and MT also injects a little bit "uncontrollably" default gateways with "S" status - in my case about 10 0.0.0.0/0 routes have been installed ... I couldn't find a reason why it happens.

However, I'd like to thank you for your help so far.
D.
 
ysam
just joined
Posts: 22
Joined: Fri Sep 02, 2005 9:26 pm

Thu Dec 22, 2005 9:20 pm

:? I have no idea why this happens.. I have never even heard of such a bug before..
 
User avatar
[ASM]
Member Candidate
Member Candidate
Posts: 285
Joined: Sun Jun 06, 2004 12:59 am
Location: Sofia, Bulgaria
Contact:

Wed Feb 01, 2006 7:33 am

to make things work do this:
1) add an static route foer your /20 to some local router with distance=250
2) in
/routing filter
add prefix=xxx.xxx.xxx.xxx/20 prefix-lenght=21-32 action=drop chain=xxxxxxxxxxxx

3) this CPU peak is normal("routing-test is not well optimized"). disapears after 20-30 mins
The light is faster than sound. People always looks smart before they start talking.

Who is online

Users browsing this forum: msatter, Sinan and 170 guests