@@ -4528,6 +4528,27 @@ DEFUN(no_bgp_fast_convergence, no_bgp_fast_convergence_cmd,
45284528 return CMD_SUCCESS;
45294529}
45304530
4531+ DEFPY (bgp_ipv6_auto_ra,
4532+ bgp_ipv6_auto_ra_cmd,
4533+ "[no] bgp ipv6-auto-ra",
4534+ NO_STR
4535+ BGP_STR
4536+ "Allow enabling IPv6 ND RA sending\n")
4537+ {
4538+ if (vty->node == CONFIG_NODE) {
4539+ struct listnode *node, *nnode;
4540+ struct bgp *bgp;
4541+
4542+ COND_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA, no);
4543+ for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp))
4544+ COND_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA, no);
4545+ } else {
4546+ VTY_DECLVAR_CONTEXT(bgp, bgp);
4547+ COND_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA, no);
4548+ }
4549+ return CMD_SUCCESS;
4550+ }
4551+
45314552static int peer_conf_interface_get(struct vty *vty, const char *conf_if,
45324553 int v6only,
45334554 const char *peer_group_name,
@@ -17508,6 +17529,9 @@ int bgp_config_write(struct vty *vty)
1750817529 if (bm->tcp_dscp != IPTOS_PREC_INTERNETCONTROL)
1750917530 vty_out(vty, "bgp session-dscp %u\n", bm->tcp_dscp >> 2);
1751017531
17532+ if (CHECK_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA))
17533+ vty_out(vty, "no bgp ipv6-auto-ra\n");
17534+
1751117535 /* BGP configuration. */
1751217536 for (ALL_LIST_ELEMENTS(bm->bgp, mnode, mnnode, bgp)) {
1751317537
@@ -17846,6 +17870,11 @@ int bgp_config_write(struct vty *vty)
1784617870 if (CHECK_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN))
1784717871 vty_out(vty, " bgp shutdown\n");
1784817872
17873+ /* Automatic RA enabling by BGP */
17874+ if (!CHECK_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA))
17875+ if (CHECK_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA))
17876+ vty_out(vty, " no bgp ipv6-auto-ra\n");
17877+
1784917878 if (bgp->allow_martian)
1785017879 vty_out(vty, " bgp allow-martian-nexthop\n");
1785117880
@@ -18276,6 +18305,12 @@ void bgp_vty_init(void)
1827618305 install_element(BGP_NODE, &bgp_fast_convergence_cmd);
1827718306 install_element(BGP_NODE, &no_bgp_fast_convergence_cmd);
1827818307
18308+ /* global bgp ipv6-auto-ra command */
18309+ install_element(CONFIG_NODE, &bgp_ipv6_auto_ra_cmd);
18310+
18311+ /* bgp ipv6-auto-ra command */
18312+ install_element(BGP_NODE, &bgp_ipv6_auto_ra_cmd);
18313+
1827918314 /* global bgp update-delay command */
1828018315 install_element(CONFIG_NODE, &bgp_global_update_delay_cmd);
1828118316 install_element(CONFIG_NODE, &no_bgp_global_update_delay_cmd);
0 commit comments