* we receive from bgp. This is to allow us
* to work with v4 routing over v6 nexthops
*/
- if (peer && !peer->ifp
- && CHECK_FLAG(peer->flags,
- PEER_FLAG_CAPABILITY_ENHE)
- && nhr->prefix.family == AF_INET6
- && nexthop->type != NEXTHOP_TYPE_BLACKHOLE) {
+ if (peer && !peer->ifp &&
+ CHECK_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE) &&
+ !CHECK_FLAG(bnc->bgp->flags,
+ BGP_FLAG_IPV6_NO_AUTO_RA) &&
+ nhr->prefix.family == AF_INET6 &&
+ nexthop->type != NEXTHOP_TYPE_BLACKHOLE) {
struct interface *ifp;
ifp = if_lookup_by_index(nexthop->ifindex,
return;
bgp = peer->bgp;
+ if (CHECK_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA))
+ return;
+
if (!sockunion2hostprefix(&peer->su, &p)) {
zlog_warn("%s: Unable to convert sockunion to prefix for %s",
__func__, peer->host);
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,
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)) {
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");
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);
{
uint32_t ra_interval = BGP_UNNUM_DEFAULT_RA_INTERVAL;
+ if (CHECK_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA))
+ return;
+
/* Don't try to initiate if we're not connected to Zebra */
if (zclient->sock < 0)
return;
bgp->global_gr_present_state = GLOBAL_HELPER;
bgp->present_zebra_gr_state = ZEBRA_GR_DISABLE;
+ if (CHECK_FLAG(bm->flags, BM_FLAG_IPV6_NO_AUTO_RA))
+ SET_FLAG(bgp->flags, BGP_FLAG_IPV6_NO_AUTO_RA);
+
return BGP_GR_SUCCESS;
}
uint32_t flags;
#define BM_FLAG_GRACEFUL_SHUTDOWN (1 << 0)
#define BM_FLAG_SEND_EXTRA_DATA_TO_ZEBRA (1 << 1)
+#define BM_FLAG_IPV6_NO_AUTO_RA (1 << 8)
bool terminating; /* global flag that sigint terminate seen */
/* Indicate Graceful Restart support for BGP NOTIFICATION messages */
#define BGP_FLAG_GRACEFUL_NOTIFICATION (1 << 30)
/* Send Hard Reset CEASE Notification for 'Administrative Reset' */
-#define BGP_FLAG_HARD_ADMIN_RESET (1 << 31)
+#define BGP_FLAG_HARD_ADMIN_RESET (1ULL << 31)
+/* Prohibit BGP from enabling IPv6 RA on interfaces */
+#define BGP_FLAG_IPV6_NO_AUTO_RA (1ULL << 40)
/* BGP default address-families.
* New peers inherit enabled afi/safis from bgp instance.
address family is enabled by default for all new neighbors.
+.. clicmd:: bgp ipv6-auto-ra
+
+ By default, bgpd can ask Zebra to enable sending IPv6 router advertisement
+ messages on interfaces. For example, this happens for unnumbered peers
+ support or when extended-nexthop capability is used. The ``no`` form of this
+ command disables such behaviour.
+
.. _bgp-route-aggregation:
Route Aggregation
.. clicmd:: ipv6 nd suppress-ra
Don't send router advertisement messages. The ``no`` form of this command
- enables sending RA messages.
+ enables sending RA messages. Note that while being suppressed, RA messages
+ might still be enabled by other daemons, such as bgpd or vrrpd.
.. clicmd:: ipv6 nd prefix ipv6prefix [valid-lifetime] [preferred-lifetime] [off-link] [no-autoconfig] [router-address]