zebra: Enable nht resolve-via-default by default for traditional profile

Lots of questions raising regarding unresolved nht, I think it's time to
relax this and make it a default ON.

Here is an example list of issues when `nht resolvia-via-default` solved
the problem:

https://github.com/FRRouting/frr/issues/3241
https://github.com/FRRouting/frr/issues/7420
https://github.com/FRRouting/frr/issues/3474
https://github.com/FRRouting/frr/issues/5023
https://github.com/FRRouting/frr/issues/6504
https://github.com/FRRouting/frr/issues/6680
https://github.com/FRRouting/frr/issues/7049
https://github.com/FRRouting/frr/issues/7862
https://github.com/FRRouting/frr/issues/7999
https://github.com/FRRouting/frr/issues/13215
https://github.com/FRRouting/frr/issues/14098

TL;DR;

The BGP session does not come up if using multihop sessions and/or the peer(nexthop)
is not accessible from the RIB, but only via default route. This is even valid for
iBGP, and not only for eBGP peering. Adding a static /32, /128 route for the peer
would do the trick, but it's a workaround.

If the route has a nexthop marked as invalid, most likely this is due to it can't
be resolved from the current RIB, but only via default route.

For instance, Cisco allows this by default (can't find even a knob to turn it
off or I'm blind).

For eBGP sessions it might be also combined with `disable-ebgp-connected-route-check`.

Some people asked if this could be a default, also for instance MetalLB is adding
this by default for all the configs it generates.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2023-08-06 20:42:47 +03:00
parent d50812edb0
commit 62196fbd19
3 changed files with 41 additions and 8 deletions

View File

@ -328,11 +328,15 @@ the default route.
Allow IPv4 nexthop tracking to resolve via the default route. This parameter
is configured per-VRF, so the command is also available in the VRF subnode.
This is enabled by default for a traditional profile.
.. clicmd:: ipv6 nht resolve-via-default
Allow IPv6 nexthop tracking to resolve via the default route. This parameter
is configured per-VRF, so the command is also available in the VRF subnode.
This is enabled by default for a traditional profile.
.. clicmd:: show ip nht [vrf NAME] [A.B.C.D|X:X::X:X] [mrib] [json]
Show nexthop tracking status for address resolution. If vrf is not specified

View File

@ -373,6 +373,12 @@ struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf)
zebra_pw_init(zvrf);
zvrf->table_id = RT_TABLE_MAIN;
/* by default table ID is default one */
if (DFLT_ZEBRA_IP_NHT_RESOLVE_VIA_DEFAULT) {
zvrf->zebra_rnh_ip_default_route = true;
zvrf->zebra_rnh_ipv6_default_route = true;
}
return zvrf;
}
@ -456,11 +462,20 @@ static int vrf_config_write(struct vty *vty)
zvrf->l3vni)
? " prefix-routes-only"
: "");
if (zvrf->zebra_rnh_ip_default_route)
vty_out(vty, "ip nht resolve-via-default\n");
if (zvrf->zebra_rnh_ipv6_default_route)
vty_out(vty, "ipv6 nht resolve-via-default\n");
if (zvrf->zebra_rnh_ip_default_route !=
SAVE_ZEBRA_IP_NHT_RESOLVE_VIA_DEFAULT)
vty_out(vty, "%sip nht resolve-via-default\n",
zvrf->zebra_rnh_ip_default_route
? ""
: "no ");
if (zvrf->zebra_rnh_ipv6_default_route !=
SAVE_ZEBRA_IP_NHT_RESOLVE_VIA_DEFAULT)
vty_out(vty, "%sipv6 nht resolve-via-default\n",
zvrf->zebra_rnh_ipv6_default_route
? ""
: "no ");
if (zvrf->tbl_mgr
&& (zvrf->tbl_mgr->start || zvrf->tbl_mgr->end))
@ -476,11 +491,19 @@ static int vrf_config_write(struct vty *vty)
? " prefix-routes-only"
: "");
zebra_ns_config_write(vty, (struct ns *)vrf->ns_ctxt);
if (zvrf->zebra_rnh_ip_default_route)
vty_out(vty, " ip nht resolve-via-default\n");
if (zvrf->zebra_rnh_ip_default_route !=
SAVE_ZEBRA_IP_NHT_RESOLVE_VIA_DEFAULT)
vty_out(vty, " %sip nht resolve-via-default\n",
zvrf->zebra_rnh_ip_default_route
? ""
: "no ");
if (zvrf->zebra_rnh_ipv6_default_route)
vty_out(vty, " ipv6 nht resolve-via-default\n");
if (zvrf->zebra_rnh_ipv6_default_route !=
SAVE_ZEBRA_IP_NHT_RESOLVE_VIA_DEFAULT)
vty_out(vty, " %sipv6 nht resolve-via-default\n",
zvrf->zebra_rnh_ipv6_default_route
? ""
: "no ");
if (zvrf->tbl_mgr && vrf_is_backend_netns()
&& (zvrf->tbl_mgr->start || zvrf->tbl_mgr->end))

View File

@ -13,11 +13,17 @@
#include <zebra/zebra_pw.h>
#include <zebra/rtadv.h>
#include <lib/vxlan.h>
#include "defaults.h"
#ifdef __cplusplus
extern "C" {
#endif
FRR_CFG_DEFAULT_BOOL(ZEBRA_IP_NHT_RESOLVE_VIA_DEFAULT,
{ .val_bool = true, .match_profile = "traditional", },
{ .val_bool = false },
);
/* MPLS (Segment Routing) global block */
struct mpls_srgb {
uint32_t start_label;