/* 9. Maximum path check. */
if (newm == existm)
{
- if (new->peer->sort == BGP_PEER_IBGP)
+ if (bgp_flag_check(bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX))
+ {
+
+ /*
+ * For the two paths, all comparison steps till IGP metric
+ * have succeeded - including AS_PATH hop count. Since 'bgp
+ * bestpath as-path multipath-relax' knob is on, we don't need
+ * an exact match of AS_PATH. Thus, mark the paths are equal.
+ * That will trigger both these paths to get into the multipath
+ * array.
+ */
+ *paths_eq = 1;
+ }
+ else if (new->peer->sort == BGP_PEER_IBGP)
{
if (aspath_cmp (new->attr->aspath, exist->attr->aspath))
*paths_eq = 1;
return CMD_SUCCESS;
}
\f
+/* "bgp bestpath as-path multipath-relax" configuration. */
+DEFUN (bgp_bestpath_aspath_multipath_relax,
+ bgp_bestpath_aspath_multipath_relax_cmd,
+ "bgp bestpath as-path multipath-relax",
+ "BGP specific commands\n"
+ "Change the default bestpath selection\n"
+ "AS-path attribute\n"
+ "Allow load sharing across routes that have different AS paths (but same length)\n")
+{
+ struct bgp *bgp;
+
+ bgp = vty->index;
+ bgp_flag_set (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_bgp_bestpath_aspath_multipath_relax,
+ no_bgp_bestpath_aspath_multipath_relax_cmd,
+ "no bgp bestpath as-path multipath-relax",
+ NO_STR
+ "BGP specific commands\n"
+ "Change the default bestpath selection\n"
+ "AS-path attribute\n"
+ "Allow load sharing across routes that have different AS paths (but same length)\n")
+{
+ struct bgp *bgp;
+
+ bgp = vty->index;
+ bgp_flag_unset (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
+ return CMD_SUCCESS;
+}
+\f
/* "bgp log-neighbor-changes" configuration. */
DEFUN (bgp_log_neighbor_changes,
bgp_log_neighbor_changes_cmd,
install_element (BGP_NODE, &bgp_bestpath_aspath_confed_cmd);
install_element (BGP_NODE, &no_bgp_bestpath_aspath_confed_cmd);
+ /* "bgp bestpath as-path multipath-relax" commands */
+ install_element (BGP_NODE, &bgp_bestpath_aspath_multipath_relax_cmd);
+ install_element (BGP_NODE, &no_bgp_bestpath_aspath_multipath_relax_cmd);
+
/* "bgp log-neighbor-changes" commands */
install_element (BGP_NODE, &bgp_log_neighbor_changes_cmd);
install_element (BGP_NODE, &no_bgp_log_neighbor_changes_cmd);
vty_out (vty, " bgp bestpath as-path ignore%s", VTY_NEWLINE);
if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_CONFED))
vty_out (vty, " bgp bestpath as-path confed%s", VTY_NEWLINE);
+ if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX)) {
+ vty_out (vty, " bgp bestpath as-path multipath-relax%s", VTY_NEWLINE);
+ }
if (bgp_flag_check (bgp, BGP_FLAG_COMPARE_ROUTER_ID))
vty_out (vty, " bgp bestpath compare-routerid%s", VTY_NEWLINE);
if (bgp_flag_check (bgp, BGP_FLAG_MED_CONFED)
#define BGP_FLAG_LOG_NEIGHBOR_CHANGES (1 << 11)
#define BGP_FLAG_GRACEFUL_RESTART (1 << 12)
#define BGP_FLAG_ASPATH_CONFED (1 << 13)
+#define BGP_FLAG_ASPATH_MULTIPATH_RELAX (1 << 14)
/* BGP Per AF flags */
u_int16_t af_flags[AFI_MAX][SAFI_MAX];
decision process.
@end deffn
+@deffn {BGP} {bgp bestpath as-path multipath-relax} {}
+This command specifies that BGP decision process should consider paths
+of equal AS_PATH length candidates for multipath computation. Without
+the knob, the entire AS_PATH must match for multipath computation.
+@end deffn
+
@node BGP route flap dampening
@subsection BGP route flap dampening