String gwMacAddress = vrfEntry.getGatewayMacAddress();
//The loadbalancing group is created only if the extra route has multiple nexthops
//to avoid loadbalancing the discovered routes
- if (vpnExtraRoutes != null && routes != null) {
+ if (RouteOrigin.STATIC.getValue().equals(vrfEntry.getOrigin()) && vpnExtraRoutes != null
+ && routes != null) {
if (vpnExtraRoutes.size() > 1) {
groupId = nextHopManager.createNextHopGroups(vpnId, rd, dpnId, vrfEntry, routes, vpnExtraRoutes);
localGroupId = nextHopManager.getLocalSelectGroup(vpnId, vrfEntry.getDestPrefix());
interfaceName, writeInvTxn);
}
if (!nhList.isEmpty()) {
- if (Objects.equals(rd, vpnName)) {
+ if (Objects.equals(primaryRd, vpnName)) {
//this is an internal vpn - the rd is assigned to the vpn instance name;
//remove from FIB directly
nhList.forEach(removeAdjacencyFromInternalVpn(nextHop, vpnName,
}
if (adj.getNextHopIpList() != null && !adj.getNextHopIpList().isEmpty()
&& adj.getAdjacencyType() != AdjacencyType.PrimaryAdjacency) {
- RouteOrigin origin = adj.getAdjacencyType() == AdjacencyType.PrimaryAdjacency ? RouteOrigin.LOCAL
+ RouteOrigin origin = adj.getAdjacencyType() == AdjacencyType.LearntIp ? RouteOrigin.DYNAMIC
: RouteOrigin.STATIC;
String nh = adj.getNextHopIpList().get(0);
String vpnPrefixKey = VpnUtil.getVpnNamePrefixKey(vpnName, prefix);