iwd.network.rst (20833B)
1 ============= 2 iwd.network 3 ============= 4 5 ----------------------------------------- 6 Network configuration for wireless daemon 7 ----------------------------------------- 8 9 :Author: Marcel Holtmann <marcel@holtmann.org> 10 :Author: Denis Kenzior <denkenz@gmail.com> 11 :Author: Andrew Zaborowski <andrew.zaborowski@intel.com> 12 :Author: Tim Kourt <tim.a.kourt@linux.intel.com> 13 :Author: James Prestwood <prestwoj@gmail.com> 14 :Copyright: 2013-2019 Intel Corporation 15 :Version: iwd 16 :Date: 22 September 2019 17 :Manual section: 5 18 :Manual group: Linux Connectivity 19 20 SYNOPSIS 21 ======== 22 23 Network configuration files ``.open``, ``.psk`` and ``.8021x`` 24 25 DESCRIPTION 26 =========== 27 28 **iwd** stores information on known networks, and reads information on 29 pre-provisioned networks, from small text configuration files. Those files 30 live in the state directory specified by the environment variable 31 *$STATE_DIRECTORY*, which is normally provided by **systemd**. In the absence 32 of such an environment variable it defaults to *$LIBDIR/iwd*, which normally 33 is set to */var/lib/iwd*. You can create, modify or remove those files. 34 **iwd** monitors the directory for changes and will update its state 35 accordingly. **iwd** will also modify these files in the course of network 36 connections or as a result of D-Bus API invocations. 37 38 FILE FORMAT 39 =========== 40 41 The syntax is similar to that of GNOME keyfile syntax (which is based on the 42 format defined in the Desktop Entry Specification, see 43 *http://freedesktop.org/Standards/desktop-entry-spec*). The recognized groups 44 as well as keys and values in each group are documented here. Defaults are 45 written in bold. 46 47 For completeness we include the description of the file syntax here. This is 48 the syntax that the ell library's l_settings class implements. The syntax is 49 based on lines and lines are delimited by newline characters. 50 51 Empty lines are ignored and whitespace at the beginning of a line is ignored. 52 Comment lines have ``#`` as their first non-whitespace character. 53 54 Key-value lines contain a setting key, an equal sign and the value of the 55 setting. Whitespace preceding the key, the equal sign or the value, is 56 ignored. The key must be a continuous string of alphanumeric and underscore 57 characters and minus signs only. The value starts at the first non-whitespace 58 character after the first equal sign on the line and ends at the end of the 59 line and must be correctly UTF-8-encoded. A boolean value can be ``true`` or 60 ``false`` but ``0`` or ``1`` are also allowed. Integer values are written 61 in base 10. String values, including file paths and hexstrings, are written 62 as is except for five characters that may be backslash-escaped: space, 63 ``\t``, ``\r``, ``\n`` and backslash itself. The latter three must be 64 escaped. A space character must be escaped if it is the first character 65 in the value string and is written as ``\s``. 66 67 Settings are interpreted depending on the group they are in. A group starts 68 with a group header line and contains all settings until the next group's 69 header line. A group header line contains a ``[`` character followed by 70 the group name and a ``]`` character. Whitespace is allowed before the 71 ``[`` and after the ``]``. A group name consists of printable characters 72 other than ``[`` and ``]``. 73 74 If a group name starts with the ``@`` sign, that group's content is handled 75 by a parser extension instead and does not cause the previous non-extension 76 group to end. The initial ``@`` sign must be followed by a non-empty 77 extension name, another ``@`` sign and a group name as defined above. The 78 extension name consists of printable characters other than ``@``. No 79 whitespace is allowed after the group header in this case. The extension 80 payload syntax and length are determined by the extension name. Normal 81 parsing rules defined in this section resume at the end of the payload and 82 any settings after the end of the payload are handled as part of the previous 83 non-extension group. 84 85 Currently the only extension supported is named pem and allows embedding the 86 contents of a single RFC7468 PEM-formatted payload or a sequence of multiple 87 PEM payloads. The payload should start with the ``-----BEGIN`` string on a 88 line following the group header line and end with an ``-----END`` line as 89 specified in the RFC. Newline characters before, between and after PEM 90 payloads are included in the extension payload. No other extra characters 91 are allowed. 92 93 NAMING 94 ====== 95 96 File names are based on the network's SSID and security type: Open, 97 PSK-protected or 802.1x. The name consist of the encoding of the SSID 98 followed by ``.open``, ``.psk`` or ``.8021x``. The SSID appears verbatim 99 in the name if it contains only alphanumeric characters, spaces, underscores 100 or minus signs. Otherwise it is encoded as an equal sign followed by the 101 lower-case hex encoding of the name. 102 103 SETTINGS 104 ======== 105 106 The settings below are split into several sections and grouped into broad 107 categories. Each category has a group associated with it which is given at 108 the beginning of each sub-section. Recognized keys and valid values are listed 109 following the group definition. 110 111 General Settings 112 ---------------- 113 114 The group ``[Settings]`` contains general settings. 115 116 .. list-table:: 117 :header-rows: 0 118 :stub-columns: 0 119 :widths: 20 80 120 :align: left 121 122 * - AutoConnect 123 - Values: **true**, false 124 125 Whether the network can be connected to automatically 126 * - Hidden 127 - Values: true, **false** 128 129 Whether the network is hidden, i.e. its SSID must be included in an 130 active scan request 131 * - AlwaysRandomizeAddress 132 - Values: true, **false** 133 134 If enabled, the MAC address will be fully randomized on each connection. 135 This option is only used if [General].AddressRandomization is set to 136 'network'. See iwd.config. This setting should not be used with 137 [Settings].AddressOverride, if both are set AddressOverride will be used. 138 * - AddressOverride 139 - MAC address string 140 141 Override the MAC address used for connecting to this network. This option 142 is only used if [General].AddressRandomization is set to 'network'. See 143 iwd.config. This setting should not be used with 144 [Settings].AlwaysRandomizeAddress, if both are set AddressOverride will 145 be used. 146 * - TransitionDisable 147 - Values: true, **false** 148 149 If enabled, the use of TKIP pairwise cipher and connections without 150 Management Frame Protection are disallowed. This will make certain 151 legacy access points unavailable for use. Additional security hardening 152 can also be applied via the [Settings].DisabledTransitionModes setting. 153 154 Properly configured Access Points will typically update this setting 155 appropriately via Transition Disable indications. User customization 156 of this value is thus typically not required. 157 * - DisabledTransitionModes 158 - Comma-separated list of disabled transition modes: 159 160 * personal 161 * enterprise 162 * open 163 164 If 'personal' mode is disabled, then legacy WPA2-Personal access points 165 are no longer available to be connected to or roamed to. Only access 166 points utilizing WPA3-Personal will be considered. 167 168 If 'enterprise' mode is disabled, then legacy WPA2-Enterprise access 169 points are no longer available to be connected to or roamed to. 170 171 If 'open' mode is disabled, then non-OWE enabled access points will 172 not be connected to. 173 174 Properly configured Access Points will typically update this setting 175 appropriately via Transition Disable indications. User customization 176 of this value is thus typically not required. 177 * - UseDefaultEccGroup 178 - Values: true, false 179 180 Forces the use of the default ECC group (19) for protocols using ECC 181 (WPA3 and OWE) if set true. If unset IWD will learn the capabilities of 182 the network based on its initial association and retain that setting for 183 the duration of its process lifetime. 184 185 Network Authentication Settings 186 ------------------------------- 187 188 The group ``[Security]`` contains settings for Wi-Fi security and 189 authentication configuration. This group can be encrypted by enabling 190 ``SystemdEncrypt``, see *iwd.config* for details on this option. If this 191 section is encrypted (only contains EncryptedSalt/EncryptedSecurity) it should 192 not be modified. Modifying these values will result in the inability to 193 connect to that network. 194 195 .. list-table:: 196 :header-rows: 0 197 :stub-columns: 0 198 :widths: 20 80 199 :align: left 200 201 * - Passphrase 202 - 8..63 character string 203 204 Passphrase to be used when connecting to WPA-Personal networks. 205 Required when connecting to WPA3-Personal (SAE) networks. Also 206 required if the *PreSharedKey* is not provided. If not provided in 207 settings, the agent will be asked for the passphrase at connection 208 time. 209 * - PasswordIdentifier 210 - string 211 212 An identifier string to be used with the passphrase. This is used for 213 WPA3-Personal (SAE) networks if the security has enabled password 214 identifiers for clients. 215 * - PreSharedKey 216 - 64 character hex string 217 218 Processed passphrase for this network in the form of a hex-encoded 32 219 byte pre-shared key. Must be provided if *Passphrase* is omitted. 220 * - EAP-Method 221 - one of the following methods: 222 223 AKA, AKA', MSCHAPV2, PEAP, PWD, SIM, TLS, TTLS. 224 225 The following additional methods are allowed as TTLS/PEAP inner 226 methods: 227 228 GTC, MD5. 229 * - EAP-Identity 230 - string 231 232 Identity string transmitted in plaintext. Depending on the EAP method, 233 this value can be optional or mandatory. GTC, MD5, MSCHAPV2, PWD 234 require an identity, so if not provided, the agent will be asked for it 235 at connection time. TLS based methods (PEAP, TLS, TTLS) might still 236 require an *EAP-Identity* to be set, depending on the RADIUS server 237 configuration. 238 * - EAP-Password 239 - string 240 241 Password to be provided for WPA-Enterprise authentication. If not 242 provided, the agent will be asked for the password at connection time. 243 Required by: GTC, MD5, MSCHAPV2, PWD. 244 * - EAP-Password-Hash 245 - hex string 246 247 Some EAP methods can accept a pre-hashed version of the password. For 248 MSCHAPV2, a MD4 hash of the password can be given here. 249 * - | EAP-TLS-CACert, 250 | EAP-TTLS-CACert, 251 | EAP-PEAP-CACert 252 - absolute file path or embedded pem 253 254 Path to a PEM-formatted X.509 root certificate list to use for trust 255 verification of the authenticator. The authenticator's server's 256 certificate chain must be verified by at least one CA in the list for 257 the authentication to succeed. If omitted, then authenticator's 258 certificate chain will not be verified (not recommended.) 259 * - EAP-TLS-ClientCert 260 - absolute file path or embedded pem 261 262 Path to the client X.509 certificate or certificate chain to send on 263 server request. 264 * - EAP-TLS-ClientKey 265 - absolute file path or embedded pem 266 267 Path to the client private key corresponding to the public key provided 268 in *EAP-TLS-ClientCert*. The recommended format is PKCS#8 PEM. 269 * - EAP-TLS-ClientKeyBundle 270 - absolute file path 271 272 As an alternative to *EAP-TLS-ClientCert* and *EAP-TLS-ClientKey* IWD 273 can load both the certificate and the private key from a container file 274 pointed by this setting. The recommended format is PKCS#12 when this 275 is used. 276 * - | EAP-TLS- 277 | ClientKeyPassphrase 278 - string 279 280 Decryption key for the client key files. This should be used if the 281 certificate or the private key in the files mentioned above is encrypted. 282 When not given, the agent is asked for the passphrase at connection time. 283 * - | EAP-TLS-ServerDomainMask, 284 | EAP-TTLS-ServerDomainMask, 285 | EAP-PEAP-ServerDomainMask 286 - string 287 288 A mask for the domain names contained in the server's certificate. At 289 least one of the domain names present in the certificate's Subject 290 Alternative Name extension's DNS Name fields or the Common Name has to 291 match at least one mask, or authentication will fail. Multiple masks 292 can be given separated by semicolons. The masks are split into segments 293 at the dots. Each segment has to match its corresponding label in the 294 domain name. An asterisk segment in the mask matches any label. An 295 asterisk segment at the beginning of the mask matches one or more 296 consecutive labels from the beginning of the domain string. 297 * - | EAP-TLS-FastReauthentication, 298 | EAP-TTLS-FastReauthentication, 299 | EAP-PEAP-FastReauthentication, 300 - Values: **true**, false 301 302 Controls whether TLS session caching for EAP-TLS, EAP-TTLS and EAP-PEAP 303 is used. This allows for faster re-connections to EAP-Enterprise based 304 networks. 305 306 Some network authenticators may be misconfigured in a way that TLS 307 session resumption is allowed but actually attempting it will cause 308 the EAP method to fail or time out. In that case, assuming the 309 credentials and other settings are correct, every other connection 310 attempt will fail as sessions are cached and forgotten in alternating 311 attempts. Use this setting to disable caching for this network. 312 * - | EAP-TTLS-Phase2-Method 313 - | The following values are allowed: 314 | Tunneled-CHAP, 315 | Tunneled-MSCHAP, 316 | Tunneled-MSCHAPv2, 317 | Tunneled-PAP or 318 | a valid EAP method name (see *EAP-Method*) 319 320 Phase 2 authentication method for EAP-TTLS. Can be either one of the 321 TTLS-specific non-EAP methods (Tunneled-\*), or any EAP method 322 documented here. The following two settings are used if any of the 323 non-EAP methods is used. 324 * - | EAP-TTLS-Phase2-Identity 325 - The secure identity/username string for the TTLS non-EAP Phase 2 326 methods. If not provided **iwd** will request a username at connection 327 time. 328 * - | EAP-TTLS-Phase2-Password 329 - Password string for the TTLS non-EAP Phase 2 methods. If not provided 330 IWD will request a passphrase at connection time. 331 * - EAP-TTLS-Phase2-* 332 - Any settings to be used for the inner EAP method if one was specified 333 as *EAP-TTLS-Phase2-Method*, rather than a TTLS-specific method. The 334 prefix *EAP-TTLS-Phase2-* replaces the *EAP-* prefix in the setting 335 keys and their usage is unchanged. Since the inner method's 336 negotiation is encrypted, a secure identity string can be provided. 337 * - EAP-PEAP-Phase2-* 338 - Any settings to be used for the inner EAP method with EAP-PEAP as the 339 outer method. The prefix *EAP-PEAP-Phase2-* replaces the *EAP-* prefix 340 in the setting keys and their usage is unchanged. Since the inner 341 method's negotiation is encrypted, a secure identity string can be 342 provided. 343 344 Network Configuration Settings 345 ------------------------------ 346 347 The group ``[Network]`` contains general network settings and any network 348 specific overrides for global defaults defined in the main iwd configuration 349 file. 350 351 .. list-table:: 352 :header-rows: 0 353 :stub-columns: 0 354 :widths: 20 80 355 :align: left 356 357 * - MulticastDNS 358 - Values: true, false, resolve 359 360 Configures multicast DNS for this network. If not specified, 361 systemd-resolved's default value will remain untouched. 362 See ``man 5 systemd.network`` for details. 363 364 Only applies when ``NameResolvingService=systemd``. 365 366 The group ``[IPv4]`` contains settings for Internet Protocol version 4 (IPv4) 367 network configuration with the static addresses. 368 369 .. list-table:: 370 :header-rows: 0 371 :stub-columns: 0 372 :widths: 20 80 373 :align: left 374 375 * - Address 376 - IPv4 address string 377 378 The IPv4 address to assign. This field is `required` for the static 379 configuration. 380 * - Gateway 381 - IPv4 address string 382 383 The IPv4 address of the gateway (router). This field is `required` for 384 the static configuration. 385 * - DNS 386 - IPv4 address string list, space delimited 387 388 The IPv4 address(es) of the Domain Name System (DNS). This field is 389 `optional`. DNS setting can be used to override the DNS entries received 390 from the DHCP server. 391 * - Netmask 392 - IPv4 address string 393 394 The IPv4 address of the subnet. This field is `optional`. 255.255.255.0 395 is used as default Netmask. 396 * - Broadcast 397 - IPv4 address string 398 399 The IPv4 address to be used for the broadcast. This field is `optional`. 400 * - DomainName 401 - string 402 403 The DomainName is the name of the local Internet domain. This field is 404 `optional`. DomainName setting can be used to override the DomainName 405 value obtained from the DHCP server. 406 407 * - SendHostname 408 - Values: true, **false** 409 410 Configures DHCP to include the hostname in the request. This setting 411 is disabled by default. 412 413 The group ``[IPv6]`` contains settings for Internet Protocol version 6 (IPv6) 414 network configuration. 415 416 .. list-table:: 417 :header-rows: 0 418 :stub-columns: 0 419 :widths: 20 80 420 :align: left 421 422 * - Enabled 423 - Boolean 424 425 Whether IPv6 is enabled for this network. If not provided, then the 426 global default provided by [Network].EnableIPv6 setting will be used. 427 If IPv6 is disabled, then the 'disable_ipv6' setting in sysfs will be 428 set to 1 and no IPv6 addresses or routes will be created for this 429 network. 430 * - Address 431 - IPv6 address string 432 433 The IPv6 address to assign. This field is `required` for the static 434 configuration. The recognized format is according to inet_pton 435 followed by '/' and prefix length. If prefix length is omitted, then 436 128 is assumed. 437 * - Gateway 438 - IPv6 address string 439 440 The IPv6 address of the gateway (router). This field is `required` for 441 the static configuration. 442 * - DNS 443 - IPv6 address string list, space delimited 444 445 The IPv6 address(es) of the Domain Name System (DNS). This field is 446 `optional`. DNS setting can be used to override the DNS entries received 447 from the DHCPv6 server or via Router Advertisements. 448 * - DomainName 449 - string 450 451 The DomainName is the name of the local Internet domain. This field is 452 `optional`. DomainName setting can be used to override the DomainName 453 value obtained from the DHCPv6 server or via Router Advertisements. 454 455 456 Embedded PEMs 457 ------------- 458 459 Rather than including an absolute path to a PEM file (for certificates and 460 keys), the PEM itself can be included inside the settings file and referenced 461 directly. This allows IEEE 802.1x network provisioning using a single file 462 without any references to certificates or keys on the system. 463 464 An embedded PEM can appear anywhere in the settings file using the following 465 format (in this example the PEM is named 'my_ca_cert'): 466 467 .. code-block:: 468 469 [@pem@my_ca_cert] 470 ----- BEGIN CERTIFICATE ----- 471 <PEM data> 472 ----- END CERTIFICATE ----- 473 474 After this special group tag it's as simple as pasting in a PEM file including 475 the BEGIN/END tags. Now 'my_ca_cert' can be used to reference the certificate 476 elsewhere in the settings file by prefixing the value with 'embed:' 477 478 EAP-TLS-CACert=embed:my_ca_cert 479 480 This is not limited to CA Certificates either. Client certificates, client keys 481 (encrypted or not), and certificate chains can be included. 482 483 EXAMPLES 484 ======== 485 486 The following are some examples of common configurations 487 488 Open Network (Hidden) 489 --------------------- 490 491 .. code-block:: 492 493 [Settings] 494 Hidden=true 495 496 Pre-Shared Key (PSK) 497 -------------------- 498 499 .. code-block:: 500 501 [Security] 502 Passphrase=secret123 503 504 PWD 505 --- 506 507 .. code-block:: 508 509 [Security] 510 EAP-Method=PWD 511 EAP-Identity=user@domain.com 512 EAP-Password=secret123 513 514 TLS 515 --- 516 517 .. code-block:: 518 519 [Security] 520 EAP-Method=TLS 521 EAP-TLS-ClientCert=/certs/client-cert.pem 522 EAP-TLS-ClientKey=/certs/client-key.pem 523 EAP-TLS-CACert=/certs/ca-cert.pem 524 EAP-TLS-ServerDomainMask=*.domain.com 525 526 TTLS + PAP 527 ---------- 528 529 .. code-block:: 530 531 [Security] 532 EAP-Method=TTLS 533 EAP-Identity=open@identity.com 534 EAP-TTLS-CACert=/certs/ca-cert.pem 535 EAP-TTLS-Phase2-Method=Tunneled-PAP 536 EAP-TTLS-Phase2-Identity=username 537 EAP-TTLS-Phase2-Password=password 538 EAP-TTLS-ServerDomainMask=*.domain.com 539 540 PEAP + MSCHAPv2 541 --------------- 542 543 .. code-block:: 544 545 [Security] 546 EAP-Method=PEAP 547 EAP-Identity=open@identity.com 548 EAP-PEAP-CACert=/certs/ca-cert.pem 549 EAP-PEAP-Phase2-Method=MSCHAPV2 550 EAP-PEAP-Phase2-Identity=username 551 EAP-PEAP-Phase2-Password=password 552 EAP-PEAP-ServerDomainMask=*.domain.com 553 554 SEE ALSO 555 ======== 556 557 iwd(8), iwd.config(5)