Thomas Vachuska | 6655bee | 2017-08-24 16:12:59 -0700 | [diff] [blame] | 1 | submodule openconfig-bgp-global { |
| 2 | |
| 3 | belongs-to openconfig-bgp { |
| 4 | prefix "oc-bgp"; |
| 5 | } |
| 6 | |
| 7 | import openconfig-extensions { prefix oc-ext; } |
| 8 | import openconfig-yang-types { prefix oc-yang; } |
| 9 | import openconfig-inet-types { prefix oc-inet; } |
| 10 | |
| 11 | // Include common submodules |
| 12 | include openconfig-bgp-common; |
| 13 | include openconfig-bgp-common-multiprotocol; |
| 14 | include openconfig-bgp-peer-group; |
| 15 | include openconfig-bgp-common-structure; |
| 16 | |
| 17 | // meta |
| 18 | organization |
| 19 | "OpenConfig working group"; |
| 20 | |
| 21 | contact |
| 22 | "OpenConfig working group |
| 23 | netopenconfig@googlegroups.com"; |
| 24 | |
| 25 | description |
| 26 | "This sub-module contains groupings that are specific to the |
| 27 | global context of the OpenConfig BGP module"; |
| 28 | |
| 29 | oc-ext:openconfig-version "4.0.1"; |
| 30 | |
| 31 | revision "2017-07-30" { |
| 32 | description |
| 33 | "Clarification of add-paths send-max leaf"; |
| 34 | reference "4.0.1"; |
| 35 | } |
| 36 | |
| 37 | revision "2017-07-10" { |
| 38 | description |
| 39 | "Add error notifications; moved add-paths config; add AS |
| 40 | prepend policy features; removed unneeded config leaves"; |
| 41 | reference "4.0.0"; |
| 42 | } |
| 43 | |
| 44 | revision "2017-02-02" { |
| 45 | description |
| 46 | "Bugfix to remove remaining global-level policy data"; |
| 47 | reference "3.0.1"; |
| 48 | } |
| 49 | |
| 50 | revision "2017-01-26" { |
| 51 | description |
| 52 | "Add dynamic neighbor support, migrate to OpenConfig types"; |
| 53 | reference "3.0.0"; |
| 54 | } |
| 55 | |
| 56 | revision "2016-06-21" { |
| 57 | description |
| 58 | "OpenConfig BGP refactor"; |
| 59 | reference "2.1.1"; |
| 60 | } |
| 61 | |
| 62 | grouping bgp-global-config { |
| 63 | description |
| 64 | "Global configuration options for the BGP router."; |
| 65 | |
| 66 | leaf as { |
| 67 | type oc-inet:as-number; |
| 68 | mandatory true; |
| 69 | description |
| 70 | "Local autonomous system number of the router. Uses |
| 71 | the 32-bit as-number type from the model in RFC 6991."; |
| 72 | } |
| 73 | |
| 74 | leaf router-id { |
| 75 | type oc-yang:dotted-quad; |
| 76 | description |
| 77 | "Router id of the router - an unsigned 32-bit integer |
| 78 | expressed in dotted quad notation."; |
| 79 | reference |
| 80 | "RFC4271 - A Border Gateway Protocol 4 (BGP-4), |
| 81 | Section 4.2"; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | grouping bgp-global-state { |
| 86 | description |
| 87 | "Operational state parameters for the BGP neighbor"; |
| 88 | |
| 89 | uses bgp-common-state; |
| 90 | } |
| 91 | |
| 92 | grouping bgp-global-default-route-distance-config { |
| 93 | description |
| 94 | "Configuration options relating to the administrative distance |
| 95 | (or preference) assigned to routes received from different |
| 96 | sources (external, internal, and local)."; |
| 97 | |
| 98 | leaf external-route-distance { |
| 99 | type uint8 { |
| 100 | range "1..255"; |
| 101 | } |
| 102 | description |
| 103 | "Administrative distance for routes learned from external |
| 104 | BGP (eBGP)."; |
| 105 | } |
| 106 | leaf internal-route-distance { |
| 107 | type uint8 { |
| 108 | range "1..255"; |
| 109 | } |
| 110 | description |
| 111 | "Administrative distance for routes learned from internal |
| 112 | BGP (iBGP)."; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | grouping bgp-global-confederation-config { |
| 117 | description |
| 118 | "Configuration options specifying parameters when the local |
| 119 | router is within an autonomous system which is part of a BGP |
| 120 | confederation."; |
| 121 | |
| 122 | leaf identifier { |
| 123 | type oc-inet:as-number; |
| 124 | description |
| 125 | "Confederation identifier for the autonomous system. |
| 126 | Setting the identifier indicates that the local-AS is part |
| 127 | of a BGP confederation."; |
| 128 | } |
| 129 | |
| 130 | leaf-list member-as { |
| 131 | type oc-inet:as-number; |
| 132 | description |
| 133 | "Remote autonomous systems that are to be treated |
| 134 | as part of the local confederation."; |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | grouping bgp-global-dynamic-neighbors { |
| 139 | description |
| 140 | "Grouping containing configuration relating to dynamic peers."; |
| 141 | |
| 142 | container dynamic-neighbor-prefixes { |
| 143 | description |
| 144 | "A list of IP prefixes from which the system should: |
| 145 | - Accept connections to the BGP daemon |
| 146 | - Dynamically configure a BGP neighbor corresponding to the |
| 147 | source address of the remote system, using the parameters |
| 148 | of the specified peer-group. |
| 149 | For such neighbors, an entry within the neighbor list should |
| 150 | be created, indicating that the peer was dynamically |
| 151 | configured, and referencing the peer-group from which the |
| 152 | configuration was derived."; |
| 153 | |
| 154 | list dynamic-neighbor-prefix { |
| 155 | key "prefix"; |
| 156 | description |
| 157 | "An individual prefix from which dynamic neighbor |
| 158 | connections are allowed."; |
| 159 | |
| 160 | leaf prefix { |
| 161 | type leafref { |
| 162 | path "../config/prefix"; |
| 163 | } |
| 164 | description |
| 165 | "Reference to the IP prefix from which source connections |
| 166 | are allowed for the dynamic neighbor group."; |
| 167 | } |
| 168 | |
| 169 | container config { |
| 170 | description |
| 171 | "Configuration parameters relating to the source prefix |
| 172 | for the dynamic BGP neighbor connections."; |
| 173 | |
| 174 | uses bgp-global-dynamic-neighbor-config; |
| 175 | } |
| 176 | |
| 177 | container state { |
| 178 | config false; |
| 179 | description |
| 180 | "Operational state parameters relating to the source |
| 181 | prefix for the dynamic BGP neighbor connections."; |
| 182 | |
| 183 | uses bgp-global-dynamic-neighbor-config; |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | grouping bgp-global-dynamic-neighbor-config { |
| 190 | description |
| 191 | "Configuration parameters relating to an individual prefix from |
| 192 | which dynamic neighbors are accepted."; |
| 193 | |
| 194 | leaf prefix { |
| 195 | type oc-inet:ip-prefix; |
| 196 | description |
| 197 | "The IP prefix within which the source address of the remote |
| 198 | BGP speaker must fall to be considered eligible to the |
| 199 | dynamically configured."; } |
| 200 | |
| 201 | leaf peer-group { |
| 202 | type leafref { |
| 203 | // At bgp/global/dynamic-neighbor-prefixes/dynamic-neighbor |
| 204 | // prefix/config/peer-group |
| 205 | path "../../../../../peer-groups/peer-group/config/" + |
| 206 | "peer-group-name"; |
| 207 | } |
| 208 | description |
| 209 | "The peer-group within which the dynamic neighbor will be |
| 210 | configured. The configuration parameters used for the dynamic |
| 211 | neighbor are those specified within the referenced peer |
| 212 | group."; |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | grouping bgp-global-mp-all-afi-safi-list-contents { |
| 217 | description |
| 218 | "A grouping used for contents of the list of AFI-SAFI |
| 219 | entries at the global BGP level."; |
| 220 | |
| 221 | // import and export policy included for the afi/safi |
| 222 | |
| 223 | uses bgp-common-mp-ipv4-unicast-group; |
| 224 | uses bgp-common-mp-ipv6-unicast-group; |
| 225 | uses bgp-common-mp-ipv4-labeled-unicast-group; |
| 226 | uses bgp-common-mp-ipv6-labeled-unicast-group; |
| 227 | uses bgp-common-mp-l3vpn-ipv4-unicast-group; |
| 228 | uses bgp-common-mp-l3vpn-ipv6-unicast-group; |
| 229 | uses bgp-common-mp-l3vpn-ipv4-multicast-group; |
| 230 | uses bgp-common-mp-l3vpn-ipv6-multicast-group; |
| 231 | uses bgp-common-mp-l2vpn-vpls-group; |
| 232 | uses bgp-common-mp-l2vpn-evpn-group; |
| 233 | } |
| 234 | |
| 235 | grouping bgp-global-afi-safi-list { |
| 236 | description |
| 237 | "List of address-families associated with the BGP instance"; |
| 238 | |
| 239 | list afi-safi { |
| 240 | key "afi-safi-name"; |
| 241 | |
| 242 | description |
| 243 | "AFI,SAFI configuration available for the |
| 244 | neighbour or group"; |
| 245 | |
| 246 | leaf afi-safi-name { |
| 247 | type leafref { |
| 248 | path "../config/afi-safi-name"; |
| 249 | } |
| 250 | description |
| 251 | "Reference to the AFI-SAFI name used as a key |
| 252 | for the AFI-SAFI list"; |
| 253 | } |
| 254 | |
| 255 | container config { |
| 256 | description |
| 257 | "Configuration parameters for the AFI-SAFI"; |
| 258 | uses bgp-common-mp-afi-safi-config; |
| 259 | } |
| 260 | container state { |
| 261 | config false; |
| 262 | description |
| 263 | "State information relating to the AFI-SAFI"; |
| 264 | uses bgp-common-mp-afi-safi-config; |
| 265 | uses bgp-common-state; |
| 266 | } |
| 267 | |
| 268 | container graceful-restart { |
| 269 | description |
| 270 | "Parameters relating to BGP graceful-restart"; |
| 271 | container config { |
| 272 | description |
| 273 | "Configuration options for BGP graceful-restart"; |
| 274 | uses bgp-common-mp-afi-safi-graceful-restart-config; |
| 275 | } |
| 276 | container state { |
| 277 | config false; |
| 278 | description |
| 279 | "State information for BGP graceful-restart"; |
| 280 | uses bgp-common-mp-afi-safi-graceful-restart-config; |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | uses bgp-common-route-selection-options; |
| 285 | uses bgp-common-global-group-use-multiple-paths; |
| 286 | uses bgp-common-structure-neighbor-group-add-paths; |
| 287 | uses bgp-global-mp-all-afi-safi-list-contents; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | // Structural groupings |
| 292 | grouping bgp-global-base { |
| 293 | description |
| 294 | "Global configuration parameters for the BGP router"; |
| 295 | |
| 296 | container config { |
| 297 | description |
| 298 | "Configuration parameters relating to the global BGP router"; |
| 299 | uses bgp-global-config; |
| 300 | } |
| 301 | container state { |
| 302 | config false; |
| 303 | description |
| 304 | "State information relating to the global BGP router"; |
| 305 | uses bgp-global-config; |
| 306 | uses bgp-global-state; |
| 307 | } |
| 308 | |
| 309 | container default-route-distance { |
| 310 | description |
| 311 | "Administrative distance (or preference) assigned to |
| 312 | routes received from different sources |
| 313 | (external, internal, and local)."; |
| 314 | |
| 315 | container config { |
| 316 | description |
| 317 | "Configuration parameters relating to the default route |
| 318 | distance"; |
| 319 | uses bgp-global-default-route-distance-config; |
| 320 | } |
| 321 | container state { |
| 322 | config false; |
| 323 | description |
| 324 | "State information relating to the default route distance"; |
| 325 | uses bgp-global-default-route-distance-config; |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | container confederation { |
| 330 | description |
| 331 | "Parameters indicating whether the local system acts as part |
| 332 | of a BGP confederation"; |
| 333 | |
| 334 | container config { |
| 335 | description |
| 336 | "Configuration parameters relating to BGP confederations"; |
| 337 | uses bgp-global-confederation-config; |
| 338 | } |
| 339 | container state { |
| 340 | config false; |
| 341 | description |
| 342 | "State information relating to the BGP confederations"; |
| 343 | uses bgp-global-confederation-config; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | container graceful-restart { |
| 348 | description |
| 349 | "Parameters relating the graceful restart mechanism for BGP"; |
| 350 | container config { |
| 351 | description |
| 352 | "Configuration parameters relating to graceful-restart"; |
| 353 | uses bgp-common-graceful-restart-config; |
| 354 | } |
| 355 | container state { |
| 356 | config false; |
| 357 | description |
| 358 | "State information associated with graceful-restart"; |
| 359 | uses bgp-common-graceful-restart-config; |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | uses bgp-common-global-group-use-multiple-paths; |
| 364 | uses bgp-common-route-selection-options; |
| 365 | |
| 366 | container afi-safis { |
| 367 | description |
| 368 | "Address family specific configuration"; |
| 369 | uses bgp-global-afi-safi-list; |
| 370 | } |
| 371 | |
| 372 | uses bgp-global-dynamic-neighbors; |
| 373 | } |
| 374 | |
| 375 | } |