summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/frr/bgp.frr.tmpl6
-rw-r--r--interface-definitions/include/bgp-afi-common.xml.i12
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_bgp.py15
3 files changed, 33 insertions, 0 deletions
diff --git a/data/templates/frr/bgp.frr.tmpl b/data/templates/frr/bgp.frr.tmpl
index 56a54ef38..bb8131730 100644
--- a/data/templates/frr/bgp.frr.tmpl
+++ b/data/templates/frr/bgp.frr.tmpl
@@ -87,6 +87,12 @@
{% elif afi == 'l2vpn_evpn' %}
address-family l2vpn evpn
{% endif %}
+{% if afi_config.addpath_tx_all is defined %}
+ neighbor {{ neighbor }} addpath-tx-all-paths
+{% endif %}
+{% if afi_config.addpath_tx_per_as is defined %}
+ neighbor {{ neighbor }} addpath-tx-bestpath-per-AS
+{% endif %}
{% if afi_config.allowas_in is defined and afi_config.allowas_in is not none %}
neighbor {{ neighbor }} allowas-in {{ afi_config.allowas_in.number if afi_config.allowas_in.number is defined }}
{% endif %}
diff --git a/interface-definitions/include/bgp-afi-common.xml.i b/interface-definitions/include/bgp-afi-common.xml.i
index 8c483f131..1a824abfe 100644
--- a/interface-definitions/include/bgp-afi-common.xml.i
+++ b/interface-definitions/include/bgp-afi-common.xml.i
@@ -1,4 +1,16 @@
<!-- included start from bgp-afi-common.xml.i -->
+<leafNode name="addpath-tx-all">
+ <properties>
+ <help>Use addpath to advertise all paths to a neighbor</help>
+ <valueless/>
+ </properties>
+</leafNode>
+<leafNode name="addpath-tx-per-as">
+ <properties>
+ <help>Use addpath to advertise the bestpath per each neighboring AS</help>
+ <valueless/>
+ </properties>
+</leafNode>
#include <include/bgp-afi-allowas-in.xml.i>
<leafNode name="as-override">
<properties>
diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py
index ce643a247..1de51a1fc 100755
--- a/smoketest/scripts/cli/test_protocols_bgp.py
+++ b/smoketest/scripts/cli/test_protocols_bgp.py
@@ -49,6 +49,7 @@ neighbor_config = {
'route_map_in' : route_map_in,
'route_map_out': route_map_out,
'no_send_comm_ext' : '',
+ 'addpath_all' : '',
},
'192.0.2.2' : {
'remote_as' : '200',
@@ -81,6 +82,7 @@ neighbor_config = {
'route_map_in' : route_map_in,
'route_map_out': route_map_out,
'no_send_comm_std' : '',
+ 'addpath_per_as' : '',
},
'2001:db8::2' : {
'remote_as' : '456',
@@ -206,6 +208,11 @@ class TestProtocolsBGP(unittest.TestCase):
self.assertIn(f' no neighbor {peer} send-community', frrconfig)
if 'no_send_comm_ext' in peer_config:
self.assertIn(f' no neighbor {peer} send-community extended', frrconfig)
+ if 'addpath_all' in peer_config:
+ self.assertIn(f' neighbor {peer} addpath-tx-all-paths', frrconfig)
+ if 'addpath_per_as' in peer_config:
+ self.assertIn(f' neighbor {peer} addpath-tx-bestpath-per-AS', frrconfig)
+
def test_bgp_01_simple(self):
router_id = '127.0.0.1'
@@ -287,6 +294,10 @@ class TestProtocolsBGP(unittest.TestCase):
self.session.set(base_path + ['neighbor', peer, 'address-family', afi, 'disable-send-community', 'standard'])
if 'no_send_comm_ext' in peer_config:
self.session.set(base_path + ['neighbor', peer, 'address-family', afi, 'disable-send-community', 'extended'])
+ if 'addpath_all' in peer_config:
+ self.session.set(base_path + ['neighbor', peer, 'address-family', afi, 'addpath-tx-all'])
+ if 'addpath_per_as' in peer_config:
+ self.session.set(base_path + ['neighbor', peer, 'address-family', afi, 'addpath-tx-per-as'])
# commit changes
self.session.commit()
@@ -346,6 +357,10 @@ class TestProtocolsBGP(unittest.TestCase):
self.session.set(base_path + ['peer-group', peer_group, 'address-family', 'ipv4-unicast', 'disable-send-community', 'standard'])
if 'no_send_comm_ext' in config:
self.session.set(base_path + ['peer-group', peer_group, 'address-family', 'ipv4-unicast', 'disable-send-community', 'extended'])
+ if 'addpath_all' in config:
+ self.session.set(base_path + ['peer-group', peer_group, 'address-family', 'ipv4-unicast', 'addpath-tx-all'])
+ if 'addpath_per_as' in config:
+ self.session.set(base_path + ['peer-group', peer_group, 'address-family', 'ipv4-unicast', 'addpath-tx-per-as'])
# commit changes
self.session.commit()