Community discussions

MikroTik App
 
User avatar
JanZorz
newbie
Topic Author
Posts: 37
Joined: Fri Jan 07, 2011 1:42 pm

BGP config to announce all prefxes to downstream...

Fri Nov 18, 2022 5:49 pm

Hey,

I'm testing ROS7 (7.7beta6) and I'm trying to announce all routes in main routing table to downstream BGP router, IPv6 and IPv4. I got full routing tables from my upstreams and now I try to re-distribute them.

I understand that now I need to add networks in /ip/firewall/address-list and /ipv6/firewall/address-list, I named it bgp-networks - but what is the syntax for "all routes in the routing table" ? 0.0.0.0/0 is "default route" and matches just that one afaik. ::/0 also...

Any hints?

Cheers, Jan
 
connectlife
Frequent Visitor
Frequent Visitor
Posts: 99
Joined: Tue Sep 01, 2020 10:20 pm

Re: BGP config to announce all prefxes to downstream...

Sat Nov 19, 2022 9:11 am

Hi you have to create an accept filter and associate it in the bgp peer as output bgp filter. in this you will redistribute all the table of your router

by default bgp rejects everything..
 
User avatar
AshuGite
just joined
Posts: 13
Joined: Sat Jul 09, 2016 8:31 pm
Location: India
Contact:

Re: BGP config to announce all prefxes to downstream...

Mon Nov 21, 2022 4:06 am

address list announcements are required from down towards upstream to accept all routes on downstream just use accept; in in-filter on downstream and out-filter on upstream...
 
User avatar
JanZorz
newbie
Topic Author
Posts: 37
Joined: Fri Jan 07, 2011 1:42 pm

Re: BGP config to announce all prefxes to downstream...

Mon Nov 21, 2022 7:20 pm

Hi you have to create an accept filter and associate it in the bgp peer as output bgp filter. in this you will redistribute all the table of your router

by default bgp rejects everything..
Hi... I have this as output filter:
chain=bgp_out_advertise rule="accept"

And I get just one route advertised downstream - the local loopback and nothing else despite the fact that I have 326.878 routes in RIB.
[jan@MK-TEST-lju] > /ipv6 route/print count-only
326878

I created bgp-networks address list and associated it with this BGP session with several IP networks in it for test:
[jan@MK-TEST-lju] > /ipv6 firewall/address-list/print where list=bgp-networks
Columns: LIST, ADDRESS
# LIST ADDRESS
31 bgp-networks 2607:fae0:b000::/36
32 bgp-networks 2607:fae0:a000::/36
33 bgp-networks ::/0
34 bgp-networks 2001:218::/32
35 bgp-networks 2001:200:c000::/35

...but none of them gets announced. This is proving quite difficult. My 14 years of experience with routing with Mikrotik is not helping me much in ROS 7 ;)

Cheers, Jan
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP config to announce all prefxes to downstream...

Tue Nov 22, 2022 9:42 am

1. For BGP to redistribute received routes from upstream, both peers must be running the same instance.
2. For "BGP networks" to be advertised there must be corresponding IGP route in the routing table.
 
User avatar
JanZorz
newbie
Topic Author
Posts: 37
Joined: Fri Jan 07, 2011 1:42 pm

Re: BGP config to announce all prefxes to downstream...

Tue Nov 22, 2022 6:27 pm

1. For BGP to redistribute received routes from upstream, both peers must be running the same instance.
Thnx! So I need to play with input.affinity and output.affinity? Currently it's "alone". Should I try putting all in "main"?

Cheers, Jan Z
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP config to announce all prefxes to downstream...

Tue Nov 22, 2022 8:31 pm

No it is not related to affinity.
You need to make sure that local as and local router-id are identical on all the bgp sessions.
 
User avatar
JanZorz
newbie
Topic Author
Posts: 37
Joined: Fri Jan 07, 2011 1:42 pm

Re: BGP config to announce all prefxes to downstream...

Wed Nov 23, 2022 3:54 pm

No it is not related to affinity.
You need to make sure that local as and local router-id are identical on all the bgp sessions.
Hmm... same AS and same router-id on all BGP sessions - but still no advertisement of prefixes in main routing table.

Weird.

6.x BGP worked like charm, I have no idea why you had to change things :)

Cheers, Jan
 
User avatar
JanZorz
newbie
Topic Author
Posts: 37
Joined: Fri Jan 07, 2011 1:42 pm

Re: BGP config to announce all prefxes to downstream...

Wed Nov 23, 2022 5:07 pm

No it is not related to affinity.
You need to make sure that local as and local router-id are identical on all the bgp sessions.
If I set output.redistribute=connected,static,bgp then I receive exactly 2 routes to the downstream router... local loopback and one /64 IPv6 prefix that is on the router and is used to connect to the outer world.

