From b55571138d2b08dd4fda6d8b34a70f9a84a1c721 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sun, 14 Jan 2024 11:35:24 +0100 Subject: bgp: T591: add SRv6 per address-family SID support set protocols bgp address-family ipv4-unicast sid vpn export set protocols bgp address-family ipv6-unicast sid vpn export (cherry picked from commit d7e248ba514108461ca9d5875c0be077c80ceca7) --- interface-definitions/include/bgp/afi-sid.xml.i | 36 ++++++++++++++++++++++ .../include/bgp/protocol-common-config.xml.i | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 interface-definitions/include/bgp/afi-sid.xml.i (limited to 'interface-definitions') diff --git a/interface-definitions/include/bgp/afi-sid.xml.i b/interface-definitions/include/bgp/afi-sid.xml.i new file mode 100644 index 000000000..38a3dcf9b --- /dev/null +++ b/interface-definitions/include/bgp/afi-sid.xml.i @@ -0,0 +1,36 @@ + + + + SID value for VRF + + + + + Between current VRF and VPN + + + + + For routes leaked from current VRF to VPN + + auto + + + u32:1-1048575 + SID allocation index + + + auto + Automatically assign a label + + + auto + + + + + + + + + diff --git a/interface-definitions/include/bgp/protocol-common-config.xml.i b/interface-definitions/include/bgp/protocol-common-config.xml.i index bb35efe94..51daf4e8b 100644 --- a/interface-definitions/include/bgp/protocol-common-config.xml.i +++ b/interface-definitions/include/bgp/protocol-common-config.xml.i @@ -188,6 +188,7 @@ + #include @@ -555,6 +556,7 @@ + #include -- cgit v1.2.3 From 42d6a8cd500b2a92e9dbe0e868b84f4b55b1e02b Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sun, 14 Jan 2024 11:36:31 +0100 Subject: bgp: T591: add VPN nexthop support per address-family set protocols bgp address-family ipv4-unicast nexthop vpn export set protocols bgp address-family ipv6-unicast nexthop vpn export (cherry picked from commit 7349927908206fa83a7295d643f56950309efb4f) --- data/templates/frr/bgpd.frr.j2 | 3 ++ .../include/bgp/afi-nexthop-vpn-export.xml.i | 32 ++++++++++++++++++++++ .../include/bgp/protocol-common-config.xml.i | 2 ++ smoketest/scripts/cli/test_protocols_bgp.py | 6 ++++ 4 files changed, 43 insertions(+) create mode 100644 interface-definitions/include/bgp/afi-nexthop-vpn-export.xml.i (limited to 'interface-definitions') diff --git a/data/templates/frr/bgpd.frr.j2 b/data/templates/frr/bgpd.frr.j2 index f3ae56903..e02fdd1bb 100644 --- a/data/templates/frr/bgpd.frr.j2 +++ b/data/templates/frr/bgpd.frr.j2 @@ -402,6 +402,9 @@ router bgp {{ system_as }} {{ 'vrf ' ~ vrf if vrf is vyos_defined }} {% if afi_config.flooding.head_end_replication is vyos_defined %} flooding head-end-replication {% endif %} +{% if afi_config.nexthop.vpn.export is vyos_defined %} + nexthop vpn export {{ afi_config.nexthop.vpn.export }} +{% endif %} {% if afi_config.rd.vpn.export is vyos_defined %} rd vpn export {{ afi_config.rd.vpn.export }} {% endif %} diff --git a/interface-definitions/include/bgp/afi-nexthop-vpn-export.xml.i b/interface-definitions/include/bgp/afi-nexthop-vpn-export.xml.i new file mode 100644 index 000000000..d90597f37 --- /dev/null +++ b/interface-definitions/include/bgp/afi-nexthop-vpn-export.xml.i @@ -0,0 +1,32 @@ + + + + Specify next hop to use for VRF advertised prefixes + + + + + Between current address-family and vpn + + + + + For routes leaked from current address-family to vpn + + ipv4 + BGP neighbor IP address + + + ipv6 + BGP neighbor IPv6 address + + + + + + + + + + + diff --git a/interface-definitions/include/bgp/protocol-common-config.xml.i b/interface-definitions/include/bgp/protocol-common-config.xml.i index 51daf4e8b..9895b025c 100644 --- a/interface-definitions/include/bgp/protocol-common-config.xml.i +++ b/interface-definitions/include/bgp/protocol-common-config.xml.i @@ -120,6 +120,7 @@ #include #include #include + #include Redistribute routes from other protocols into BGP @@ -496,6 +497,7 @@ #include #include #include + #include Redistribute routes from other protocols into BGP diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py index 0e9ac4f2d..2dbc30a41 100755 --- a/smoketest/scripts/cli/test_protocols_bgp.py +++ b/smoketest/scripts/cli/test_protocols_bgp.py @@ -1139,6 +1139,8 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): def test_bgp_24_srv6_sid(self): locator_name = 'VyOS_foo' sid = 'auto' + nexthop_ipv4 = '192.0.0.1' + nexthop_ipv6 = '2001:db8:100:200::2' self.cli_set(base_path + ['srv6', 'locator', locator_name]) self.cli_set(base_path + ['sid', 'vpn', 'per-vrf', 'export', sid]) @@ -1158,7 +1160,9 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): # Now test AFI SID self.cli_delete(base_path + ['sid']) self.cli_set(base_path + ['address-family', 'ipv4-unicast', 'sid', 'vpn', 'export', sid]) + self.cli_set(base_path + ['address-family', 'ipv4-unicast', 'nexthop', 'vpn', 'export', nexthop_ipv4]) self.cli_set(base_path + ['address-family', 'ipv6-unicast', 'sid', 'vpn', 'export', sid]) + self.cli_set(base_path + ['address-family', 'ipv6-unicast', 'nexthop', 'vpn', 'export', nexthop_ipv6]) self.cli_commit() @@ -1169,8 +1173,10 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): afiv4_config = self.getFRRconfig(' address-family ipv4 unicast') self.assertIn(f' sid vpn export {sid}', afiv4_config) + self.assertIn(f' nexthop vpn export {nexthop_ipv4}', afiv4_config) afiv6_config = self.getFRRconfig(' address-family ipv6 unicast') self.assertIn(f' sid vpn export {sid}', afiv6_config) + self.assertIn(f' nexthop vpn export {nexthop_ipv6}', afiv4_config) def test_bgp_25_ipv4_ipv6_labeled_unicast_peer_group(self): pg_ipv4 = 'foo4' -- cgit v1.2.3