Skip to content

Commit 9d0e910

Browse files
committed
doc: update networking guide with dhcpv6 details
Signed-off-by: Joachim Wiberg <[email protected]>
1 parent c91fc1f commit 9d0e910

File tree

1 file changed

+101
-5
lines changed

1 file changed

+101
-5
lines changed

doc/networking.md

Lines changed: 101 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -959,16 +959,55 @@ Client Configuration](system.md#ntp-client-configuration) section.
959959

960960
Multiple address assignment methods are available:
961961

962-
| **Type** | **Yang Model** | **Description** |
963-
|:---------------- |:-------------- |:------------------------------------------------------------------------------------------------------------------------------------------------- |
964-
| static | ietf-ip | Static assignment of IPv6 address, e.g., *2001:db8:0:1::1/64* |
965-
| link-local | ietf-ip[^2] | (RFC4862) Auto-configured link-local IPv6 address (*fe80::0* prefix + interface identifier, e.g., *fe80::ccd2:82ff:fe52:728b/64*) |
966-
| global auto-conf | ietf-ip | (RFC4862) Auto-configured (stateless) global IPv6 address (prefix from router + interface identifier, e.g., *2001:db8:0:1:ccd2:82ff:fe52:728b/64* |
962+
| **Type** | **Yang Model** | **Description** |
963+
|:---------------- |:-------------------- |:------------------------------------------------------------------------------------------------------------------------------------------------- |
964+
| static | ietf-ip | Static assignment of IPv6 address, e.g., *2001:db8:0:1::1/64* |
965+
| link-local | ietf-ip[^2] | (RFC4862) Auto-configured link-local IPv6 address (*fe80::0* prefix + interface identifier, e.g., *fe80::ccd2:82ff:fe52:728b/64*) |
966+
| global auto-conf | ietf-ip | (RFC4862) Auto-configured (stateless) global IPv6 address (prefix from router + interface identifier, e.g., *2001:db8:0:1:ccd2:82ff:fe52:728b/64* |
967+
| dhcp | infix-dhcpv6-client | Assignment of IPv6 address by DHCPv6 server, e.g., *2001:db8::42/128* |
967968

968969
Both for *link-local* and *global auto-configuration*, it is possible
969970
to auto-configure using a random suffix instead of the interface
970971
identifier.
971972

973+
> [!NOTE]
974+
> The DHCPv6 address method is only available for *LAN* interfaces
975+
> (Ethernet, virtual Ethernet (veth), bridge, link aggregates, etc.)
976+
977+
Supported DHCPv6 (request) options, configurability (Cfg) and defaults,
978+
are listed below. Configurable options can be disabled on a per client
979+
interface basis, some options, like `client-id` and `client-fqdn`, are
980+
possible to set the value of as well.
981+
982+
| **Opt** | **Name** | **Cfg** | **Description** |
983+
|---------|----------------------------|---------|--------------------------------------------------------|
984+
| 1 | `client-id` | Yes | Client identifier (DUID), auto-generated by default |
985+
| 2 | `server-id` | Yes | Server identifier (DUID) |
986+
| 23 | `dns-server` | Yes | DNS recursive name servers, static ones take precedence|
987+
| 24 | `domain-search` | Yes | Domain search list |
988+
| 25 | `ia-pd` | Yes | Prefix delegation for downstream networks |
989+
| 31 | `sntp-server` | Yes | Simple Network Time Protocol servers |
990+
| 32 | `information-refresh-time` | Yes | Refresh time for stateless DHCPv6 |
991+
| 39 | `client-fqdn` | Yes | Client FQDN, request DNS update from server |
992+
| 56 | `ntp-server` | Yes | NTP time servers, static ones take precedence |
993+
| | | | |
994+
995+
**Default:** `dns-server`, `domain-search`, `ntp-server`
996+
997+
DHCPv6 supports both **stateful** (address assignment) and **stateless**
998+
(information-only) modes:
999+
1000+
- **Stateful DHCPv6**: The server assigns IPv6 addresses to clients. This is
1001+
the default mode when enabling the DHCPv6 client.
1002+
- **Stateless DHCPv6**: Used with SLAAC (Stateless Address Autoconfiguration)
1003+
when only configuration information (DNS, NTP, etc.) is needed. Enable with
1004+
the `information-only` setting.
1005+
1006+
When configuring a DHCPv6 client, ensure that the NTP client is enabled
1007+
for the `ntp-server` DHCPv6 option to be processed correctly. If the
1008+
NTP client is not enabled, any NTP servers provided by the DHCPv6 server
1009+
will be ignored. For details on how to enable the NTP client, see the
1010+
[NTP Client Configuration](system.md#ntp-client-configuration) section.
9721011

9731012
### Examples
9741013

@@ -1080,6 +1119,63 @@ Other useful DHCP options include:
10801119

10811120
For advanced usage with vendor-specific options, see the YANG model.
10821121

1122+
#### Use of DHCPv6 for IPv6 address assignment
1123+
1124+
![Using DHCPv6 for IPv6 address assignment](img/ip-address-example-ipv6-dhcp.svg)
1125+
1126+
admin@example:/> configure
1127+
admin@example:/config/> edit interface eth0 ipv6
1128+
admin@example:/config/interface/eth0/ipv6/> set dhcp
1129+
admin@example:/config/interface/eth0/ipv6/> leave
1130+
admin@example:/> show interface
1131+
INTERFACE PROTOCOL STATE DATA
1132+
eth0 ethernet UP 02:00:00:00:00:00
1133+
ipv6 2001:db8::42/128 (dhcp)
1134+
ipv6 fe80::ff:fe00:0/64 (link-layer)
1135+
lo ethernet UP 00:00:00:00:00:00
1136+
ipv4 127.0.0.1/8 (static)
1137+
ipv6 ::1/128 (static)
1138+
admin@example:/>
1139+
1140+
The resulting address (2001:db8::42/128) is of type *dhcp*.
1141+
1142+
To configure DHCPv6 client options, such as requesting prefix delegation
1143+
for downstream networks, you can specify options:
1144+
1145+
```
1146+
admin@example:/> configure
1147+
admin@example:/config/> edit interface eth0 ipv6 dhcp
1148+
admin@example:/config/interface/eth0/ipv6/dhcp/> set option ia-pd
1149+
admin@example:/config/interface/eth0/ipv6/dhcp/> set option dns-server
1150+
admin@example:/config/interface/eth0/ipv6/dhcp/> show
1151+
option dns-server;
1152+
option ia-pd;
1153+
admin@example:/config/interface/eth0/ipv6/dhcp/> leave
1154+
admin@example:/>
1155+
```
1156+
1157+
For stateless DHCPv6 (used with SLAAC to get only configuration information):
1158+
1159+
```
1160+
admin@example:/> configure
1161+
admin@example:/config/> edit interface eth0 ipv6 dhcp
1162+
admin@example:/config/interface/eth0/ipv6/dhcp/> set information-only true
1163+
admin@example:/config/interface/eth0/ipv6/dhcp/> show
1164+
information-only true;
1165+
option dns-server;
1166+
option domain-search;
1167+
admin@example:/config/interface/eth0/ipv6/dhcp/> leave
1168+
admin@example:/>
1169+
```
1170+
1171+
Other useful DHCPv6 options include:
1172+
1173+
- `duid` - Set a specific DHCPv6 Unique Identifier (auto-generated by default)
1174+
- `client-fqdn` - Request the server to update DNS records with client's FQDN
1175+
- `route-preference` - Set the administrative distance for DHCPv6-learned routes (default: 5)
1176+
1177+
For advanced usage with vendor-specific options, see the YANG model.
1178+
10831179
#### Disabling IPv6 link-local address(es)
10841180

10851181
The (only) way to disable IPv6 link-local addresses is by disabling IPv6

0 commit comments

Comments
 (0)