BGP-VPN between main and vrf

Hi!
Is it possible to create route leaking between vrf “main” and other vrf, using bgp-vpn?

I have the same question.
I got it between new VRFs, but not with VRF-main.

yes Ofcourse

https://help.mikrotik.com/docs/pages/viewpage.action?pageId=328206

Your link has example between vrfs only (no between “main” and vrf)

Just changing 1 vrf to main at example no works

Currently not possible

Hello,
I am trying to route leak before main and vrf router CHR OSv7.8.

Basically what i am trying to do is that we have vrf 1 spanning between multiple locations with different subnet via ibgp vpn. I am able to communicate between intern vrf on all sites. what I am trying to achieve here is I am going to have rechability to internet from vrf1 on router1 which i was able to achieve following documentation on https://help.mikrotik.com/docs/pages/viewpage.action?pageId=328206 . But I don’t know if this is possible for devices on all sites on vrf1 have the rechability to internet via public ip on router1. If possible please let me know or direct me to a documentation that clearly explains how to do it please.

Bellow is the config where i was able to have rechability to internet via vrf1.



# jun/12/2024 19:21:44 by RouterOS 7.8
# software id = 
#
/interface bridge
add name=lo0
/interface ethernet
set [ find default-name=ether1 ] disable-running-check=no
set [ find default-name=ether2 ] disable-running-check=no
set [ find default-name=ether3 ] disable-running-check=no
set [ find default-name=ether4 ] disable-running-check=no
set [ find default-name=ether5 ] disable-running-check=no
set [ find default-name=ether6 ] disable-running-check=no
set [ find default-name=ether7 ] disable-running-check=no
set [ find default-name=ether8 ] disable-running-check=no
set [ find default-name=ether9 ] disable-running-check=no
set [ find default-name=ether10 ] disable-running-check=no
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip vrf
add interfaces=ether2 name=cust_a
add interfaces=ether3 name=cust_b
/port
set 0 name=serial0
/routing id
add disabled=no id=10.10.10.1 name=id-1 select-dynamic-id=""
/routing ospf instance
add disabled=no name=ospf-instance-1 router-id=id-1
/routing ospf area
add disabled=no instance=ospf-instance-1 name=backbone
/routing bgp template
set default address-families=ip,vpnv4 as=65000 disabled=no router-id=10.10.10.1 routing-table=main
/ip address
add address=192.168.1.1/24 interface=ether2 network=192.168.1.0
add address=192.168.2.1/24 interface=ether3 network=192.168.2.0
add address=10.10.10.1 interface=lo0 network=10.10.10.1
add address=20.20.20.1/30 interface=ether10 network=20.20.20.0
/ip dhcp-client
add interface=ether1
/ip firewall mangle
add action=mark-connection chain=prerouting connection-state=new new-connection-mark=cust_a_conn passthrough=no src-address=192.168.1.0/24
add action=mark-connection chain=prerouting connection-state=new new-connection-mark=cust_b_conn passthrough=no src-address=192.168.2.0/24
add action=mark-routing chain=prerouting connection-mark=cust_a_conn in-interface=ether1 new-routing-mark=cust_a
add action=mark-routing chain=prerouting connection-mark=cust_b_conn in-interface=ether1 new-routing-mark=cust_b
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1 to-addresses=10.1.3.197
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.3.1 pref-src="" routing-table=cust_a scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.3.1 pref-src="" routing-table=cust_b scope=30 suppress-hw-offload=no target-scope=10
/mpls ldp
add disabled=no lsr-id=10.10.10.1 transport-addresses=10.10.10.1
/mpls ldp interface
add interface=ether10
/routing bgp connection
add address-families=ip,vpnv4 as=65000 disabled=no local.address=10.10.10.1 .role=ibgp name=bgp-vrf-test2 remote.address=10.10.10.2/32 .as=65000 router-id=10.10.10.1 routing-table=main templates=default
/routing bgp vpn
add disabled=no export-route-targets=1.1.1.1:111 import-route-targets=1.1.1.1:111 label-allocation-policy=per-vrf redistribute=connected,static route-distinguisher=1.1.1.1:111 vrf=cust_a
add disabled=no export-route-targets=2.2.2.2:222 import-route-targets=2.2.2.2:222 label-allocation-policy=per-vrf redistribute=connected,static route-distinguisher=2.2.2.2:222 vrf=cust_b
/routing ospf interface-template
add area=backbone disabled=no interfaces=ether10 type=ptp
add area=backbone disabled=no interfaces=lo0 passive
add area=backbone disabled=yes interfaces=ether2,ether3
add area=backbone disabled=no interfaces=ether1
/system identity
set name=Tik-VRF-test
/tool romon
set enabled=yes
[admin@Tik-VRF-test] > 
[admin@Tik-VRF-test] > ip add print 
Flags: D - DYNAMIC
Columns: ADDRESS, NETWORK, INTERFACE
#   ADDRESS         NETWORK      INTERFACE
0 D 10.1.3.197/24   10.1.3.0     ether1   
1   192.168.1.1/24  192.168.1.0  ether2   
2   192.168.2.1/24  192.168.2.0  ether3   
3   10.10.10.1/32   10.10.10.1   lo0      
4   20.20.20.1/30   20.20.20.0   ether10