Skip to content

Commit

Permalink
[yang] bgp address family l2vpn advertise-all-vni (#21054)
Browse files Browse the repository at this point in the history
Why I did it
Cannot configure unified bgp for vxlan evpn without specifying advertise-all-vpn. The setting appears to have been introduced as part of PR #5142, can be seen it is already honored as an option here:

sonic-buildimage/src/sonic-frr-mgmt-framework/templates/bgpd/bgpd.conf.db.addr_family.evpn.j2

Lines 1 to 3 in 8e0f1c6

 {% if 'advertise-all-vni' in af_val and af_val['advertise-all-vni'] == 'true' %} 
   advertise-all-vni 
 {% endif %} 
Work item tracking
How I did it
Added basic yang rule

How to verify it
Configure

"BGP_GLOBALS_AF": {
        "default|l2vpn_evpn": {
            "advertise-all-vni": "true"
        }
    }
and run config replace.

Tested branch (Please provide the tested image version)
master as of 20241205

Description for the changelog
[yang] bgp address family l2vpn advertise-all-vni
  • Loading branch information
bradh352 authored Dec 16, 2024
1 parent 5b13eaf commit 8063384
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,9 @@
"default|ipv6_unicast": {
"max_ebgp_paths": "2",
"max_ibgp_paths": "2"
},
"default|l2vpn_evpn": {
"advertise-all-vni": "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 @@ -2,6 +2,16 @@
"BGP_GLOBAL_VALID": {
"desc": "Configure BGP global table."
},
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_TRUE": {
"desc": "BGP Address Family l2vpn_evpn with advertise-all-vni set to true"
},
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_FALSE": {
"desc": "BGP Address Family l2vpn_evpn with advertise-all-vni set to false"
},
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_INVALID": {
"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_NEIGHBOR_ALL_VALID": {
"desc": "Configure BGP neighbor table."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,69 @@
}
}
},

"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_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-all-vni": "true"
}
]
}
}
},
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_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-all-vni": "false"
}
]
}
}
},
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_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-all-vni": "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 @@ -445,6 +445,11 @@ module sonic-bgp-global {
}
description "Maximum duration to suppress a stable route";
}

leaf advertise-all-vni {
type boolean;
description "L2VPN advertise all VNIs";
}
}
}

Expand Down

0 comments on commit 8063384

Please sign in to comment.