diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-06-25 16:33:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-25 16:33:26 +0200 |
| commit | a141346934897cf25df38f3fe916bae9d06b886d (patch) | |
| tree | 8391e371c383fb8e65f610edbff54e54fd632448 | |
| parent | 92de46c87e27415105614172c891fff6cfbbc816 (diff) | |
| parent | a83edf1a11c86df0a1419930b31544296a7a6e6c (diff) | |
| download | vyos-1x-a141346934897cf25df38f3fe916bae9d06b886d.tar.gz vyos-1x-a141346934897cf25df38f3fe916bae9d06b886d.zip | |
Merge pull request #5290 from natali-rs1985/T9013
bgp: T9013: Add BMP source-interface support
| -rw-r--r-- | data/templates/frr/bgpd.frr.j2 | 2 | ||||
| -rw-r--r-- | interface-definitions/include/bgp/protocol-common-config.xml.i | 1 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_protocols_bgp.py | 18 |
3 files changed, 19 insertions, 2 deletions
diff --git a/data/templates/frr/bgpd.frr.j2 b/data/templates/frr/bgpd.frr.j2 index c10aa2826..3035262a6 100644 --- a/data/templates/frr/bgpd.frr.j2 +++ b/data/templates/frr/bgpd.frr.j2 @@ -538,7 +538,7 @@ router bgp {{ system_as }} {{ 'vrf ' ~ vrf if vrf is vyos_defined }} {{ 'as-nota {% endif %} {% endif %} {% if bmp_config.address is vyos_defined %} - bmp connect {{ bmp_config.address }} port {{ bmp_config.port }} min-retry {{ bmp_config.min_retry }} max-retry {{ bmp_config.max_retry }} + bmp connect {{ bmp_config.address }} port {{ bmp_config.port }} min-retry {{ bmp_config.min_retry }} max-retry {{ bmp_config.max_retry }} {{ 'source-interface ' ~ bmp_config.source_interface if bmp_config.source_interface is vyos_defined }} {% endif %} {% endfor %} exit diff --git a/interface-definitions/include/bgp/protocol-common-config.xml.i b/interface-definitions/include/bgp/protocol-common-config.xml.i index f342402bb..e6ee667fb 100644 --- a/interface-definitions/include/bgp/protocol-common-config.xml.i +++ b/interface-definitions/include/bgp/protocol-common-config.xml.i @@ -874,6 +874,7 @@ <children> #include <include/address-ipv4-ipv6-single.xml.i> #include <include/port-number.xml.i> + #include <include/source-interface.xml.i> <leafNode name="port"> <defaultValue>5000</defaultValue> </leafNode> diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py index 680829bce..cee52e548 100755 --- a/smoketest/scripts/cli/test_protocols_bgp.py +++ b/smoketest/scripts/cli/test_protocols_bgp.py @@ -1852,6 +1852,7 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): mirror_buffer = '32000000' bmp_path = base_path + ['bmp'] target_path = bmp_path + ['target', target_name] + source_iface = 'eth0' # by default the 'bmp' module not loaded for the bgpd expect Error self.cli_set(bmp_path) @@ -1879,6 +1880,7 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): # config other bmp options self.cli_set(target_path + ['address', target_address]) + self.cli_set(target_path + ['source-interface', source_iface]) self.cli_set(bmp_path + ['mirror-buffer-limit', mirror_buffer]) self.cli_set(target_path + ['port', target_port]) self.cli_set(target_path + ['min-retry', min_retry]) @@ -1899,7 +1901,21 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): self.assertIn(f'bmp monitor ipv6 unicast {monitor_ipv6}', frrconfig) self.assertIn(f'bmp monitor ipv4 unicast loc-rib', frrconfig) self.assertIn(f'bmp monitor ipv6 unicast loc-rib', frrconfig) - self.assertIn(f'bmp connect {target_address} port {target_port} min-retry {min_retry} max-retry {max_retry}', frrconfig) + self.assertIn( + f'bmp connect {target_address} port {target_port} min-retry {min_retry} max-retry {max_retry} source-interface {source_iface}', + frrconfig, + ) + + # verify source-interface is removed from FRR config after deletion + self.cli_delete(target_path + ['source-interface']) + self.cli_commit() + + frrconfig = self.getFRRconfig(f'router bgp {ASN}', stop_section='^exit') + self.assertIn( + f'bmp connect {target_address} port {target_port} min-retry {min_retry} max-retry {max_retry}', + frrconfig, + ) + self.assertNotIn('source-interface', frrconfig) def test_bgp_100_link_state(self): router_id = '127.0.0.1' |