I still have gazzilions of routes in the main routing table :)

Cheers, Jan
 
jd603
newbie
Posts: 48
Joined: Tue Dec 23, 2014 4:41 am

Re: BGP config to announce all prefxes to downstream...

Sun Nov 27, 2022 10:31 pm

Having the same issue... opened a new post but should have just bumped this one
 
jd603
newbie
Posts: 48
Joined: Tue Dec 23, 2014 4:41 am

Re: BGP config to announce all prefxes to downstream...

Sun Nov 27, 2022 11:03 pm

1. For BGP to redistribute received routes from upstream, both peers must be running the same instance.
2. For "BGP networks" to be advertised there must be corresponding IGP route in the routing table.

1. what does this mean, they are both in the same routing-table "main", both use the same router-id

2. bgp-networks advertisement is only for advertising to eBGP peers, correct?
 
User avatar
JanZorz
newbie
Topic Author
Posts: 37
Joined: Fri Jan 07, 2011 1:42 pm

Re: BGP config to announce all prefxes to downstream...

Tue Nov 29, 2022 9:34 pm

1. what does this mean, they are both in the same routing-table "main", both use the same router-id
2. bgp-networks advertisement is only for advertising to eBGP peers, correct?
1. yes, they are in the main routing table and all BGP sessions have the same router-id
2. well, I tried all combinations (with, without), none of them worked :)

Cheers, Jan
 
User avatar
JanZorz
newbie
Topic Author
Posts: 37
Joined: Fri Jan 07, 2011 1:42 pm

Re: BGP config to announce all prefxes to downstream...

Tue Nov 29, 2022 9:59 pm

ok, I upgraded to RouterOS v7.7beta8 and set the local.role=ibgp-rr and all of a sudden - routes are advertising to my downstreams :)

Done.
 
jd603
newbie
Posts: 48
Joined: Tue Dec 23, 2014 4:41 am

Re: BGP config to announce all prefxes to downstream...

Thu Dec 01, 2022 4:25 pm

I tried that awhile ago, it caused duplicate routes previously. Also, iBGP is supposed to be full mesh by default, configuring as route reflector usually implies something different so i'm a little confused here and not sure this is correct behavior.

UPDATE: I tried my IPv6 feeds with ibgp-rr and it so far seems to be doing what I wanted now and no broken gateway/dupe routes like in 7.1... I will try IPv4 next and report back if there is a problem.

UPDATE2: IPv4 had different behavior and now the v6 router routes have the same gateway (gw is on v6 router). So even though it learned routes from v7, those routes had the wrong nexthop/gateway then what I would normally see when setting up ibgp. Perhaps I can force change the gateway with nexthop-self or using a filter. I will give that a try and report back

OH AND ... the flap bug is back, the v7 router starting flapping my eBGP routes after switching to ibgp-rr for my IPv4 iBGP peer. This got me into trouble last time and is quite nasty

I am using a loopback address on each router to peer with on IPv4 and not IPv6 so maybe that has something to do with it. I will try using physical interface addresses, if that doesn't change anything I will try forcing next hop for routes learned on the v6 router.
 
User avatar
JanZorz
newbie
Topic Author
Posts: 37
Joined: Fri Jan 07, 2011 1:42 pm

Re: BGP config to announce all prefxes to downstream...

Thu Dec 01, 2022 6:24 pm

OH AND ... the flap bug is back, the v7 router starting flapping my eBGP routes after switching to ibgp-rr for my IPv4 iBGP peer. This got me into trouble last time and is quite nasty
yes, I noticed that. I'm using IPv6 address as BGP session endpoints and announce v4 and v6 over it. If I do just IPv6 then the session is stable. If I enable IPv4 then it comes close to 1M routes and closes the session and starts over. It's annoying as hell.

Cheers, Jan
 
jd603
newbie
Posts: 48
Joined: Tue Dec 23, 2014 4:41 am

Re: BGP config to announce all prefxes to downstream...

Thu Dec 01, 2022 8:34 pm

Ahh too bad. Is your other router a mikrotik v7 or v6?
 
User avatar
JanZorz
newbie
Topic Author
Posts: 37
Joined: Fri Jan 07, 2011 1:42 pm

Re: BGP config to announce all prefxes to downstream...

Thu Dec 01, 2022 8:42 pm

Ahh too bad. Is your other router a mikrotik v7 or v6?
FRR

Cheers, Jan
 
jd603
newbie
Posts: 48
Joined: Tue Dec 23, 2014 4:41 am

Re: BGP config to announce all prefxes to downstream...

Tue Dec 06, 2022 4:26 am

Just an update... nothing worked,,, back to waiting for acknowledgement of a problem and fix or someone showing me a config that actually works for this

Who is online

Users browsing this forum: hjf and 14 guests