-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathsonic-bgp-neighbor.yang
166 lines (138 loc) · 5.19 KB
/
sonic-bgp-neighbor.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
module sonic-bgp-neighbor {
namespace "http://github.com/Azure/sonic-bgp-neighbor";
prefix bgpnbr;
yang-version 1.1;
import ietf-inet-types {
prefix inet;
}
import sonic-bgp-common {
prefix bgpcmn;
}
import sonic-port {
prefix port;
}
import sonic-portchannel {
prefix lag;
}
// Comment sonic-vlan import here until libyang back-links issue is resolved for VLAN leaf reference.
//import sonic-vlan {
// prefix vlan;
//}
import sonic-bgp-global {
prefix bgpg;
}
import sonic-bgp-peergroup {
prefix bgppg;
}
organization
"SONiC";
contact
"SONiC";
description
"SONIC BGP Neighbor";
revision 2021-02-26 {
description
"Initial revision.";
}
container sonic-bgp-neighbor {
container BGP_NEIGHBOR {
list BGP_NEIGHBOR_TEMPLATE_LIST {
description "This list is to support template based BGP neighbor configuration handled by bgpcfgd";
key "neighbor";
leaf neighbor {
type inet:ip-address;
description "BGP Neighbor address";
}
leaf asn {
type uint32 {
range "1..4294967295";
}
description "Peer AS number";
}
leaf holdtime {
type uint16;
description "Hold time";
}
leaf keepalive {
type uint16;
description "Keepalive interval";
}
leaf local_addr {
type inet:ip-address;
description "Local source address or interface name to use for connection.";
}
leaf name {
type string;
description "Peer description";
}
leaf nhopself {
type uint8 {
range "0..1";
}
description "Nexthop is self, no nexthop calculation";
}
leaf rrclient {
type uint8 {
range "0..1";
}
description "Route reflector client";
}
}
list BGP_NEIGHBOR_LIST {
description "This list is to support generic BGP neighbor configuration handled by frrcfgd and
frr_mgmt_framework_config field should be set to true in DEVICE_METADATA talbe for accepting the generic BGP table configurations.";
key "vrf_name neighbor";
leaf vrf_name {
type leafref {
path "/bgpg:sonic-bgp-global/bgpg:BGP_GLOBALS/bgpg:BGP_GLOBALS_LIST/bgpg:vrf_name";
}
description "Network-instance/VRF name";
}
leaf neighbor {
type union {
type inet:ip-address;
type leafref {
path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name";
}
type leafref {
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
}
// Comment VLAN leaf reference here until libyang back-links issue is resolved and use VLAN string pattern
// type leafref {
// path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name";
// }
type string {
pattern 'Vlan([0-9]{1,3}|[1-3][0-9]{3}|[4][0][0-8][0-9]|[4][0][9][0-4])';
}
}
description "BGP Neighbor, it will be neighbor address or interface name";
}
leaf peer_group_name {
type leafref {
path "/bgppg:sonic-bgp-peergroup/bgppg:BGP_PEER_GROUP/bgppg:BGP_PEER_GROUP_LIST[bgppg:vrf_name=current()/../vrf_name]/bgppg:peer_group_name";
}
description "Peer group name";
}
uses bgpcmn:sonic-bgp-cmn;
}
}
container BGP_NEIGHBOR_AF {
list BGP_NEIGHBOR_AF_LIST {
key "vrf_name neighbor afi_safi";
leaf vrf_name {
type leafref {
path "/bgpg:sonic-bgp-global/bgpg:BGP_GLOBALS/bgpg:BGP_GLOBALS_LIST/bgpg:vrf_name";
}
description "Network-instance/VRF name";
}
leaf neighbor {
type leafref {
path "../../../BGP_NEIGHBOR/BGP_NEIGHBOR_LIST[vrf_name=current()/../vrf_name]/neighbor";
}
description "BGP Neighbor, it will be neighbor address or interface name";
}
uses bgpcmn:sonic-bgp-cmn-af;
}
}
}
}