@@ -5034,6 +5034,42 @@ DEFUN(no_bgp_fast_convergence, no_bgp_fast_convergence_cmd,
5034
5034
return CMD_SUCCESS;
5035
5035
}
5036
5036
5037
+ static void bgp_set_no_auto_ra_flag(struct vty *vty, bool flag)
5038
+ {
5039
+ if (vty->node == CONFIG_NODE) {
5040
+ struct listnode *node, *nnode;
5041
+ struct bgp *bgp;
5042
+
5043
+ COND_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA, flag);
5044
+ for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp))
5045
+ COND_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA, flag);
5046
+ } else {
5047
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
5048
+ COND_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA, flag);
5049
+ }
5050
+ }
5051
+
5052
+ DEFUN (bgp_ipv6_auto_ra,
5053
+ bgp_ipv6_auto_ra_cmd,
5054
+ "bgp ipv6-auto-ra",
5055
+ BGP_STR
5056
+ "Don't allow enabling IPv6 ND RA sending\n")
5057
+ {
5058
+ bgp_set_no_auto_ra_flag(vty, false);
5059
+ return CMD_SUCCESS;
5060
+ }
5061
+
5062
+ DEFUN (no_bgp_ipv6_auto_ra,
5063
+ no_bgp_ipv6_auto_ra_cmd,
5064
+ "no bgp ipv6-auto-ra",
5065
+ NO_STR
5066
+ BGP_STR
5067
+ "Don't allow enabling IPv6 ND RA sending\n")
5068
+ {
5069
+ bgp_set_no_auto_ra_flag(vty, true);
5070
+ return CMD_SUCCESS;
5071
+ }
5072
+
5037
5073
static int peer_conf_interface_get(struct vty *vty, const char *conf_if,
5038
5074
int v6only,
5039
5075
const char *peer_group_name,
@@ -19360,6 +19396,9 @@ int bgp_config_write(struct vty *vty)
19360
19396
19361
19397
if (CHECK_FLAG(bm->flags, BM_FLAG_SEND_EXTRA_DATA_TO_ZEBRA))
19362
19398
vty_out(vty, "bgp send-extra-data zebra\n");
19399
+
19400
+ if (CHECK_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA))
19401
+ vty_out(vty, "no bgp ipv6-auto-ra\n");
19363
19402
19364
19403
/* DSCP value for outgoing packets in BGP connections */
19365
19404
if (bm->ip_tos != IPTOS_PREC_INTERNETCONTROL)
@@ -19777,6 +19816,11 @@ int bgp_config_write(struct vty *vty)
19777
19816
if (CHECK_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN))
19778
19817
vty_out(vty, " bgp shutdown\n");
19779
19818
19819
+ /* Automatic RA enabling by BGP */
19820
+ if (!CHECK_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA))
19821
+ if (CHECK_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA))
19822
+ vty_out(vty, " no bgp ipv6-auto-ra\n");
19823
+
19780
19824
if (bgp->allow_martian)
19781
19825
vty_out(vty, " bgp allow-martian-nexthop\n");
19782
19826
@@ -20317,6 +20361,14 @@ void bgp_vty_init(void)
20317
20361
install_element(BGP_NODE, &bgp_fast_convergence_cmd);
20318
20362
install_element(BGP_NODE, &no_bgp_fast_convergence_cmd);
20319
20363
20364
+ /* global bgp ipv6-auto-ra command */
20365
+ install_element(CONFIG_NODE, &bgp_ipv6_auto_ra_cmd);
20366
+ install_element(CONFIG_NODE, &no_bgp_ipv6_auto_ra_cmd);
20367
+
20368
+ /* bgp ipv6-auto-ra command */
20369
+ install_element(BGP_NODE, &bgp_ipv6_auto_ra_cmd);
20370
+ install_element(BGP_NODE, &no_bgp_ipv6_auto_ra_cmd);
20371
+
20320
20372
/* global bgp update-delay command */
20321
20373
install_element(CONFIG_NODE, &bgp_global_update_delay_cmd);
20322
20374
install_element(CONFIG_NODE, &no_bgp_global_update_delay_cmd);
0 commit comments