summaryrefslogtreecommitdiff
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
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 4bcb17714a..19828018be 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -4528,6 +4528,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,
@@ -17508,6 +17529,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 configuration. */
for (ALL_LIST_ELEMENTS(bm->bgp, mnode, mnnode, bgp)) {
@@ -17846,6 +17870,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");
@@ -18276,6 +18305,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);