return CMD_SUCCESS;
}
+DEFPY (bgp_bestpath_aigp,
+ bgp_bestpath_aigp_cmd,
+ "[no$no] bgp bestpath aigp",
+ NO_STR
+ BGP_STR
+ "Change the default bestpath selection\n"
+ "Evaluate the AIGP attribute during the best path selection process\n")
+{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
+
+ if (no)
+ UNSET_FLAG(bgp->flags, BGP_FLAG_COMPARE_AIGP);
+ else
+ SET_FLAG(bgp->flags, BGP_FLAG_COMPARE_AIGP);
+
+ bgp_recalculate_all_bestpaths(bgp);
+
+ return CMD_SUCCESS;
+}
+
/* "bgp bestpath compare-routerid" configuration. */
DEFUN (bgp_bestpath_compare_router_id,
bgp_bestpath_compare_router_id_cmd,
return peer_ebgp_multihop_unset_vty(vty, argv[idx_peer]->arg);
}
+DEFPY (neighbor_aigp,
+ neighbor_aigp_cmd,
+ "[no$no] neighbor <A.B.C.D|X:X::X:X|WORD>$neighbor aigp",
+ NO_STR
+ NEIGHBOR_STR
+ NEIGHBOR_ADDR_STR2
+ "Enable send and receive of the AIGP attribute per neighbor\n")
+{
+ struct peer *peer;
+
+ peer = peer_and_group_lookup_vty(vty, neighbor);
+ if (!peer)
+ return CMD_WARNING_CONFIG_FAILED;
+
+ if (no)
+ return peer_flag_unset_vty(vty, neighbor, PEER_FLAG_AIGP);
+ else
+ return peer_flag_set_vty(vty, neighbor, PEER_FLAG_AIGP);
+}
+
static uint8_t get_role_by_name(const char *role_str)
{
if (strncmp(role_str, "peer", 2) == 0)
}
}
+ /* aigp */
+ if (peergroup_flag_check(peer, PEER_FLAG_AIGP))
+ vty_out(vty, " neighbor %s aigp\n", addr);
+
/* role */
if (peergroup_flag_check(peer, PEER_FLAG_ROLE) &&
peer->local_role != ROLE_UNDEFINED)
}
if (CHECK_FLAG(bgp->flags, BGP_FLAG_COMPARE_ROUTER_ID))
vty_out(vty, " bgp bestpath compare-routerid\n");
+ if (CHECK_FLAG(bgp->flags, BGP_FLAG_COMPARE_AIGP))
+ vty_out(vty, " bgp bestpath aigp\n");
if (CHECK_FLAG(bgp->flags, BGP_FLAG_MED_CONFED)
|| CHECK_FLAG(bgp->flags, BGP_FLAG_MED_MISSING_AS_WORST)) {
vty_out(vty, " bgp bestpath med");
install_element(BGP_NODE, &neighbor_role_strict_cmd);
install_element(BGP_NODE, &no_neighbor_role_cmd);
+ /* "neighbor aigp" commands. */
+ install_element(BGP_NODE, &neighbor_aigp_cmd);
+
/* bgp disable-ebgp-connected-nh-check */
install_element(BGP_NODE, &bgp_disable_connected_route_check_cmd);
install_element(BGP_NODE, &no_bgp_disable_connected_route_check_cmd);
install_element(BGP_NODE, &bgp_fast_external_failover_cmd);
install_element(BGP_NODE, &no_bgp_fast_external_failover_cmd);
+ /* "bgp bestpath aigp" commands */
+ install_element(BGP_NODE, &bgp_bestpath_aigp_cmd);
+
/* "bgp bestpath compare-routerid" commands */
install_element(BGP_NODE, &bgp_bestpath_compare_router_id_cmd);
install_element(BGP_NODE, &no_bgp_bestpath_compare_router_id_cmd);