diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-05-19 17:10:37 +0000 |
|---|---|---|
| committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-05-21 13:26:07 +0000 |
| commit | ff96f5895e87db7fc20cff9960a8cdea42c033d0 (patch) | |
| tree | bab85a5faca6967e428939be7952b6ea7d4af2f3 | |
| parent | 2430dd1db9c81f4f61d7629a1d9d9dbcd798a4b2 (diff) | |
| download | vyos-1x-ff96f5895e87db7fc20cff9960a8cdea42c033d0.tar.gz vyos-1x-ff96f5895e87db7fc20cff9960a8cdea42c033d0.zip | |
T8822: Add BFD strict mode for BGP
| -rw-r--r-- | data/templates/frr/bgpd.frr.j2 | 3 | ||||
| -rw-r--r-- | interface-definitions/include/bgp/neighbor-bfd.xml.i | 19 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_protocols_bgp.py | 13 |
3 files changed, 35 insertions, 0 deletions
diff --git a/data/templates/frr/bgpd.frr.j2 b/data/templates/frr/bgpd.frr.j2 index 3ea5d1f1b..27d13c40c 100644 --- a/data/templates/frr/bgpd.frr.j2 +++ b/data/templates/frr/bgpd.frr.j2 @@ -34,6 +34,9 @@ {% if config.bfd.profile is vyos_defined %} neighbor {{ neighbor }} bfd profile {{ config.bfd.profile }} {% endif %} +{% if config.bfd.strict is vyos_defined %} + neighbor {{ neighbor }} bfd strict {{ 'hold-time ' ~ config.bfd.strict.hold_time if config.bfd.strict.hold_time is vyos_defined else '' }} +{% endif %} {% endif %} {% if config.capability.dynamic is vyos_defined %} neighbor {{ neighbor }} capability dynamic diff --git a/interface-definitions/include/bgp/neighbor-bfd.xml.i b/interface-definitions/include/bgp/neighbor-bfd.xml.i index fac2a1166..6de4c9373 100644 --- a/interface-definitions/include/bgp/neighbor-bfd.xml.i +++ b/interface-definitions/include/bgp/neighbor-bfd.xml.i @@ -11,6 +11,25 @@ <valueless/> </properties> </leafNode> + <node name="strict"> + <properties> + <help>Strict mode</help> + </properties> + <children> + <leafNode name="hold-time"> + <properties> + <help>BFD hold time</help> + <valueHelp> + <format>u32:1-4294967295</format> + <description>BFD hold time in seconds</description> + </valueHelp> + <constraint> + <validator name="numeric" argument="--range 1-4294967295"/> + </constraint> + </properties> + </leafNode> + </children> + </node> </children> </node> <!-- include end --> diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py index c2a6f3dd1..c7c0dc6f0 100755 --- a/smoketest/scripts/cli/test_protocols_bgp.py +++ b/smoketest/scripts/cli/test_protocols_bgp.py @@ -1707,6 +1707,19 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): self.cli_commit() + def test_bgp_32_bfd_strict(self): + neighbor = '192.0.2.22' + bfd_hold_time = '23' + + self.cli_set(base_path + ['neighbor', neighbor, 'remote-as', ASN]) + self.cli_set(base_path + ['neighbor', neighbor, 'bfd', 'strict', 'hold-time', bfd_hold_time]) + + self.cli_commit() + + frrconfig = self.getFRRconfig(f'router bgp {ASN}', stop_section='^exit') + self.assertIn(f'router bgp {ASN}', frrconfig) + self.assertIn(f' neighbor {neighbor} bfd strict hold-time {bfd_hold_time}', frrconfig) + def test_bgp_99_bmp(self): target_name = 'instance-bmp' target_address = '127.0.0.1' |
