@@ -72,34 +72,249 @@ func (d *nicBridged) validateConfig(instConf instance.ConfigReader) error {
72
72
73
73
var requiredFields []string
74
74
optionalFields := []string {
75
+ // gendoc:generate(entity=devices, group=nic_bridged, key=name)
76
+ //
77
+ // ---
78
+ // type: string
79
+ // default: kernel assigned
80
+ // managed: no
81
+ // shortdesc: The name of the interface inside the instance
75
82
"name" ,
83
+
84
+ // gendoc:generate(entity=devices, group=nic_bridged, key=network)
85
+ //
86
+ // ---
87
+ // type: string
88
+ // managed: no
89
+ // shortdesc: The managed network to link the device to (instead of specifying the `nictype` directly)
76
90
"network" ,
91
+
92
+ // gendoc:generate(entity=devices, group=nic_bridged, key=parent)
93
+ //
94
+ // ---
95
+ // type: string
96
+ // managed: yes
97
+ // shortdesc: The name of the parent host device (required if specifying the `nictype` directly)
77
98
"parent" ,
99
+
100
+ // gendoc:generate(entity=devices, group=nic_bridged, key=mtu)
101
+ //
102
+ // ---
103
+ // type: integer
104
+ // default: MTU of the parent device
105
+ // managed: yes
106
+ // shortdesc: The Maximum Transmit Unit (MTU) of the new interface
78
107
"mtu" ,
108
+
109
+ // gendoc:generate(entity=devices, group=nic_bridged, key=queue.tx.length)
110
+ //
111
+ // ---
112
+ // type: integer
113
+ // managed: no
114
+ // shortdesc: The transmit queue length for the NIC
79
115
"queue.tx.length" ,
116
+
117
+ // gendoc:generate(entity=devices, group=nic_bridged, key=hwaddr)
118
+ //
119
+ // ---
120
+ // type: string
121
+ // default: randomly assigned
122
+ // managed: no
123
+ // shortdesc: The MAC address of the new interface
80
124
"hwaddr" ,
125
+
126
+ // gendoc:generate(entity=devices, group=nic_bridged, key=host_name)
127
+ //
128
+ // ---
129
+ // type: string
130
+ // default: randomly assigned
131
+ // managed: no
132
+ // shortdesc: The name of the interface on the host
81
133
"host_name" ,
134
+
135
+ // gendoc:generate(entity=devices, group=nic_bridged, key=limits.ingress)
136
+ //
137
+ // ---
138
+ // type: string
139
+ // managed: no
140
+ // shortdesc: I/O limit in bit/s for incoming traffic (various suffixes supported, see {ref}instances-limit-units)
82
141
"limits.ingress" ,
142
+
143
+ // gendoc:generate(entity=devices, group=nic_bridged, key=limits.egress)
144
+ //
145
+ // ---
146
+ // type: string
147
+ // managed: no
148
+ // shortdesc: I/O limit in bit/s for outgoing traffic (various suffixes supported, see {ref}instances-limit-units)
83
149
"limits.egress" ,
150
+
151
+ // gendoc:generate(entity=devices, group=nic_bridged, key=limits.max)
152
+ //
153
+ // ---
154
+ // type: string
155
+ // managed: no
156
+ // shortdesc: I/O limit in bit/s for both incoming and outgoing traffic (same as setting both limits.ingress and limits.egress)
84
157
"limits.max" ,
158
+
159
+ // gendoc:generate(entity=devices, group=nic_bridged, key=limits.priority)
160
+ //
161
+ // ---
162
+ // type: integer
163
+ // managed: no
164
+ // shortdesc: The priority for outgoing traffic, to be used by the kernel queuing discipline to prioritize network packets
85
165
"limits.priority" ,
166
+
167
+ // gendoc:generate(entity=devices, group=nic_bridged, key=ipv4.address)
168
+ //
169
+ // ---
170
+ // type: string
171
+ // managed: no
172
+ // shortdesc: An IPv4 address to assign to the instance through DHCP (can be `none` to restrict all IPv4 traffic when `security.ipv4_filtering` is set)
86
173
"ipv4.address" ,
174
+
175
+ // gendoc:generate(entity=devices, group=nic_bridged, key=ipv6.address)
176
+ //
177
+ // ---
178
+ // type: string
179
+ // managed: no
180
+ // shortdesc: An IPv6 address to assign to the instance through DHCP (can be `none` to restrict all IPv6 traffic when `security.ipv6_filtering` is set)
87
181
"ipv6.address" ,
182
+
183
+ // gendoc:generate(entity=devices, group=nic_bridged, key=ipv4.routes)
184
+ //
185
+ // ---
186
+ // type: string
187
+ // managed: no
188
+ // shortdesc: Comma-delimited list of IPv4 static routes to add on host to NIC
88
189
"ipv4.routes" ,
190
+
191
+ // gendoc:generate(entity=devices, group=nic_bridged, key=ipv6.routes)
192
+ //
193
+ // ---
194
+ // type: string
195
+ // managed: no
196
+ // shortdesc: Comma-delimited list of IPv6 static routes to add on host to NIC
89
197
"ipv6.routes" ,
198
+
199
+ // gendoc:generate(entity=devices, group=nic_bridged, key=ipv4.routes.external)
200
+ //
201
+ // ---
202
+ // type: string
203
+ // managed: no
204
+ // shortdesc: Comma-delimited list of IPv4 static routes to route to the NIC and publish on uplink network (BGP)
90
205
"ipv4.routes.external" ,
206
+
207
+ // gendoc:generate(entity=devices, group=nic_bridged, key=ipv6.routes.external)
208
+ //
209
+ // ---
210
+ // type: string
211
+ // managed: no
212
+ // shortdesc: Comma-delimited list of IPv6 static routes to route to the NIC and publish on uplink network (BGP)
91
213
"ipv6.routes.external" ,
214
+
215
+ // gendoc:generate(entity=devices, group=nic_bridged, key=security.mac_filtering)
216
+ //
217
+ // ---
218
+ // type: bool
219
+ // default: false
220
+ // managed: no
221
+ // shortdesc: Prevent the instance from spoofing another instance's MAC address
92
222
"security.mac_filtering" ,
223
+
224
+ // gendoc:generate(entity=devices, group=nic_bridged, key=security.ipv4_filtering)
225
+ //
226
+ // ---
227
+ // type: bool
228
+ // default: false
229
+ // managed: no
230
+ // shortdesc: Prevent the instance from spoofing another instance's IPv4 address (enables `security.mac_filtering`)
231
+
93
232
"security.ipv4_filtering" ,
233
+ // gendoc:generate(entity=devices, group=nic_bridged, key=security.ipv6_filtering)
234
+ //
235
+ // ---
236
+ // type: bool
237
+ // default: false
238
+ // managed: no
239
+ // shortdesc: Prevent the instance from spoofing another instance's IPv6 address (enables `security.mac_filtering`)
94
240
"security.ipv6_filtering" ,
241
+
242
+ // gendoc:generate(entity=devices, group=nic_bridged, key=security.port_isolation)
243
+ //
244
+ // ---
245
+ // type: bool
246
+ // default: false
247
+ // managed: no
248
+ // shortdesc: Prevent the NIC from communicating with other NICs in the network that have port isolation enabled
95
249
"security.port_isolation" ,
250
+
251
+ // gendoc:generate(entity=devices, group=nic_bridged, key=security.acls)
252
+ //
253
+ // ---
254
+ // type: string
255
+ // managed: no
256
+ // shortdesc: Comma-separated list of network ACLs to apply
96
257
"security.acls" ,
258
+
259
+ // gendoc:generate(entity=devices, group=nic_bridged, key=security.acls.default.ingress.action)
260
+ //
261
+ // ---
262
+ // type: string
263
+ // default: drop
264
+ // managed: no
265
+ // shortdesc: Action to use for ingress traffic that doesn't match any ACL rule
97
266
"security.acls.default.ingress.action" ,
267
+
268
+ // gendoc:generate(entity=devices, group=nic_bridged, key=security.acls.default.egress.action)
269
+ //
270
+ // ---
271
+ // type: string
272
+ // default: drop
273
+ // managed: no
274
+ // shortdesc: Action to use for egress traffic that doesn't match any ACL rule
98
275
"security.acls.default.egress.action" ,
276
+
277
+ // gendoc:generate(entity=devices, group=nic_bridged, key=security.acls.default.ingress.logged)
278
+ //
279
+ // ---
280
+ // type: bool
281
+ // default: false
282
+ // managed: no
283
+ // shortdesc: Whether to log ingress traffic that doesn't match any ACL rule
99
284
"security.acls.default.ingress.logged" ,
285
+
286
+ // gendoc:generate(entity=devices, group=nic_bridged, key=security.acls.default.egress.logged)
287
+ //
288
+ // ---
289
+ // type: bool
290
+ // default: false
291
+ // managed: no
292
+ // shortdesc: Whether to log egress traffic that doesn't match any ACL rule
100
293
"security.acls.default.egress.logged" ,
294
+
295
+ // gendoc:generate(entity=devices, group=nic_bridged, key=boot.priority)
296
+ //
297
+ // ---
298
+ // type: integer
299
+ // managed: no
300
+ // shortdesc: Boot priority for VMs (higher value boots first)
101
301
"boot.priority" ,
302
+
303
+ // gendoc:generate(entity=devices, group=nic_bridged, key=vlan)
304
+ //
305
+ // ---
306
+ // type: integer
307
+ // managed: no
308
+ // shortdesc: The VLAN ID to use for non-tagged traffic (can be none to remove port from default VLAN)
102
309
"vlan" ,
310
+
311
+ // gendoc:generate(entity=devices, group=nic_bridged, key=io.bus)
312
+ //
313
+ // ---
314
+ // type: string
315
+ // default: `virtio`
316
+ // managed: no
317
+ // shortdesc: Override the bus for the device (can be `virtio` or `usb`) (VM only)
103
318
"io.bus" ,
104
319
}
105
320
@@ -326,6 +541,13 @@ func (d *nicBridged) validateConfig(instConf instance.ConfigReader) error {
326
541
}
327
542
328
543
// Add bridge specific vlan.tagged validation.
544
+
545
+ // gendoc:generate(entity=devices, group=nic_bridged, key=vlan.tagged)
546
+ //
547
+ // ---
548
+ // type: integer
549
+ // managed: no
550
+ // shortdesc: Comma-delimited list of VLAN IDs or VLAN ranges to join for tagged traffic
329
551
rules ["vlan.tagged" ] = func (value string ) error {
330
552
if value == "" {
331
553
return nil
0 commit comments