Create BGP peers inside VRF

Dear Mikrotik users.

On Huawei router we can define a BGP peers inside vpn-instances (or vrf):

__ip vpn-instance HOMOLOGACIONES
description HOMOLOGACION_L3VPN
ipv4-family
route-distinguisher 64512:1605
vpn-target 64512:1605 export-extcommunity
vpn-target 64512:1605 import-extcommunity

bgp 64512
ipv4-family vpn-instance HOMOLOGACIONES
import-route direct
import-route static
peer 192.168.254.170 as-number 65512
#__

The question is, what is the equivalent commands on Mikrotik? RouterOS 6.44 and CCR1009-7G-1C-1S+.

Thanks for your attention and help.

Best regards.

https://wiki.mikrotik.com/wiki/Manual:EBGP_as_PE-CE_routing_protocol

Thanks MRZ, Iconfigured the following on Mikrotik:

/routing bgp peer
add address-families=ip,ipv6,l2vpn,vpnv4 name=HOMOLOGACIONES remote-address=192.168.254.169 ttl=default update-source=SESION_BGP

/ip route vrf
add export-route-targets=64512:1605 import-route-targets=64512:1605 interfaces=ether7 route-distinguisher=64512:1605 routing-mark=HOMOLOGACIONES

/routing bgp instance
set default as=64512 client-to-client-reflection=no redistribute-connected=yes router-id=192.168.254.170 routing-table=HOMOLOGACIONES

But Huawei and Mikrotik see BGP session as “idle”, but when remove routing-table, BGP is stablished normally.

/routing bgp instance
set default as=64512 client-to-client-reflection=no redistribute-connected=yes router-id=192.168.254.170

Thanks for your attention and help.

Best regards.

Dear Mikrotik users.

Finally VRF's peer are in stablished state, this is the configuration:

_/ip address
add address=192.168.254.170/30 interface=SESION_BGP network=192.168.254.168

/ip route vrf
add export-route-targets=64512:1605 import-route-targets=64512:1605 interfaces=ether7,SESION_BGP route-distinguisher=64512:1605 routing-mark=HOMOLOGACIONES

/routing bgp peer
add address-families=ip,ipv6,l2vpn,vpnv4 name=HOMOLOGACIONES remote-address=192.168.254.169 ttl=default update-source=SESION_BGP

/routing bgp instance
set default as=64512 client-to-client-reflection=no redistribute-connected=yes router-id=192.168.254.170 routing-table=HOMOLOGACIONES_

STATUS ON MIKROTIK

_/routing bgp peer> print
Flags: X - disabled, E - established

INSTANCE REMOTE-ADDRESS REMOTE-AS

0 E default 192.168.254.169 64512

/ip route print
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 19.16.19.0/24 19.16.19.2 ether7 0
1 ADb 19.82.19.80/30 192.168.254.169 200
2 ADb 40.40.40.0/24 192.168.254.169 200_

STATUS ON HUAWEI

_display bgp vpnv4 vpn-instance HOMOLOGACIONES peer

BGP local router ID : X.X.X.X
Local AS number : 64512

VPN-Instance HOMOLOGACIONES, Router ID X.X.X.X.:
Total number of peers : 1 Peers in established state : 1

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

192.168.254.170 4 64512 16 17 0 00:11:32 Established 2

display ip routing-table vpn-instance HOMOLOGACIONES
Route Flags: R - relay, D - download to fib

Routing Tables: HOMOLOGACIONES
Destinations : 9 Routes : 9

Destination/Mask Proto Pre Cost Flags NextHop Interface

19.16.19.0/24 IBGP 255 0 RD 192.168.254.170 GigabitEthernet7_
Please close this thread.

Thanks for your attention and help.

Best regards.