diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-12-12 10:09:24 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-12-12 10:14:57 +0100 |
commit | bddabbf696ec8ff638b93c5260aa4823dcc43df3 (patch) | |
tree | 9374260999db229acecbaaf44945b15d9fcd0bfc | |
parent | 1d4c23ca9b62dfa6db6580440b21cd89c5d8f7e8 (diff) | |
download | vyos-1x-bddabbf696ec8ff638b93c5260aa4823dcc43df3.tar.gz vyos-1x-bddabbf696ec8ff638b93c5260aa4823dcc43df3.zip |
bgp: T4069: add "parameters reject-as-sets" CLI option
This command enables rejection of incoming and outgoing routes having AS_SET
or AS_CONFED_SET type.
-rw-r--r-- | data/templates/frr/bgpd.frr.tmpl | 3 | ||||
-rw-r--r-- | interface-definitions/include/bgp/protocol-common-config.xml.i | 6 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_protocols_bgp.py | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/data/templates/frr/bgpd.frr.tmpl b/data/templates/frr/bgpd.frr.tmpl index c04475070..e49aaf12c 100644 --- a/data/templates/frr/bgpd.frr.tmpl +++ b/data/templates/frr/bgpd.frr.tmpl @@ -534,6 +534,9 @@ router bgp {{ local_as }} {{ 'vrf ' ~ vrf if vrf is defined and vrf is not none {% if parameters.no_fast_external_failover is defined %} no bgp fast-external-failover {% endif %} +{% if parameters.reject_as_sets is defined %} + bgp reject-as-sets +{% endif %} {% if parameters.router_id is defined and parameters.router_id is not none %} bgp router-id {{ parameters.router_id }} {% endif %} diff --git a/interface-definitions/include/bgp/protocol-common-config.xml.i b/interface-definitions/include/bgp/protocol-common-config.xml.i index 20ac59c5b..82c8e55a0 100644 --- a/interface-definitions/include/bgp/protocol-common-config.xml.i +++ b/interface-definitions/include/bgp/protocol-common-config.xml.i @@ -1430,6 +1430,12 @@ <valueless/> </properties> </leafNode> + <leafNode name="reject-as-sets"> + <properties> + <help>Reject routes with AS_SET or AS_CONFED_SET flag</help> + <valueless/> + </properties> + </leafNode> #include <include/router-id.xml.i> </children> </node> diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py index 983f6ecd3..87673f459 100755 --- a/smoketest/scripts/cli/test_protocols_bgp.py +++ b/smoketest/scripts/cli/test_protocols_bgp.py @@ -244,6 +244,7 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): self.cli_set(base_path + ['parameters', 'conditional-advertisement', 'timer', cond_adv_timer]) self.cli_set(base_path + ['parameters', 'fast-convergence']) self.cli_set(base_path + ['parameters', 'minimum-holdtime', min_hold_time]) + self.cli_set(base_path + ['parameters', 'reject-as-sets']) # AFI maximum path support self.cli_set(base_path + ['address-family', 'ipv4-unicast', 'maximum-paths', 'ebgp', max_path_v4]) @@ -268,6 +269,7 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): self.assertIn(f' bgp bestpath bandwidth default-weight-for-missing', frrconfig) self.assertIn(f' bgp bestpath compare-routerid', frrconfig) self.assertIn(f' bgp minimum-holdtime {min_hold_time}', frrconfig) + self.assertIn(f' bgp reject-as-sets', frrconfig) self.assertNotIn(f'bgp ebgp-requires-policy', frrconfig) afiv4_config = self.getFRRconfig(' address-family ipv4 unicast') |