You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Introduced a new network type: WireGuard.
- Updated network type definitions and handling in various components.
- Implemented the `nicWireguard` device type for managing WireGuard interfaces.
- Added validation and configuration logic for WireGuard networks.
- Enhanced network loading and management to include WireGuard functionality.
This update allows users to create and manage WireGuard networks within the system, expanding the networking capabilities significantly.
Signed-off-by: Salem Yaslem <[email protected]>
Copy file name to clipboardExpand all lines: doc/reference/devices_nic.md
+94Lines changed: 94 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@ The following NICs can be added using the `nictype` or `network` options:
53
53
The following NICs can be added using only the `network` option:
54
54
55
55
-[`ovn`](nic-ovn): Uses an existing OVN network and creates a virtual device pair to connect the instance to it.
56
+
-[`wireguard`](nic-wireguard): Uses an existing WireGuard network and creates a routed connection to it.
56
57
57
58
The following NICs can be added using only the `nictype` option:
58
59
@@ -294,6 +295,37 @@ NIC devices of type `p2p` have the following device options:
294
295
You can select this NIC type only through the `nictype` option.
295
296
```
296
297
298
+
A `routed` NIC creates a virtual device pair to connect the host to the instance and sets up static routes and proxy ARP/NDP entries to allow the instance to join the network of a designated parent interface.
299
+
300
+
(nic-wireguard)=
301
+
### `nictype`: `wireguard`
302
+
303
+
```{note}
304
+
You can select this NIC type only through the `network` option (see {ref}`network-wireguard` for information about the managed `wireguard` network).
305
+
```
306
+
307
+
A `wireguard` NIC connects an instance to a WireGuard VPN network.
308
+
The instance will automatically receive an IP address from the WireGuard network's address range if not manually specified.
309
+
310
+
WireGuard operates at layer 3 (network layer), making it suitable for secure VPN connections between instances and remote peers.
311
+
312
+
#### Device options
313
+
314
+
NIC devices of type `wireguard` have the following device options:
315
+
316
+
% Include content from [config_options.txt](../config_options.txt)
317
+
```{include} ../config_options.txt
318
+
:start-after: <!-- config group devices-nic_wireguard start -->
319
+
:end-before: <!-- config group devices-nic_wireguard end -->
320
+
```
321
+
322
+
(nic-routed)=
323
+
### `nictype`: `routed`
324
+
325
+
```{note}
326
+
You can select this NIC type only through the `nictype` option.
327
+
```
328
+
297
329
A `routed` NIC creates a virtual device pair to connect the host to the instance and sets up static routes and proxy ARP/NDP entries to allow the instance to join the network of a designated parent interface.
298
330
For containers it uses a virtual Ethernet device pair, and for VMs it uses a TAP device.
299
331
@@ -359,6 +391,68 @@ NIC devices of type `routed` have the following device options:
359
391
360
392
## `bridged`, `macvlan` or `ipvlan` for connection to physical network
361
393
394
+
The `bridged`, `macvlan` and `ipvlan` interface types can be used to connect to an existing physical network.
395
+
However, it differs from `ipvlan` because it does not need IPVLAN support in the kernel, and the host and the instance can communicate with each other.
396
+
397
+
This NIC type respects `netfilter` rules on the host and uses the host's routing table to route packets, which can be useful if the host is connected to multiple networks.
398
+
399
+
IP addresses, gateways and routes
400
+
: You must manually specify the IP addresses (using `ipv4.address` and/or `ipv6.address`) before the instance is started.
401
+
402
+
For containers, the NIC configures the following link-local gateway IPs on the host end and sets them as the default gateways in the container's NIC interface:
403
+
404
+
169.254.0.1
405
+
fe80::1
406
+
407
+
For VMs, the gateways must be configured manually or via a mechanism like `cloud-init` (see the {ref}`how to guide <instances-routed-nic-vm>`).
408
+
409
+
```{note}
410
+
If your container image is configured to perform DHCP on the interface, it will likely remove the automatically added configuration.
411
+
In this case, you must configure the IP addresses and gateways manually or via a mechanism like `cloud-init`.
412
+
```
413
+
414
+
The NIC type configures static routes on the host pointing to the instance's `veth` interface for all of the instance's IPs.
415
+
416
+
Multiple IP addresses
417
+
: Each NIC device can have multiple IP addresses added to it.
418
+
419
+
However, it might be preferable to use multiple `routed` NIC interfaces instead.
420
+
In this case, set the `ipv4.gateway` and `ipv6.gateway` values to `none` on any subsequent interfaces to avoid default gateway conflicts.
421
+
Also consider specifying a different host-side address for these subsequent interfaces using `ipv4.host_address` and/or `ipv6.host_address`.
422
+
423
+
Parent interface
424
+
: This NIC can operate with and without a `parent` network interface set.
425
+
426
+
: With the `parent` network interface set, proxy ARP/NDP entries of the instance's IPs are added to the parent interface, which allows the instance to join the parent interface's network at layer 2.
427
+
: To enable this, the following network configuration must be applied on the host via `sysctl`:
428
+
429
+
- When using IPv4 addresses:
430
+
431
+
```
432
+
net.ipv4.conf.<parent>.forwarding=1
433
+
```
434
+
435
+
- When using IPv6 addresses:
436
+
437
+
```
438
+
net.ipv6.conf.all.forwarding=1
439
+
net.ipv6.conf.<parent>.forwarding=1
440
+
net.ipv6.conf.all.proxy_ndp=1
441
+
net.ipv6.conf.<parent>.proxy_ndp=1
442
+
```
443
+
444
+
#### Device options
445
+
446
+
NIC devices of type `routed` have the following device options:
447
+
448
+
% Include content from [config_options.txt](../config_options.txt)
449
+
```{include} ../config_options.txt
450
+
:start-after: <!-- config group devices-nic_routed start -->
451
+
:end-before: <!-- config group devices-nic_routed end -->
452
+
```
453
+
454
+
## `bridged`, `macvlan` or `ipvlan` for connection to physical network
455
+
362
456
The `bridged`, `macvlan` and `ipvlan` interface types can be used to connect to an existing physical network.
363
457
364
458
`macvlan` effectively lets you fork your physical NIC, getting a second interface that is then used by the instance.
0 commit comments