Skip to content

Commit

Permalink
[frr-mgmt-framework]: VXLAN EVPN should support advertise-svi-ip [PR s…
Browse files Browse the repository at this point in the history
…onic-net#21336]

advertise-svi-ip allows the switch to participate in the L2 VXLAN
via its unique IP address.

Signed-off-by: Brad House (@bradh352)
  • Loading branch information
bradh352 committed Jan 20, 2025
1 parent f9527ca commit 2d3091f
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/sonic-frr-mgmt-framework/frrcfgd/frrcfgd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,7 @@ class BGPConfigDaemon:
'+route_flap_dampen_suppress_threshold',
'+route_flap_dampen_max_suppress'], '{no:no-prefix}bgp dampening {} {} {} {}', ['true', 'false']),
('advertise-all-vni', '{no:no-prefix}advertise-all-vni', ['true','false']),
('advertise-svi-ip', '{no:no-prefix}advertise-svi-ip', ['true','false']),
('advertise-default-gw', '{no:no-prefix}advertise-default-gw', ['true','false']),
('advertise-ipv4-unicast', '{no:no-prefix}advertise ipv4 unicast', ['true','false']),
('advertise-ipv6-unicast', '{no:no-prefix}advertise ipv6 unicast', ['true','false']),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% if 'advertise-all-vni' in af_val and af_val['advertise-all-vni'] == 'true' %}
advertise-all-vni
{% endif %}
{% if 'advertise-svi-ip' in af_val and af_val['advertise-svi-ip'] == 'true' %}
advertise-svi-ip
{% endif %}
{% if 'autort' in af_val %}
autort {{af_val['autort']}}
{% endif %}
Expand Down Expand Up @@ -75,4 +78,4 @@
exit-vni
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
2 changes: 2 additions & 0 deletions src/sonic-frr-mgmt-framework/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def hdl_confed_peers_cmd(is_del, cmd_list, chk_data):
conf_bgp_af_cmd('default', 100, 'ipv4') + ['{}distance bgp 100 115 238']),
CmdMapTestInfo('BGP_GLOBALS_AF', 'default|ipv6_unicast', {'advertise-all-vni': 'true'},
conf_bgp_af_cmd('default', 100, 'ipv6') + ['{}advertise-all-vni']),
CmdMapTestInfo('BGP_GLOBALS_AF', 'default|ipv6_unicast', {'advertise-svi-ip': 'true'},
conf_bgp_af_cmd('default', 100, 'ipv6') + ['{}advertise-svi-ip']),
CmdMapTestInfo('BGP_GLOBALS', 'Vrf_red', {'local_asn': 200},
conf_bgp_dft_cmd('Vrf_red', 200), False, conf_no_bgp_cmd('Vrf_red', 200), None, None, None),
CmdMapTestInfo('BGP_GLOBALS', 'Vrf_red', {'med_confed': 'true'},
Expand Down
3 changes: 2 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,8 @@
"max_ibgp_paths": "2"
},
"default|l2vpn_evpn": {
"advertise-all-vni": "true"
"advertise-all-vni": "true",
"advertise-svi-ip": "true"
}
},
"BGP_GLOBALS_AF_AGGREGATE_ADDR": {
Expand Down
10 changes: 10 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
"desc": "BGP Address Family l2vpn_evpn with advertise-all-vni set to an invalid value",
"eStr": "Invalid value \"invalid value\" in \"advertise-all-vni\" element."
},
"BGP_GLOBALS_AF_ADVERTISE_SVI_IP_TRUE": {
"desc": "BGP Address Family l2vpn_evpn with advertise-svi-ip set to true"
},
"BGP_GLOBALS_AF_ADVERTISE_SVI_IP_FALSE": {
"desc": "BGP Address Family l2vpn_evpn with advertise-svi-ip set to false"
},
"BGP_GLOBALS_AF_ADVERTISE_SVI_IP_INVALID": {
"desc": "BGP Address Family l2vpn_evpn with advertise-svi-ip set to an invalid value",
"eStr": "Invalid value \"invalid value\" in \"advertise-svi-ip\" element."
},
"BGP_NEIGHBOR_ALL_VALID": {
"desc": "Configure BGP neighbor table."
},
Expand Down
63 changes: 63 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,69 @@
}
}
},
"BGP_GLOBALS_AF_ADVERTISE_SVI_IP_TRUE": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name":"default",
"local_asn": 65001
}
]
},
"sonic-bgp-global:BGP_GLOBALS_AF": {
"BGP_GLOBALS_AF_LIST": [
{
"vrf_name": "default",
"afi_safi": "l2vpn_evpn",
"advertise-svi-ip": "true"
}
]
}
}
},
"BGP_GLOBALS_AF_ADVERTISE_SVI_IP_FALSE": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name":"default",
"local_asn": 65001
}
]
},
"sonic-bgp-global:BGP_GLOBALS_AF": {
"BGP_GLOBALS_AF_LIST": [
{
"vrf_name": "default",
"afi_safi": "l2vpn_evpn",
"advertise-svi-ip": "false"
}
]
}
}
},
"BGP_GLOBALS_AF_ADVERTISE_SVI_IP_INVALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name":"default",
"local_asn": 65001
}
]
},
"sonic-bgp-global:BGP_GLOBALS_AF": {
"BGP_GLOBALS_AF_LIST": [
{
"vrf_name": "default",
"afi_safi": "l2vpn_evpn",
"advertise-svi-ip": "invalid value"
}
]
}
}
},
"BGP_NEIGHBOR_ALL_VALID": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
Expand Down
5 changes: 5 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-bgp-global.yang
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,11 @@ module sonic-bgp-global {
type boolean;
description "L2VPN advertise all VNIs";
}

leaf advertise-svi-ip {
type boolean;
description "L2VPN advertise the local SVI IP address so that it can be accessible from remote VTEPs";
}
}
}

Expand Down

0 comments on commit 2d3091f

Please sign in to comment.