Community discussions

MikroTik App
 
User avatar
MWComms
just joined
Topic Author
Posts: 14
Joined: Thu Nov 30, 2017 1:35 am
Location: Australia

Exported routes going to 'Main' Table

Thu Jul 27, 2023 9:15 am

Ahoy there,

I have set up MPLS (OSPF, LDP, BGP) to operate within a designated 'mpls' VRF.
This is very largely functional. OSPF, LDP and BGP form adjacencies.

However, routes exported from vpns (e.g. connected, static), as defined in '/routing/bgp/vpn' are automatically installed within the main route table as vpn4 routes (the type is correct), rather than the designated 'mpls' vrf.
There doesn't appear to be a facility to define which table the routes are exported to as vpn4.

Routes learned from external peers will follow whatever is defined in the BGP connection configuration.

Configuration Below;

/routing ospf instance
add disabled=no in-filter-chain=mpls-o-in name=mpls out-filter-chain=mpls-o-out redistribute=connected,static router-id=mpls vrf=mpls

/routing ospf area
add area-id=172.18.20.0 disabled=no instance=mpls name=mpls

/routing ospf interface-template
add area=mpls disabled=no interfaces=ether1-vlan:1111 type=ptp

/mpls interface
add disabled=no input=yes interface=ether1-vlan:1111 mpls-mtu=1580
add disabled=no input=yes interface=ether12 mpls-mtu=1580

/mpls ldp
add disabled=no lsr-id=172.18.20.37 transport-addresses=172.18.20.37 vrf=mpls

/mpls ldp accept-filter
add accept=yes disabled=no prefix=172.18.20.0/24 vrf=mpls
add accept=yes disabled=no prefix=172.18.30.0/24 vrf=mpls
add accept=yes disabled=no prefix=172.18.40.0/24 vrf=mpls
add accept=yes disabled=no prefix=172.18.50.0/24 vrf=mpls
add accept=yes disabled=no prefix=172.18.60.0/24 vrf=mpls
add accept=no disabled=no

/mpls ldp interface
add disabled=no interface=ether1-vlan:1111
add accept-dynamic-neighbors=yes afi=ip disabled=no hello-interval=10s hold-time=1m interface=ether12 transport-addresses=172.18.20.37

/routing bgp connection
add address-families=vpnv4 as=1111 cisco-vpls-nlri-len-fmt=auto-bits connect=yes disabled=no listen=yes local.address=172.18.20.37 .role=\
ibgp-rr-client name=mw output.network=bgp-networks .redistribute=bgp-mpls-vpn remote.address=172.18.20.35/32 .as=1111 .port=179 router-id=\
172.18.20.37 routing-table=mpls vrf=mpls

/routing bgp vpn
add disabled=no export.redistribute=connected,static .route-targets=9627:100 import.route-targets=\
93:62120,99:61201,95:61232,95:61401,96:61232,93:61201,9627:200,9627:400 label-allocation-policy=per-vrf name=bgp-mpls-vpn-2 \
route-distinguisher=9627:100 vrf=data

Example of a route locally exported (installed to 'not desired' table)

Flags: X - disabled, F - filtered, U - unreachable, A - active;
c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, a - ldp-address, l - ldp-mapping, g - slaac, y - bgp-mpls-vpn;
H - hw-offloaded; + - ecmp, B - blackhole
Ac afi=ip4 contribution=active dst-address=172.24.251.0/24 routing-table=data gateway=ether3-vlan:110-dev@data
immediate-gw=ether3-vlan:110-dev distance=0 scope=10 belongs-to="connected" local-address=172.24.251.254%ether3-vlan:110-dev@data
debug.fwp-ptr=0x20302660

Ay afi=vpn4 contribution=active dst-address=172.24.251.0/24&9627:100 routing-table=main label=16 gateway=ether3-vlan:110-dev@data
immediate-gw=ether3-vlan:110-dev distance=200 scope=40 target-scope=10 belongs-to="bgp-mpls-vpn-2-connected-export"
bgp.ext-communities=rt:9627:100 .atomic-aggregate=no .origin=incomplete
debug.fwp-ptr=0x20302D20

Example of a route learned via BGP (installed to correct table)

Flags: X - disabled, F - filtered, U - unreachable, A - active; c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, a - ldp-address, l - ldp-mapping, g - slaac, y - bgp-mpls-vpn; H - hw-offloaded;
+ - ecmp, B - blackhole
Ab afi=vpn4 contribution=active dst-address=192.168.25.0/24&95:61232 routing-table=mpls label=22 gateway=172.18.20.35@mpls immediate-gw=172.18.23.109%ether1-vlan:1111 distance=200 scope=40 target-scope=30 belongs-to="bgp-VPN4-172.18.20.35@*5"
bgp.peer-cache-id=*2800005 .ext-communities=rt:95:61232 .local-pref=100 .atomic-aggregate=yes .origin=incomplete
debug.fwp-ptr=0x203022A0

Who is online

Users browsing this forum: No registered users and 7 guests