Skip to content

Commit 8063384

Browse files
authored
[yang] bgp address family l2vpn advertise-all-vni (#21054)
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
1 parent 5b13eaf commit 8063384

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

src/sonic-yang-models/tests/files/sample_config_db.json

+3
Original file line numberDiff line numberDiff line change
@@ -1771,6 +1771,9 @@
17711771
"default|ipv6_unicast": {
17721772
"max_ebgp_paths": "2",
17731773
"max_ibgp_paths": "2"
1774+
},
1775+
"default|l2vpn_evpn": {
1776+
"advertise-all-vni": "true"
17741777
}
17751778
},
17761779
"BGP_GLOBALS_AF_AGGREGATE_ADDR": {

src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
"BGP_GLOBAL_VALID": {
33
"desc": "Configure BGP global table."
44
},
5+
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_TRUE": {
6+
"desc": "BGP Address Family l2vpn_evpn with advertise-all-vni set to true"
7+
},
8+
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_FALSE": {
9+
"desc": "BGP Address Family l2vpn_evpn with advertise-all-vni set to false"
10+
},
11+
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_INVALID": {
12+
"desc": "BGP Address Family l2vpn_evpn with advertise-all-vni set to an invalid value",
13+
"eStr": "Invalid value \"invalid value\" in \"advertise-all-vni\" element."
14+
},
515
"BGP_NEIGHBOR_ALL_VALID": {
616
"desc": "Configure BGP neighbor table."
717
},

src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json

+63-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,69 @@
8181
}
8282
}
8383
},
84-
84+
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_TRUE": {
85+
"sonic-bgp-global:sonic-bgp-global": {
86+
"sonic-bgp-global:BGP_GLOBALS": {
87+
"BGP_GLOBALS_LIST": [
88+
{
89+
"vrf_name":"default",
90+
"local_asn": 65001
91+
}
92+
]
93+
},
94+
"sonic-bgp-global:BGP_GLOBALS_AF": {
95+
"BGP_GLOBALS_AF_LIST": [
96+
{
97+
"vrf_name": "default",
98+
"afi_safi": "l2vpn_evpn",
99+
"advertise-all-vni": "true"
100+
}
101+
]
102+
}
103+
}
104+
},
105+
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_FALSE": {
106+
"sonic-bgp-global:sonic-bgp-global": {
107+
"sonic-bgp-global:BGP_GLOBALS": {
108+
"BGP_GLOBALS_LIST": [
109+
{
110+
"vrf_name":"default",
111+
"local_asn": 65001
112+
}
113+
]
114+
},
115+
"sonic-bgp-global:BGP_GLOBALS_AF": {
116+
"BGP_GLOBALS_AF_LIST": [
117+
{
118+
"vrf_name": "default",
119+
"afi_safi": "l2vpn_evpn",
120+
"advertise-all-vni": "false"
121+
}
122+
]
123+
}
124+
}
125+
},
126+
"BGP_GLOBALS_AF_ADVERTISE_ALL_VNI_INVALID": {
127+
"sonic-bgp-global:sonic-bgp-global": {
128+
"sonic-bgp-global:BGP_GLOBALS": {
129+
"BGP_GLOBALS_LIST": [
130+
{
131+
"vrf_name":"default",
132+
"local_asn": 65001
133+
}
134+
]
135+
},
136+
"sonic-bgp-global:BGP_GLOBALS_AF": {
137+
"BGP_GLOBALS_AF_LIST": [
138+
{
139+
"vrf_name": "default",
140+
"afi_safi": "l2vpn_evpn",
141+
"advertise-all-vni": "invalid value"
142+
}
143+
]
144+
}
145+
}
146+
},
85147
"BGP_NEIGHBOR_ALL_VALID": {
86148
"sonic-port:sonic-port": {
87149
"sonic-port:PORT": {

src/sonic-yang-models/yang-models/sonic-bgp-global.yang

+5
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,11 @@ module sonic-bgp-global {
445445
}
446446
description "Maximum duration to suppress a stable route";
447447
}
448+
449+
leaf advertise-all-vni {
450+
type boolean;
451+
description "L2VPN advertise all VNIs";
452+
}
448453
}
449454
}
450455

0 commit comments

Comments
 (0)