Community discussions

MikroTik App
 
dancsa
just joined
Topic Author
Posts: 6
Joined: Mon Jul 10, 2017 9:46 pm

BGP network syncronize bug?

Fri Nov 17, 2017 6:19 pm

Hi,

I discovered a possible bug in ROS 6.40.5.

I had to create redundant connection with our ISP, i was advised that we get a public /28 subnet, and we should advertise it on our two router. The main router is a CCR1009, on recent-ish RC ROS, uplink comes in ethernet/sfp como port, i named it ether0, our /28 subnet is bridge-vlan interface (like /int bridge add name=br1 vlan-filtering=yes, /interface bridge vlan add vlan-id=303 tagged=br1,ether2... /interface vlan add interface=br1 name=vlan303 vlan-id=303; /ip addr add interface=vlan303 address=A.B.C.D/28)
Set the peers, AS number, and added this network to /route bgp network (not touching the default syncronize)

It worked fine, ISP got our advertisement.
Then the backup router got us. BGP is configured the same as the main with the obvious differences like router-id; but for testing the backup link i just created a loopback address like /int bridge add name=loopback1; /ip addr add interface=loopback1 address=A.B.C.D+1/28)

ISP didn't get our advertisement, which i confirmed by dumping the BGP communication.

If i know well, the syncronize flag in /route bgp network filters our that networks, where there is no route to in the routing table. In both case, the routing table has the A.B.C.D/28 with DAC flags (Dynamic, Active, Connected) with distance=0, only the interface was different, loopback1 vs vlan303. After setting syncronize=no on that network, the ISP got the advertisement and the router became available.

My MTCINE is next week, so i'm not entirely sure about this, but seems like a bug to me.
 
Vooray
Frequent Visitor
Frequent Visitor
Posts: 73
Joined: Mon Feb 23, 2015 3:34 pm

Re: BGP network syncronize bug?

Sat Nov 18, 2017 9:56 pm

Hey!

Just tryed to reproduce, but it seems to work as intended.

My x86 ROS:
[admin@MikroTik] /routing bgp peer> /export terse
# nov/18/2017 19:52:38 by RouterOS 6.40.5
/routing bgp instance set default as=100 router-id=10.0.0.1
/ip address add address=10.0.0.1/30 interface=ether1 network=10.0.0.0
/ip address add address=20.0.0.1/24 interface=lo10 network=20.0.0.0
/routing bgp network add network=20.0.0.0/24
/routing bgp peer add name=AS200 remote-address=10.0.0.2 remote-as=200
[admin@MikroTik] /routing bgp network> print detail
Flags: X - disabled
 0   network=20.0.0.0/24 synchronize=yes
[admin@MikroTik] /routing bgp network> /routing bgp advertisements print
PEER     PREFIX               NEXTHOP          AS-PATH                                                                                                                        ORIGIN     LOCAL-PREF
AS200    20.0.0.0/24          10.0.0.1                                                                                                                                        igp
My IOS:
Router#show ip bgp neighbors 10.0.0.1 received-routes | i 20
 *>  20.0.0.0/24      10.0.0.1                               0 100 i
Last edited by Vooray on Sun Nov 19, 2017 3:54 pm, edited 1 time in total.
 
dancsa
just joined
Topic Author
Posts: 6
Joined: Mon Jul 10, 2017 9:46 pm

Re: BGP network syncronize bug?

Sun Nov 19, 2017 2:14 pm

I forgot one major detail. The BGP instance was set with routing-table=bgptest so the routes i got from the ISP won't mess up the main routing table until i verify everything is ok, and set up policy routes. Of course the loopback inteface reachability was in the main table
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADC A.B.C.D/28 A.B.C.D+1 loopbacktest1 0

The debugging wasn't helped by that ip route print doesn't print out the routing mark by default, so i didn't think about this.

Should i add static route for that subnet with the loopback interface as the gateway? Doesn't sound like a Good Idea
 
Vooray
Frequent Visitor
Frequent Visitor
Posts: 73
Joined: Mon Feb 23, 2015 3:34 pm

Re: BGP network syncronize bug?

Sun Nov 19, 2017 3:49 pm

Still looks to be working:

ROS (Check VRF Interfaces):
/interface bridge
add name=lo10
/routing bgp instance
set default as=100 router-id=20.0.0.1 routing-table=bgptest
/ip address
add address=10.0.0.1/30 interface=ether1 network=10.0.0.0
add address=20.0.0.1/24 interface=lo10 network=20.0.0.0
/ip route vrf
add interfaces=ether1,lo10 routing-mark=bgptest
/routing bgp network
add network=20.0.0.0/24
/routing bgp peer
add name=peer1 remote-address=10.0.0.2 remote-as=200
[admin@MikroTik] /routing bgp network> print detail
Flags: X - disabled
 0   network=20.0.0.0/24 synchronize=yes
IOS:
Router#show ip bgp neighbors 10.0.0.1 received-routes | i 20
 *>  20.0.0.0/24      10.0.0.1                               0 100 i
BTW. It is good idea to always use filters on eBGP prefixes, so there is no need to create separate vrf for them. It creates redundant complexity.

Who is online

Users browsing this forum: loloski and 40 guests