From 812e1a348941759a54c0ceaf86989a5fd1963c9c Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Tue, 13 Oct 2020 22:21:28 -0700 Subject: [PATCH] [bgp]: Enable next-hop-tracking through default (#5600) **- Why I did it** FRR introduced [next hop tracking](http://docs.frrouting.org/projects/dev-guide/en/latest/next-hop-tracking.html) functionality. That functionality requires resolving BGP neighbors before setting BGP connection (or explicit ebgp-multihop command). Sometimes (BGP MONITORS) our neighbors are not directly connected and sessions are IBGP. In this case current configuration prevents FRR to establish BGP connections. Reason would be "waiting for NHT". To fix that we need either add static routes for each not-directly connected ibgp neighbor, or enable command `ip nht resolve-via-default` **- How I did it** Put `ip nht resolve-via-default` into the config **- How to verify it** Build an image. Enable BGP_MONITOR entry and check that entry is Established or Connecting in FRR Co-authored-by: Pavel Shirshov --- dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2 | 2 ++ src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf | 2 ++ src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/interfaces.conf | 2 ++ src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf | 2 ++ src/sonic-config-engine/tests/sample_output/py2/frr.conf | 2 ++ .../tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf | 2 ++ .../tests/sample_output/py2/t2-chassis-fe-zebra.conf | 2 ++ src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf | 2 ++ src/sonic-config-engine/tests/sample_output/py3/frr.conf | 2 ++ .../tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf | 2 ++ .../tests/sample_output/py3/t2-chassis-fe-zebra.conf | 2 ++ src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf | 2 ++ .../tests/sample_output/t2-chassis-fe-pc-zebra.conf | 2 ++ 13 files changed, 26 insertions(+) diff --git a/dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2 b/dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2 index 7526239db8..57d83163d6 100644 --- a/dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2 +++ b/dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2 @@ -10,6 +10,8 @@ vni {{ vnet_metadata['vni'] }} {% endblock vrf %} ! {% block interfaces %} +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) {% for (name, prefix) in INTERFACE|pfx_filter %} interface {{ name }} diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf index 1ed40fab74..775861ef47 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf @@ -18,6 +18,8 @@ agentx ! ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface Ethernet4 link-detect diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/interfaces.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/interfaces.conf index 7665099712..1a49042fad 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/interfaces.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/interfaces.conf @@ -1,5 +1,7 @@ ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface Ethernet4 link-detect diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf index 9f185edc21..5bff88c711 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf @@ -22,6 +22,8 @@ vrf First vni 10 ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface Ethernet4 link-detect diff --git a/src/sonic-config-engine/tests/sample_output/py2/frr.conf b/src/sonic-config-engine/tests/sample_output/py2/frr.conf index 1df7344a9d..08777924d1 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/frr.conf @@ -18,6 +18,8 @@ agentx ! ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface PortChannel03 link-detect diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf index 653cc1510f..fb441f69f6 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf @@ -19,6 +19,8 @@ vrf VnetFE vni 9000 ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface Ethernet8 link-detect diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf index a521da917d..908280e2dd 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf @@ -19,6 +19,8 @@ vrf VnetFE vni 8000 ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface Ethernet8 link-detect diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf index ee48a4e53c..4024f4b340 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf @@ -16,6 +16,8 @@ log facility local4 ! end of template: common/daemons.common.conf.j2! ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface PortChannel03 link-detect diff --git a/src/sonic-config-engine/tests/sample_output/py3/frr.conf b/src/sonic-config-engine/tests/sample_output/py3/frr.conf index 6e8573e9ba..374b3bf5f0 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/frr.conf @@ -18,6 +18,8 @@ agentx ! ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface PortChannel01 link-detect diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf index 180a0e9fab..7b7987650d 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf @@ -19,6 +19,8 @@ vrf VnetFE vni 9000 ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface Ethernet0 link-detect diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf index 661b272682..fc8a8a2fb3 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf @@ -19,6 +19,8 @@ vrf VnetFE vni 8000 ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface Ethernet0 link-detect diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf index e3d0c2d55b..f596c5579d 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf @@ -16,6 +16,8 @@ log facility local4 ! end of template: common/daemons.common.conf.j2! ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface PortChannel01 link-detect diff --git a/src/sonic-config-engine/tests/sample_output/t2-chassis-fe-pc-zebra.conf b/src/sonic-config-engine/tests/sample_output/t2-chassis-fe-pc-zebra.conf index 312394bf76..be261bab99 100644 --- a/src/sonic-config-engine/tests/sample_output/t2-chassis-fe-pc-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/t2-chassis-fe-pc-zebra.conf @@ -12,6 +12,8 @@ vrf VnetFE vni 8000 ! ! +! Enable nht through default route +ip nht resolve-via-default ! Enable link-detect (default disabled) interface PortChannel0 link-detect