Community discussions

MikroTik App
 
Popdog
just joined
Topic Author
Posts: 7
Joined: Fri Oct 09, 2020 10:43 pm

BGP - received routes not installed in correct VRF

Tue Dec 14, 2021 4:16 pm

Hello!

I'm trying to set up BGP on a CRS354-48G-4S+2Q+RM in a VRF.

The BGP connection to the two peers works, prefixes are sent and received.

The problem: the received routes are not installed in the correct VRF.
/ping 10.253.255.0 vrf=devices
  SEQ HOST                                     SIZE TTL TIME       STATUS
    0                                                              no route to host
    1                                                              no route to host
    2                                                              no route to host
    sent=3 received=0 packet-loss=100%



The target is in the routing table:
/routing/route/print
Flags: U, A - ACTIVE; c, b, y - COPY; H - HW-OFFLOADED; +, B - BLACKHOLE
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE, IMMEDIATE-GW
     DST-ADDRESS             GATEWAY               AFI   DISTANCE  SCOPE  TARGET-SCOPE  IMMEDIATE-GW
Ac + 10.253.5.0/24           vlan-devices@devices  ip4          0     10                vlan-devices
Ac + 10.253.5.0/24           vlan-devices@devices  ip4          0     10                vlan-devices
UbH  10.253.253.46/31        10.253.254.46         ip4         20     40            10
UbH  10.253.253.46/31        10.253.253.46         ip4         20     40            10
Ac   10.253.253.46/31        uplink1.15@devices    ip4          0     10                uplink1.15
UbH  10.253.254.46/31        10.253.253.46         ip4         20     40            10
UbH  10.253.254.46/31        10.253.254.46         ip4         20     40            10
Ac   10.253.254.46/31        uplink2.15@devices    ip4          0     10                uplink2.15
UbH  10.253.255.0/31         10.253.253.46         ip4         20     40            10
UbH  10.253.255.0/31         10.253.254.46         ip4         20     40            10
UcH  fe80::%ether49/64       ether49               ip6          0     10
Ac   fe80::%uplink1/64       uplink1               ip6          0     10                uplink1
Ac   fe80::%uplink2/64       uplink2               ip6          0     10                uplink2
Ac   fe80::%bridge/64        bridge                ip6          0     10                bridge
Ac   fe80::%uplink1.15/64    uplink1.15@devices    ip6          0     10                uplink1.15
Ac   fe80::%uplink2.15/64    uplink2.15@devices    ip6          0     10                uplink2.15
Ac   fe80::%vlan-devices/64  vlan-devices@devices  ip6          0     10                vlan-devices
A H  uplink1                                       link         0
A H  uplink2                                       link         0
A H  bridge                                        link         0
A H  uplink1.15                                    link         0
A H  uplink2.15                                    link         0
A H  vlan-devices                                  link         0

This is my config:
/interface ethernet
set [ find default-name=sfp-sfpplus1 ] l2mtu=9022 mtu=9000 name=uplink1
set [ find default-name=sfp-sfpplus2 ] l2mtu=9022 mtu=9000 name=uplink2
/interface vlan
add interface=bridge name=vlan-devices vlan-id=100
add interface=uplink1 name=uplink1.15 vlan-id=15
add interface=uplink2 name=uplink2.15 vlan-id=15
/ip vrf
add interfaces=uplink1.15,uplink2.15,vlan-devices name=devices
/routing bgp template
add as=4242005901 disabled=no name=devices output.network=bgp-devices router-id=10.253.5.253 routing-table=devices vrf=devices
/ip address
add address=10.253.253.47/31 interface=uplink1.15 network=10.253.253.46
add address=10.253.254.47/31 interface=uplink2.15 network=10.253.254.46
add address=10.253.5.253/24 interface=vlan-devices network=10.253.5.0
add address=10.253.5.1/24 interface=vlan-devices network=10.253.5.0
/ip firewall address-list
add address=10.253.5.0/24 list=bgp-devices
/routing bgp connection
add disabled=no local.role=ebgp name=1-rtr-mgmt-core-cit remote.address=10.253.253.46 .as=4242000901 templates=devices
add disabled=no local.role=ebgp name=2-rtr-mgmt-core-cit remote.address=10.253.254.46 .as=4242000902 templates=devices
Where's the error in my config?
 
User avatar
jprietove
Trainer
Trainer
Posts: 212
Joined: Fri Jun 03, 2016 3:00 pm
Location: Cádiz, Spain
Contact:

Re: BGP - received routes not installed in correct VRF

Tue Dec 14, 2021 4:40 pm

I would try with /30 instead of /31
 
Popdog
just joined
Topic Author
Posts: 7
Joined: Fri Oct 09, 2020 10:43 pm

Re: BGP - received routes not installed in correct VRF

Tue Dec 14, 2021 7:39 pm

I would try with /30 instead of /31
This doesn't make any difference.

I tried to add a static route for testing, but it didn't work:


/ip/route/add dst-address=10.253.255.0/30 routing-table=devices  gateway=10.253.253.46
/ping address=10.253.255.1 vrf=devices
  SEQ HOST                                     SIZE TTL TIME       STATUS
    0                                                              no route to host
    1                                                              no route to host
    2                                                              no route to host
    3                                                              no route to host
    sent=4 received=0 packet-loss=100%
But, when using "vlan-interface" instead of "routing-table" it works:
/ip/route/add dst-address=10.253.255.0/30 vrf-interface=vlan-devices gateway=10.253.253.46
/ping address=10.253.255.1 vrf=devices
  SEQ HOST                                     SIZE TTL TIME       STATUS
    0 10.253.255.1                               56  64 457us
    1 10.253.255.1                               56  64 418us
    2 10.253.255.1                               56  64 447us
    3 10.253.255.1                               56  64 450us
    sent=4 received=4 packet-loss=0% min-rtt=418us avg-rtt=443us max-rtt=457us
    
I can't find a reference to "vlan-interface" in the docs. There seem to be some changes from V6 to V7.
That doesn't fix the BGP problem, but makes me think there is just a little bit wrong in my configuration.
 
Popdog
just joined
Topic Author
Posts: 7
Joined: Fri Oct 09, 2020 10:43 pm

Re: BGP - received routes not installed in correct VRF

Tue Dec 14, 2021 9:49 pm

The nexthop installed by BGP seems to be in the wrong VRF.

It is missing a @VRF suffix.

Who is online

Users browsing this forum: No registered users and 19 guests