+ LOG.debug("Writing FibEntry to DS: vpnRd={}, prefix={}, label={}, nexthop={} (interVpnLink)",
+ vpnRd, destination, label, nexthop);
+ fibManager.addOrUpdateFibEntry(dataBroker, vpnRd, null /*macAddress*/, destination,
+ Collections.singletonList(nexthop), VrfEntry.EncapType.Mplsgre, label,
+ 0 /*l3vni*/, null /*gatewayMacAddress*/, null /*parentVpnRd*/, RouteOrigin.STATIC, null /*writeTxn*/);
+
+ // Now advertise to BGP. The nexthop that must be advertised to BGP are the IPs of the DPN where the
+ // VPN's endpoint have been instantiated
+ // List<String> nexthopList = new ArrayList<>(); // The nexthops to be advertised to BGP
+ List<BigInteger> endpointDpns = interVpnLink.getEndpointDpnsByVpnName(vpnName);
+ List<String> nexthopList =
+ endpointDpns.stream().map(dpnId -> InterfaceUtils.getEndpointIpAddressForDPN(dataBroker, dpnId))
+ .collect(Collectors.toList());
+ LOG.debug("advertising IVpnLink route to BGP: vpnRd={}, prefix={}, label={}, nexthops={}",
+ vpnRd, destination, label, nexthopList);
+ bgpManager.advertisePrefix(vpnRd, null /*macAddress*/, destination, nexthopList,
+ VrfEntry.EncapType.Mplsgre, label, 0 /*l3vni*/, 0 /*l2vni*/,
+ null /*gatewayMacAddress*/);