Skip to content

Commit

Permalink
bgpd: Enable enforce-first-as by default
Browse files Browse the repository at this point in the history
It's been for a while disabled by default, but this seems reasonable to flip it.

We had `bgp enforce-first-as` as a global BGP knob to enable/disable this
behavior globally, later we introduced `enforce-first-as` per neighbor, with disabled
by default. Now let's enable this by default.

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Oct 26, 2023
1 parent a709218 commit 19a2bef
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -17973,8 +17973,8 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
addr);

/* enforce-first-as */
if (peergroup_flag_check(peer, PEER_FLAG_ENFORCE_FIRST_AS))
vty_out(vty, " neighbor %s enforce-first-as\n", addr);
if (!peergroup_flag_check(peer, PEER_FLAG_ENFORCE_FIRST_AS))
vty_out(vty, " no neighbor %s enforce-first-as\n", addr);

/* update-source */
if (peergroup_flag_check(peer, PEER_FLAG_UPDATE_SOURCE)) {
Expand Down
2 changes: 2 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,8 @@ struct peer *peer_new(struct bgp *bgp)

SET_FLAG(peer->sflags, PEER_STATUS_CAPABILITY_OPEN);

SET_FLAG(peer->flags, PEER_FLAG_ENFORCE_FIRST_AS);

/* Initialize per peer bgp GR FSM */
bgp_peer_gr_init(peer);

Expand Down
2 changes: 1 addition & 1 deletion doc/user/bgp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ Configuring Peers
Discard updates received from the specified (eBGP) peer if the AS_PATH
attribute does not contain the PEER's ASN as the first AS_PATH segment.

Default: disabled.
Default: enabled.

.. clicmd:: neighbor PEER extended-optional-parameters

Expand Down
2 changes: 1 addition & 1 deletion yang/frr-bgp-neighbor.yang
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ submodule frr-bgp-neighbor {

leaf enforce-first-as {
type boolean;
default "false";
default "true";
description
"When set to 'true' it will enforce the first AS for EBGP routes.";
}
Expand Down

0 comments on commit 19a2bef

Please sign in to comment.