summaryrefslogtreecommitdiff
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
authorMikhail Sokolovskiy <sokolmish@gmail.com>2024-09-24 19:00:11 +0300
committerDavid Lamparter <equinox@opensourcerouting.org>2024-10-29 12:15:04 +0100
commit6bff341ebfd1ce2d202a4f01f3a861d8a59794d4 (patch)
treec68dab7eb1dc71dbb47ffa09c3a9cca82a1cd0c7 /bgpd/bgp_vty.c
parentfbc85e8ecad002888d0686c9e4706067c4215d22 (diff)
bgpd: add `bgp ipv6-auto-ra` command
Introduce a command to stop bgpd from enabling IPv6 router advertisement messages sending on interfaces. Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 31d1704113..71ec289114 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -4819,6 +4819,27 @@ DEFUN(no_bgp_fast_convergence, no_bgp_fast_convergence_cmd,
return CMD_SUCCESS;
}
+DEFPY (bgp_ipv6_auto_ra,
+ bgp_ipv6_auto_ra_cmd,
+ "[no] bgp ipv6-auto-ra",
+ NO_STR
+ BGP_STR
+ "Allow enabling IPv6 ND RA sending\n")
+{
+ if (vty->node == CONFIG_NODE) {
+ struct listnode *node, *nnode;
+ struct bgp *bgp;
+
+ COND_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA, no);
+ for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp))
+ COND_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA, no);
+ } else {
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
+ COND_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA, no);
+ }
+ return CMD_SUCCESS;
+}
+
static int peer_conf_interface_get(struct vty *vty, const char *conf_if,
int v6only,
const char *peer_group_name,
@@ -18461,6 +18482,9 @@ int bgp_config_write(struct vty *vty)
if (bm->tcp_dscp != IPTOS_PREC_INTERNETCONTROL)
vty_out(vty, "bgp session-dscp %u\n", bm->tcp_dscp >> 2);
+ if (CHECK_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA))
+ vty_out(vty, "no bgp ipv6-auto-ra\n");
+
/* BGP InQ limit */
if (bm->inq_limit != BM_DEFAULT_Q_LIMIT)
vty_out(vty, "bgp input-queue-limit %u\n", bm->inq_limit);
@@ -18843,6 +18867,11 @@ int bgp_config_write(struct vty *vty)
if (CHECK_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN))
vty_out(vty, " bgp shutdown\n");
+ /* Automatic RA enabling by BGP */
+ if (!CHECK_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA))
+ if (CHECK_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA))
+ vty_out(vty, " no bgp ipv6-auto-ra\n");
+
if (bgp->allow_martian)
vty_out(vty, " bgp allow-martian-nexthop\n");
@@ -19383,6 +19412,12 @@ void bgp_vty_init(void)
install_element(BGP_NODE, &bgp_fast_convergence_cmd);
install_element(BGP_NODE, &no_bgp_fast_convergence_cmd);
+ /* global bgp ipv6-auto-ra command */
+ install_element(CONFIG_NODE, &bgp_ipv6_auto_ra_cmd);
+
+ /* bgp ipv6-auto-ra command */
+ install_element(BGP_NODE, &bgp_ipv6_auto_ra_cmd);
+
/* global bgp update-delay command */
install_element(CONFIG_NODE, &bgp_global_update_delay_cmd);
install_element(CONFIG_NODE, &no_bgp_global_update_delay_cmd);