Description :
The route leak from bgp vpn4 table to specific vrf route table does not happen when physical interfaces(which are directly connected) are configured as neighbors but works when the loopback address configured in default vrf between cisco and vyos.
31.1.1.2/32 is defined as the loopback address in the cisco router which is seen in the vpnv4 table but not leaked to the defined vrf
VyOS:
set interfaces dummy dum0 address '11.11.11.1/32' set interfaces dummy dum0 vrf 'blue-vrf' set interfaces ethernet eth0 address 'dhcp' set interfaces ethernet eth0 hw-id '50:0b:00:07:00:00' set interfaces ethernet eth1 hw-id '50:0b:00:07:00:01' set interfaces ethernet eth1 vif 2818 address '20.20.21.130/30' set interfaces ethernet eth1 vif 2818 description 'B2Bconnection' set interfaces ethernet eth2 address '88.2.2.1/24' set interfaces ethernet eth2 hw-id '50:0b:00:07:00:02' set interfaces ethernet eth2 vrf 'internet' set interfaces ethernet eth3 hw-id '50:0b:00:07:00:03' set interfaces loopback lo set interfaces tunnel tun1 encapsulation 'gre' set interfaces tunnel tun1 ip adjust-mss '1336' set interfaces tunnel tun1 mtu '1376' set interfaces tunnel tun1 remote '10.1.1.6' set interfaces tunnel tun1 source-address '88.2.2.1' set interfaces tunnel tun1 vrf 'blue-vrf' set policy prefix-list OUT rule 10 action 'deny' set policy prefix-list OUT rule 10 prefix '11.11.11.1/32' set policy prefix-list OUT rule 20 action 'permit' set policy prefix-list OUT rule 20 le '32' set policy prefix-list OUT rule 20 prefix '0.0.0.0/0' set policy route-map MAPOUT rule 10 action 'permit' set policy route-map MAPOUT rule 10 match ip address prefix-list 'OUT' <<protocols mpls ldp + iBGP for l3vpn>> set protocols bgp neighbor 20.20.21.129 address-family ipv4-vpn nexthop-self set protocols bgp neighbor 20.20.21.129 remote-as '65241' set protocols bgp parameters log-neighbor-changes set protocols bgp system-as '65241' set protocols mpls interface 'eth1.2818' set protocols mpls ldp discovery transport-ipv4-address '20.20.21.130' set protocols mpls ldp interface 'eth1.2818' set protocols mpls ldp router-id '20.20.21.130' set protocols static route 10.1.1.0/24 next-hop 88.2.2.2 vrf 'internet' set protocols static route 172.16.100.10/32 interface tun1 vrf 'blue-vrf' <<vpn between vyos and hub >> set vpn ipsec authentication psk vyos_cisco_l id '[email protected]' set vpn ipsec authentication psk vyos_cisco_l id 'agg1.sdip.verizon.net' set vpn ipsec authentication psk vyos_cisco_l secret 'sdip-2000' set vpn ipsec esp-group e1 lifetime '3600' set vpn ipsec esp-group e1 mode 'tunnel' set vpn ipsec esp-group e1 pfs 'disable' set vpn ipsec esp-group e1 proposal 1 encryption 'aes128' set vpn ipsec esp-group e1 proposal 1 hash 'sha256' set vpn ipsec ike-group i1 close-action 'none' set vpn ipsec ike-group i1 key-exchange 'ikev2' set vpn ipsec ike-group i1 lifetime '28800' set vpn ipsec ike-group i1 proposal 1 dh-group '5' set vpn ipsec ike-group i1 proposal 1 encryption 'aes256' set vpn ipsec ike-group i1 proposal 1 hash 'sha256' set vpn ipsec interface 'eth2' set vpn ipsec log level '1' set vpn ipsec options disable-route-autoinstall set vpn ipsec options flexvpn set vpn ipsec options interface 'tun1' set vpn ipsec options virtual-ip set vpn ipsec site-to-site peer cisco_hub authentication local-id '[email protected]' set vpn ipsec site-to-site peer cisco_hub authentication mode 'pre-shared-secret' set vpn ipsec site-to-site peer cisco_hub authentication remote-id 'agg1.sdip.verizon.net' set vpn ipsec site-to-site peer cisco_hub connection-type 'initiate' set vpn ipsec site-to-site peer cisco_hub default-esp-group 'e1' set vpn ipsec site-to-site peer cisco_hub ike-group 'i1' set vpn ipsec site-to-site peer cisco_hub local-address '88.2.2.1' set vpn ipsec site-to-site peer cisco_hub remote-address '10.1.1.6' set vpn ipsec site-to-site peer cisco_hub tunnel 1 local prefix '88.2.2.1/32' set vpn ipsec site-to-site peer cisco_hub tunnel 1 protocol 'gre' set vpn ipsec site-to-site peer cisco_hub tunnel 1 remote prefix '10.1.1.6/32' set vpn ipsec site-to-site peer cisco_hub virtual-address '0.0.0.0' <<l3vpn vrf >> set vrf bind-to-all set vrf name blue-vrf protocols bgp address-family ipv4-unicast export vpn set vrf name blue-vrf protocols bgp address-family ipv4-unicast import vpn set vrf name blue-vrf protocols bgp address-family ipv4-unicast label vpn export 'auto' set vrf name blue-vrf protocols bgp address-family ipv4-unicast rd vpn export '11.11.11.1:1011' set vrf name blue-vrf protocols bgp address-family ipv4-unicast redistribute connected set vrf name blue-vrf protocols bgp address-family ipv4-unicast route-target vpn export '64512:4001' set vrf name blue-vrf protocols bgp address-family ipv4-unicast route-target vpn import '64512:4001' set vrf name blue-vrf protocols bgp neighbor 172.16.100.10 address-family ipv4-unicast route-map export 'MAPOUT' set vrf name blue-vrf protocols bgp neighbor 172.16.100.10 ebgp-multihop '3' set vrf name blue-vrf protocols bgp neighbor 172.16.100.10 local-as 65200 set vrf name blue-vrf protocols bgp neighbor 172.16.100.10 remote-as '65402' set vrf name blue-vrf protocols bgp neighbor 172.16.100.10 update-source '11.11.11.1' set vrf name blue-vrf protocols bgp system-as '65241' set vrf name blue-vrf protocols ospf interface tun1 area '0' set vrf name blue-vrf protocols ospf parameters router-id '11.11.11.1' set vrf name blue-vrf protocols ospf redistribute connected set vrf name blue-vrf protocols static route 172.16.100.10/32 interface tun1 set vrf name blue-vrf table '1002' set vrf name internet protocols static route 10.1.1.0/24 next-hop 88.2.2.2 set vrf name internet table '1000'
Output:
vyos@vyos:~$ sh ip route vrf blue-vrf Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure VRF blue-vrf: C>* 11.11.11.1/32 is directly connected, dum0, 00:12:34 C>* 172.16.1.0/24 is directly connected, eth3, 00:12:34 O 172.16.100.10/32 [110/2] via 172.16.100.10, tun1 onlink, weight 1, 00:11:5 S>* 172.16.100.10/32 [1/0] is directly connected, tun1, weight 1, 00:12:23 C>* 172.16.122.1/32 is directly connected, tun1, 00:12:11 B> 172.16.200.10/32 [20/0] via 172.16.100.10 (recursive), weight 1, 00:11:44 * via 172.16.100.10, tun1 onlink, weight 1, 00:11: B> 192.168.96.0/30 [20/0] via 172.16.100.10 (recursive), weight 1, 00:11:44 * via 172.16.100.10, tun1 onlink, weight 1, 00:11:4 B> 192.168.200.0/30 [20/0] via 172.16.100.10 (recursive), weight 1, 00:11:44 * via 172.16.100.10, tun1 onlink, weight 1, 00:11: vyos@vyos:~$ sh bgp ipv4 vpn BGP table version is 18, local router ID is 20.20.21.130, vrf id 0 Default local pref 100, local AS 65241 Status codes: s suppressed, d damped, h history, * valid, > best, = multipath i internal, r RIB-failure, S Stale, R Removed Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 64512:5 *>i31.1.1.2/32 20.20.21.129 0 100 0 ? UN=20.20.21.129 EC{64512:4001} label=17 type=bgp, subtype=0 *>i172.16.100.10/32 20.20.21.129 0 100 0 65200 65402 ? UN=20.20.21.129 EC{64512:4001} label=19 type=bgp, subtype=0 *>i172.16.122.2/32 20.20.21.129 0 100 0 ? UN=20.20.21.129 EC{64512:4001} label=18 type=bgp, subtype=0 *>i172.16.200.10/32 20.20.21.129 0 100 0 65200 65402 ? UN=20.20.21.129 EC{64512:4001} label=20 type=bgp, subtype=0 *>i192.168.96.0/30 20.20.21.129 0 100 0 65200 65402 ? UN=20.20.21.129 EC{64512:4001} label=21 type=bgp, subtype=0 *>i192.168.200.0/30 20.20.21.129 0 100 0 65200 65402 ? UN=20.20.21.129 EC{64512:4001} label=22 type=bgp, subtype=0 Route Distinguisher: 11.11.11.1:1011 *> 11.11.11.1/32 0.0.0.0@6< 0 32768 ? UN=0.0.0.0 EC{64512:4001} label=144 type=bgp, subtype=5 *> 172.16.1.0/24 0.0.0.0@6< 0 32768 ? UN=0.0.0.0 EC{64512:4001} label=144 type=bgp, subtype=5 172.16.100.10/32 172.16.100.10@6< 0 0 65200 65402 ? UN=172.16.100.10 EC{1222:1 64512:4001} label=144 type=bgp, subtype=5 *> 172.16.122.1/32 0.0.0.0@6< 0 32768 ? UN=0.0.0.0 EC{64512:4001} label=144 type=bgp, subtype=5 *> 172.16.200.10/32 172.16.100.10@6< 0 0 65200 65402 ? UN=172.16.100.10 EC{1222:1 64512:4001} label=144 type=bgp, subtype=5 *> 192.168.96.0/30 172.16.100.10@6< 0 0 65200 65402 ? UN=172.16.100.10 EC{1222:1 64512:4001} label=144 type=bgp, subtype=5 *> 192.168.200.0/30 172.16.100.10@6< 0 0 65200 65402 ? UN=172.16.100.10 EC{1222:1 64512:4001} label=144 type=bgp, subtype=5 Displayed 13 routes and 13 total paths vyos@vyos# run sh bgp ipv4 summary IPv4 VPN Summary (VRF default): BGP router identifier 20.20.21.130, local AS number 65241 vrf-id 0 BGP table version 0 RIB entries 3, using 576 bytes of memory Peers 1, using 725 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc 20.20.21.129 4 65241 108 99 0 0 0 01:14:55 6 5 N/A Total number of neighbors 1 [edit] vyos@vyos# run sh mpls table Inbound Label Type Nexthop Outbound Label --------------------------------------------------- 16 LDP 20.20.21.129 implicit-null 144 BGP blue-vrf
When the neighbor configured with loopback interfaces:
vyos@vyos:~$ sh ip route vrf blue-vrf Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure VRF blue-vrf: C>* 11.11.11.1/32 is directly connected, dum0, 22:12:30 B> 31.1.1.2/32 [200/0] via 31.1.1.10 (vrf default) (recursive), label 17, weight 1, 22:11:01 * via 20.20.21.129, eth1.2818 (vrf default), label implicit-null/17, weight 1, 22:11:01 C>* 172.16.1.0/24 is directly connected, eth3, 22:12:29 B 172.16.100.10/32 [200/0] via 31.1.1.10 (vrf default) (recursive), label 18, weight 1, 22:11:01 via 20.20.21.129, eth1.2818 (vrf default), label implicit-null/18, weight 1, 22:11:01 O 172.16.100.10/32 [110/2] via 172.16.100.10, tun1 onlink, weight 1, 22:11:48 S>* 172.16.100.10/32 [1/0] is directly connected, tun1, weight 1, 22:12:17 C>* 172.16.122.1/32 is directly connected, tun1, 22:12:04 B> 172.16.122.2/32 [200/0] via 31.1.1.10 (vrf default) (recursive), label 19, weight 1, 22:11:01 * via 20.20.21.129, eth1.2818 (vrf default), label implicit-null/19, weight 1, 22:11:01 B> 172.16.200.10/32 [20/0] via 172.16.100.10 (recursive), weight 1, 22:11:37 * via 172.16.100.10, tun1 onlink, weight 1, 22:11:37 B> 192.168.96.0/30 [20/0] via 172.16.100.10 (recursive), weight 1, 22:11:37 * via 172.16.100.10, tun1 onlink, weight 1, 22:11:37 B> 192.168.200.0/30 [20/0] via 172.16.100.10 (recursive), weight 1, 22:11:37 * via 172.16.100.10, tun1 onlink, weight 1, 22:11:37
Cisco Output:
CiscoR1#sh ip route vrf lan-vrf . . Gateway of last resort is not set 31.0.0.0/32 is subnetted, 1 subnets C 31.1.1.2 is directly connected, Loopback0 172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks B 172.16.1.0/24 [200/0] via 20.20.21.130, 00:07:12 S 172.16.100.10/32 is directly connected, Tunnel0 B 172.16.122.1/32 [200/0] via 20.20.21.130, 00:07:12 C 172.16.122.2/32 is directly connected, Tunnel0 B 172.16.200.10/32 [20/0] via 172.16.100.10, 00:51:55 192.168.96.0/30 is subnetted, 1 subnets B 192.168.96.0 [20/0] via 172.16.100.10, 00:51:55 192.168.200.0/30 is subnetted, 1 subnets B 192.168.200.0 [20/0] via 172.16.100.10, 00:51:55
Topology(configuration shared between VyOS and CiscoR1):