Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgp: T6032: add EVPN MAC-VRF Site-of-Origin support #2987

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion data/templates/frr/bgpd.frr.j2
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ router bgp {{ system_as }} {{ 'vrf ' ~ vrf if vrf is vyos_defined }}
{% endif %}
{% if afi_config.ead_es_route_target.export is vyos_defined %}
{% for route_target in afi_config.ead_es_route_target.export %}
ead-es-route-target export {{ route_target }}
ead-es-route-target export {{ route_target }}
{% endfor %}
{% endif %}
{% if afi_config.rt_auto_derive is vyos_defined %}
Expand All @@ -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.mac_vrf.soo is vyos_defined %}
mac-vrf soo {{ afi_config.mac_vrf.soo }}
{% endif %}
{% if afi_config.nexthop.vpn.export is vyos_defined %}
nexthop vpn export {{ afi_config.nexthop.vpn.export }}
{% endif %}
Expand Down
24 changes: 24 additions & 0 deletions interface-definitions/include/bgp/protocol-common-config.xml.i
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,30 @@
</leafNode>
</children>
</node>
<node name="mac-vrf">
<properties>
<help>EVPN MAC-VRF</help>
</properties>
<children>
<leafNode name="soo">
<properties>
<help>Site-of-Origin extended community</help>
<valueHelp>
<format>ASN:NN</format>
<description>based on autonomous system number in format &lt;0-65535:0-4294967295&gt;</description>
</valueHelp>
<valueHelp>
<format>IP:NN</format>
<description>Based on a router-id IP address in format &lt;IP:0-65535&gt;</description>
</valueHelp>
<constraint>
<validator name="bgp-extended-community"/>
</constraint>
<constraintErrorMessage>Should be in form: ASN:NN or IPADDR:NN where ASN is autonomous system number</constraintErrorMessage>
</properties>
</leafNode>
</children>
</node>
<tagNode name="vni">
<properties>
<help>VXLAN Network Identifier</help>
Expand Down
4 changes: 3 additions & 1 deletion smoketest/scripts/cli/test_protocols_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ def test_bgp_06_listen_range(self):

def test_bgp_07_l2vpn_evpn(self):
vnis = ['10010', '10020', '10030']
neighbors = ['192.0.2.10', '192.0.2.20', '192.0.2.30']
soo = '1.2.3.4:10000'
evi_limit = '1000'
route_targets = ['1.1.1.1:100', '1.1.1.1:200', '1.1.1.1:300']

Expand All @@ -760,6 +760,7 @@ def test_bgp_07_l2vpn_evpn(self):
self.cli_set(base_path + ['address-family', 'l2vpn-evpn', 'default-originate', 'ipv6'])
self.cli_set(base_path + ['address-family', 'l2vpn-evpn', 'disable-ead-evi-rx'])
self.cli_set(base_path + ['address-family', 'l2vpn-evpn', 'disable-ead-evi-tx'])
self.cli_set(base_path + ['address-family', 'l2vpn-evpn', 'mac-vrf', 'soo', soo])
for vni in vnis:
self.cli_set(base_path + ['address-family', 'l2vpn-evpn', 'vni', vni, 'advertise-default-gw'])
self.cli_set(base_path + ['address-family', 'l2vpn-evpn', 'vni', vni, 'advertise-svi-ip'])
Expand All @@ -783,6 +784,7 @@ def test_bgp_07_l2vpn_evpn(self):
self.assertIn(f' disable-ead-evi-rx', frrconfig)
self.assertIn(f' disable-ead-evi-tx', frrconfig)
self.assertIn(f' flooding disable', frrconfig)
self.assertIn(f' mac-vrf soo {soo}', frrconfig)
for vni in vnis:
vniconfig = self.getFRRconfig(f' vni {vni}')
self.assertIn(f'vni {vni}', vniconfig)
Expand Down