-
Notifications
You must be signed in to change notification settings - Fork 4
/
netgate-bgp.yang
4179 lines (3532 loc) · 87.1 KB
/
netgate-bgp.yang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
module netgate-bgp {
yang-version 1.1;
namespace "urn:netgate:xml:yang:netgate-bgp";
prefix "ngbgp";
import ietf-inet-types {
prefix "inet";
}
import ietf-yang-types {
prefix "yang";
}
import netgate-frr-types {
prefix "frr";
}
import netgate-frr {
prefix "ngfrr";
}
import netgate-cli-extensions {
prefix "ngcliext";
}
import netgate-common {
prefix "ngcom";
}
import netgate-route {
prefix "ngrt";
}
organization "Netgate";
contact "Web: <http://www.netgate.com>";
description
"This YANG module provides a Netgate-defined data-model
for BGP data.
Copyright 2019-2024 Rubicon Communications, LLC.
";
revision 2024-10-02 {
description
"TNSR Release 24.10.";
}
revision 2024-06-01 {
description
"TNSR Release 24.06.";
}
revision 2024-02-01 {
description
"TNSR Release 24.02.";
}
revision 2023-11-02 {
description
"TNSR Release 23.11.";
}
revision 2023-11-01 {
description
"TNSR Release 23.11.";
}
revision 2023-06-01 {
description
"TNSR Release 23.06.";
}
revision 2023-02-15 {
description
"TNSR Release 23.02.";
}
revision 2022-10-15 {
description
"TNSR Release 22.10.";
}
revision 2022-02-15 {
description
"TNSR Release 22.02.";
}
revision 2021-06-15 {
description
"TNSR Release 21.07.";
}
revision 2021-02-15 {
description
"TNSR Release 21.02.";
}
revision 2020-06-15 {
description
"TNSR Release 20.06.";
}
revision 2020-02-15 {
description
"TNSR Release 20.02.";
}
revision 2019-12-15 {
description
"TNSR Release 19.12.";
}
revision 2019-08-30 {
description
"TNSR Release 19.08.";
}
revision 2019-05-30 {
description
"TNSR Release 19.05.";
}
typedef bgp-vrf-id {
type ngcom:host-if-name;
}
typedef bgp-orf-prefix-list {
type enumeration {
enum send {
description
"Send";
}
enum receive {
description
"Receive";
}
enum both {
description
"Both";
}
}
}
typedef bgp-source {
type enumeration {
enum kernel {
description
"Kernel";
}
enum connected {
description
"Connected";
}
enum ospf {
description
"OSPF";
}
}
}
typedef community-list-value-type {
type enumeration {
enum standard {
description
"The rules are normal numbers.";
}
enum expanded {
description
"The rules are regular expressions.";
}
}
}
typedef community-list-value-size {
type enumeration {
enum normal {
description
"Rules allow the original, normal communities values.";
}
enum extended {
description
"Rules allow IPv4-based policies and matches 8 octets
per community from RFC 5668.";
}
enum large {
description
"Rules allow 12-octet values from RFC 8092.";
}
}
}
typedef community-list-action {
type enumeration {
enum deny {
description
"Deny";
}
enum permit {
description
"Permit";
}
}
}
typedef bgp-show-request {
type enumeration {
enum config {
description
"Configuration";
}
enum neighbors {
description
"Neighbors";
}
enum network {
description
"Network";
}
enum nexthop {
description
"Nexthop";
}
enum peer-group {
description
"Peer-group";
}
enum summary {
description
"Summary";
}
}
}
typedef bgp-show-parameter {
type enumeration {
enum advertised-routes {
description
"Routes advertised to BGP neighbor";
}
enum dampened-routes {
description
"Dampened routes received from BGP neighbor";
}
enum detail {
description
"Detail";
}
enum flap-statistics {
description
"Flap statistics of the routes learned from BGP neighbor";
}
enum graceful-restart {
description
"graceful-restart";
}
enum prefix-counts {
description
"Detailed prefix count information";
}
enum received {
description
"Information received from BGP neighbor";
}
enum received-routes {
description
"Received routes from BGP neighbor";
}
enum routes {
description
"Routes learned from BGP neighbor";
}
}
}
typedef bgp-show-parameter2 {
type enumeration {
enum prefix-filter {
description
"Prefix-list filter";
}
}
}
typedef bgp-ip-family {
type enumeration {
enum ipv4 {
description
"IPv4 address";
}
enum ipv6 {
description
"IPv6 address";
}
}
}
typedef bgp-graceful-restart-mode {
type enumeration {
enum enable {
description
"graceful-restart enabled";
}
enum helper {
description
"graceful-restart helper mode";
}
enum disable {
description
"graceful-restart disabled";
}
}
}
grouping bgp-ipv4-aggregations {
description
"IPv4 address aggregation.";
list aggregation {
key "ip-address";
description
"Aggregated IP address and optional prefix";
ngcliext:node-fmt "^aggregate-address @{ip-address}";
ngcliext:post-node-fmt "$n";
leaf ip-address {
type inet:ipv4-prefix;
description
"Specifies aggregated adddresses as an IPv4
address and prefix.";
}
container aggregation-data {
presence
"If present, the IPv4 prefix has
configured aggregation data.";
ngcliext:children-order "as-set summary-only";
leaf as-set {
type boolean;
description
"Resulting routes include AS set.";
ngcliext:node-op "bool";
ngcliext:node-fmt "| $%";
}
leaf summary-only {
type boolean;
description
"Aggregated routes will not be announced.";
ngcliext:node-op "bool";
ngcliext:node-fmt "| $%";
}
}
}
}
grouping bgp-ipv6-aggregations {
description
"IPv6 address aggregation.";
list aggregation {
key "ip-address";
description
"Aggregated IP address and optional prefix";
ngcliext:node-fmt "^aggregate-address @{ip-address}";
ngcliext:post-node-fmt "$n";
leaf ip-address {
type inet:ipv6-prefix;
description
"Specifies aggregated adddresses as an IPv4
address and prefix.";
}
container aggregation-data {
presence
"If present, the IPv6 prefix has
configured aggregation data.";
leaf summary-only {
type boolean;
description
"Aggregated routes will not be announced.";
ngcliext:node-op "bool";
ngcliext:node-fmt "| $%";
}
}
}
}
grouping bgp-ipv4-distance-admin {
description
"Administrative distance specification.";
ngcliext:node-fmt "^distance administrative @{distance}${ip-src-prefix}${access-list-name}$n";
leaf distance {
type uint8;
description
"The administrative distance.";
}
leaf ip-src-prefix {
type inet:ipv4-prefix;
description
"The source IPv4 address and prefix.";
ngcliext:child-fmt " prefix @@";
}
leaf access-list-name {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngfrr:access-lists/ngfrr:list"
+ "/ngfrr:name";
}
description
"An optional Access List name.";
ngcliext:child-fmt " access-list @@";
}
}
grouping bgp-ipv6-distance-admin {
description
"Administrative distance specification.";
ngcliext:node-fmt "^distance administrative @{distance}${ip-src-prefix}${access-list-name}$n";
leaf distance {
type uint8;
description
"The administrative distance.";
}
leaf ip-src-prefix {
type inet:ipv6-prefix;
description
"The source IPv6 address and prefix.";
ngcliext:child-fmt " prefix @@";
}
leaf access-list-name {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngfrr:access-lists/ngfrr:list"
+ "/ngfrr:name";
}
description
"An optional Access List name.";
ngcliext:child-fmt " access-list @@";
}
}
grouping bgp-distance-bgp {
description
"BGP distance specification.";
ngcliext:node-fmt "^distance ${external} ${internal} ${local}$n";
leaf external {
type uint8;
description
"The distance for external routes.";
ngcliext:child-fmt "$% @@";
}
leaf internal {
type uint8;
description
"The distance for internal routes.";
ngcliext:child-fmt "$% @@";
}
leaf local {
type uint8;
description
"The distance for local routes.";
ngcliext:child-fmt "$% @@";
}
}
grouping bgp-multiple-path-maximums {
description
"If packets should be forwarded over multiple paths, these
parameters specify the maximum number of paths.";
ngcliext:parent-fmt "^maximum-paths";
leaf non-ibgp-paths {
type uint8 {
range "1..255";
}
description
"Number of non-iBGP paths.";
ngcliext:node-fmt "$< @@$n";
}
leaf ibgp-paths {
type uint8 {
range "1..255";
}
description
"Number of iBGP paths.";
ngcliext:node-fmt "$< ibgp @@%{equal-cluster-length}$n";
}
leaf equal-cluster-length {
type boolean;
must "../ibgp-paths != ''" {
error-message
"equal-cluster-length requires ibgp-paths to be set.";
}
description
"If true, cluster lengths should match for iBGP paths.";
ngcliext:sibling-op "bool";
ngcliext:sibling-fmt "| $%";
}
}
grouping bgp-neighbors {
description
"Address-family-specific attributes that are per neighbor.";
list neighbor {
key "peer";
description
"List of neighbors within an address-family clause,
indexed by peer.";
ngcliext:node-fmt "^neighbor @{peer}$n";
ngcliext:pre-children-op "push";
leaf peer {
type string;
mandatory true;
description
"The IPv4 or IPv6 address of the neighboring BGP
peer, or the name of a peer group.";
}
leaf activate {
type boolean;
description
"Enable the Address Family for this Neighbor.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^$%$n";
}
leaf addpath-tx-all-paths {
type boolean;
description
"Use addpath to advertise all paths to a neighbor.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^$%$n";
}
leaf addpath-tx-bestpath-per-as {
type boolean;
description
"Use addpath to advertise the bestpath per each
neighboring AS.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^$%$n";
}
container allowas-in {
presence
"Enables the allowas-in clause. One of
'occurences' and 'origin' may also be present.";
ngcliext:node-op "test-set:@{occurences}@{origin}";
ngcliext:node-fmt "^allowas-in$n|";
description
"Accept an AS-path with my AS present in it.";
leaf occurences {
type uint8;
description
"A number in the range [1..10] giving the
number of occurences allowed.";
ngcliext:node-fmt "^allowas-in @@$n";
}
leaf origin {
type boolean;
description
"If true, only accept my AS in the AS--path if
the route originated in my AS.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^allowas-in $%$n";
}
}
leaf as-override {
type boolean;
description
"Override ASNs in outbound updates if as-path
equals remote-as.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^$%$n";
}
container attribute-unchanged {
presence
"With no other leafs in this list, the presence of
this container indicates a bare command that
causes all attributes to be passed unchanged to
this peer.";
description
"BGP attributes that are propagated unchanged to
this neighbor.";
ngcliext:parent-fmt "^$%";
leaf-list attr {
type string;
description
"Possible attributes are: 'as-path', 'med', or
'next-hop'.";
ngcliext:node-fmt "$< @@$n";
}
}
container capability-advertise {
description
"Peer capability advertisement
directives.";
leaf orf-prefix-list {
type bgp-orf-prefix-list;
description
"One of the values 'send', 'receive', or 'both'.";
ngcliext:node-fmt "^capability orf prefix-list @@$n";
}
}
container default-originate {
presence
"If present, the default-originate attribute is
set and default routes will be announced to this
peer. It also has an optional route-map.";
ngcliext:node-fmt "^$%${route-map}$n";
leaf route-map {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngfrr:route-maps"
+ "/ngfrr:map"
+ "/ngfrr:name";
}
description
"A route map to specify criteria to originate
default.";
ngcliext:child-fmt " route-map @@";
}
}
leaf distribute-list-in {
type string;
description
"The name of an 'in' distribution access list used
to filter incoming updates.";
ngcliext:node-fmt "^distribute-list @@ in$n";
}
leaf distribute-list-out {
type string;
description
"The name of an 'out' distribution access list
used to filter outgoing updates.";
ngcliext:node-fmt "^distribute-list @@ out$n";
}
leaf filter-list-in {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngbgp:bgp"
+ "/ngbgp:as-path-table"
+ "/ngbgp:as-path"
+ "/ngbgp:name";
}
description
"The name of an 'in' AS-path access-list name used
to filter incoming routes.";
ngcliext:node-fmt "^filter-list @@ in$n";
}
leaf filter-list-out {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngbgp:bgp"
+ "/ngbgp:as-path-table"
+ "/ngbgp:as-path"
+ "/ngbgp:name";
}
description
"The name of an 'in' AS-path access-list name used
to filter outgoing routes.";
ngcliext:node-fmt "^filter-list @@ out$n";
}
container maximum-prefix {
presence
"Indicates that a limited number of prefixes can be
accepted from this peer.";
description
"The maximum number of prefixes to accept from
this peer, options to control a warning
threshold, and actions to take. If the limit is
absent, none of these values will be in effect.";
ngcliext:parent-fmt "^$%";
leaf limit {
type uint32;
mandatory true;
description
"Maximum number of prefixes to accept from
this peer.";
ngcliext:node-fmt "$< $% @@$n";
}
leaf warning-threshold {
type uint8;
description
"Threshold percentage at which a marning
message is generate.";
ngcliext:node-fmt "$< threshold @@$n";
}
choice action-control {
description
"An action to take after the limit is exceeded.";
leaf warning-only {
type boolean;
description
"Only issue warning messages when the limit is
exceeded.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|$< $%$n";
}
leaf restart-interval {
type uint16;
description
"After limit is exceeded, restart BGP
connection. Restart interval in minutes.";
ngcliext:node-fmt "$< restart @@$n";
}
}
}
leaf next-hop-self {
type boolean;
description
"If true, disable the next hop calculation for
this neighbor.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^$%$n";
}
leaf next-hop-self-force {
type boolean;
description
"If true, set the next hop to self for reflected
routes.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^next-hop-self force$n";
}
leaf prefix-list-in {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngfrr:prefix-lists/ngfrr:list"
+ "/ngfrr:name";
}
description
"If present, this is the name of the 'in' prefix
list used to filter incoming updates.";
ngcliext:node-fmt "^prefix-list @@ in$n";
}
leaf prefix-list-out {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngfrr:prefix-lists/ngfrr:list"
+ "/ngfrr:name";
}
description
"If present, this is the name of the 'out' prefix
list used to filter outgoing updates.";
ngcliext:node-fmt "^prefix-list @@ out$n";
}
container remove-private-as {
presence
"Present if a bare 'remove-private-as' applies to
indicate private ASNs in outbound updates should
be removed.";
ngcliext:node-op "test-set:@{all}@{replace-as}";
ngcliext:node-fmt "^$%$n|";
ngcliext:parent-fmt "^$%";
leaf all {
type boolean;
description
"Apply to all AS numbers.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|$< all$n";
}
leaf replace-as {
type boolean;
description
"Replace private ASNs with our ASN in outbound
updates.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|$< replace-AS$n";
}
}
leaf route-map-in {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngfrr:route-maps"
+ "/ngfrr:map"
+ "/ngfrr:name";
}
description
"The name of a route-map to apply to incoming
routes.";
ngcliext:node-fmt "^route-map @@ in$n";
}
leaf route-map-out {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngfrr:route-maps"
+ "/ngfrr:map"
+ "/ngfrr:name";
}
description
"The name of a route-map to apply to outbound
routes.";
ngcliext:node-fmt "^route-map @@ out$n";
}
leaf route-reflector-client {
type boolean;
description
"Configure this neighbor as a Route Reflector
client.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^$%$n";
}
leaf route-server-client {
type boolean;
description
"Configure this neighbor as a Route Server
client.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^$%$n";
}
container send-community {
ngcliext:parent-fmt "^$%";
description
"Send 'standard', 'large' or 'extended' community
attributes. The default is all.";
leaf standard {
type boolean;
default true;
description
"Send standard community attributes.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|$< $%$n";
}
leaf large {
type boolean;
default true;
description
"Send large community attributes.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|$< $%$n";
}
leaf extended {
type boolean;
default true;
description
"Send extended community attributes.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|$< $%$n";
}
}
leaf soft-reconfiguration-inbound {
type boolean;
description
"Allow inbound soft reconfiguration for this
neighbor.";
ngcliext:node-op "bool";
ngcliext:node-fmt "|^soft-reconfiguration inbound$n";
}
leaf unsuppress-route-map {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngfrr:route-maps"
+ "/ngfrr:map"
+ "/ngfrr:name";
}
description
"The name of a route map to use to selectively
unspress otherwise suppressed routes.";
ngcliext:node-fmt "^unsuppress-map @@$n";
}
leaf weight {
type uint16;
description
"Set default weight for routes from this
neighbor.";
ngcliext:node-fmt "^$% @@$n";
}
}
}
grouping bgp-ipv4-network-announcements {
description
"This is the list of networks that will be announced to
each neighbor. It is a list of IPv4 networks and
attributes.";
list network {
key ip-prefix;
description
"The list of announced networks.";
ngcliext:parent-fmt "^$% @{ip-prefix}";
leaf ip-prefix {
type inet:ipv4-prefix;
description
"The announced IPv4 prefix";
}
container announcement {
presence
"If present, this network announcement is present
and configured.";
ngcliext:parent-fmt "$<";
ngcliext:node-op "test-set:@{route-map-name}@{backdoor}";
ngcliext:node-fmt "$<$n|${route-map-name}${backdoor}";
leaf route-map-name {
type leafref {
path "/ngrt:route-config"
+ "/ngrt:dynamic"
+ "/ngfrr:route-maps"
+ "/ngfrr:map"
+ "/ngfrr:name";
}
description
"An optional route map name used to modify
attributes.";
ngcliext:child-fmt "$< route-map @@$n";
}
leaf backdoor {
type boolean;