iwd.network(5)
πΈ iwd.network β network configuration for the wireless daemon πΈ
okay bestie, so this is iwd.network(5), and honestly? it's giving "tiny text files run the whole wireless world" energy. it's part of Linux Connectivity, and we're about to get into it fr fr.
β¨ NAME β¨
iwd.network β network configuration for the wireless daemon π
π SYNOPSIS π
Network configuration files .open, .psk and .8021x
π DESCRIPTION π
so here's the tea: iwd stores info about networks it knows, and it reads info about pre-provisioned networks, out of these lil text configuration files. tiny files, big main character energy.
those files live in the state directory that the environment variable $STATE_DIRECTORY points at β which is normally handed to you by systemd. if that environment variable isn't there, it defaults to $LIBDIR/iwd, which normally is set to /var/lib/iwd. π
and yes, you can absolutely create, modify or remove those files yourself β iwd monitors the directory for changes and will update its state accordingly. it's watching π. also, iwd will modify these files itself in the course of network connections, or as a result of D-Bus API invocations. so they're kind of a two-way street, no cap.
π¦ FILE FORMAT π¦
the syntax is similar to that of GNOME keyfile syntax β which is itself based on the format defined in the Desktop Entry Specification (see http://freedesktop.org/Standards/desktop-entry-spec). the recognized groups, plus the keys and values inside each group, are documented here. defaults are written in bold.
for completeness, we include the description of the file syntax right here. this is the syntax that the ell library's l_settings class implements. it's based on lines, and lines are delimited by newline characters.
π§ the basics π§
empty lines are ignored, and whitespace at the beginning of a line is ignored too. comment lines have # as their first non-whitespace character. easy.
key-value lines contain a setting key, an equal sign and the value of the setting. whitespace preceding the key, the equal sign or the value, is ignored. the key must be a continuous string of alphanumeric and underscore characters and minus signs only. the value starts at the first non-whitespace character after the first equal sign on the line and ends at the end of the line, and it must be correctly UTF-8-encoded. π
a boolean value can be true or false, but 0 or 1 are also allowed. integer values are written in base 10. string values β including file paths and hexstrings β are written as is, except for five characters that may be backslash-escaped: space, \t, \r, \n and backslash itself. the latter three must be escaped. a space character must be escaped if it is the first character in the value string, and is written as \s.
π groups, and how they group π
settings are interpreted depending on the group they're in. a group starts with a group header line and contains all settings until the next group's header line. a group header line contains a [ character followed by the group name and a ] character. whitespace is allowed before the [ and after the ]. a group name consists of printable characters other than [ and ].
β the @ extension situation (iykyk) β
if a group name starts with the @ sign, that group's content is handled by a parser extension instead, and it does not cause the previous non-extension group to end. iconic behaviour honestly.
the initial @ sign must be followed by a non-empty extension name, another @ sign and a group name as defined above. the extension name consists of printable characters other than @. no whitespace is allowed after the group header in this case β none, zero, don't even try it π. the extension payload syntax and length are determined by the extension name. normal parsing rules defined in this section resume at the end of the payload, and any settings after the end of the payload are handled as part of the previous non-extension group.
currently the only extension supported is named pem, and it allows embedding the contents of a single RFC7468 PEM-formatted payload or a sequence of multiple PEM payloads. the payload should start with the -----BEGIN string on a line following the group header line and end with an -----END line as specified in the RFC. newline characters before, between and after PEM payloads are included in the extension payload. no other extra characters are allowed.
π NAMING π
file names are based on the network's SSID and security type: Open, PSK-protected or 802.1x. the name consists of the encoding of the SSID followed by .open, .psk or .8021x.
the SSID appears verbatim in the name if it contains only alphanumeric characters, spaces, underscores or minus signs. otherwise it is encoded as an equal sign followed by the lower-case hex encoding of the name. periodt. π₯
π SETTINGS π
the settings below are split into several sections and grouped into broad categories. each category has a group associated with it, and that group is given at the beginning of each sub-section. the recognized keys and valid values are listed following the group definition. stay tuned bestie, there's more coming π«Ά
πΈ General Settings πΈ
okay so the [Settings] group is the general-settings HQ for a network, and these are the knobs you can turn. No skips, bestie β every single one is here π
AutoConnectβ Values:true,false. Whether the network can be connected to automatically. β¨Hiddenβ Values:true,false. Whether the network is hidden, i.e. its SSID must be included in an active scan request. π«£AlwaysRandomizeAddressβ Values:true,false. If enabled, the MAC address will be fully randomized on each connection. This option is only used if[General].AddressRandomizationis set to'network'. Seeiwd.config. This setting should not be used with[Settings].AddressOverride; if both are set,AddressOverridewill be used. πAddressOverrideβ MAC address string. Override the MAC address used for connecting to this network. This option is only used if[General].AddressRandomizationis set to'network'. Seeiwd.config. This setting should not be used with[Settings].AlwaysRandomizeAddress; if both are set,AddressOverridewill be used. πTransitionDisableβ Values:true,false. If enabled, the use of TKIP pairwise cipher and connections without Management Frame Protection are disallowed. This will make certain legacy access points unavailable for use. Additional security hardening can also be applied via the[Settings].DisabledTransitionModessetting. π‘οΈ
Properly configured Access Points will typically update this setting appropriately via Transition Disable indications. User customization of this value is thus typically not required. β¨
DisabledTransitionModesβ Comma-separated list of disabled transition modes:personalenterpriseopen
If personal mode is disabled, then legacy WPA2-Personal access points are no longer available to be connected to or roamed to. Only access points utilizing WPA3-Personal will be considered. π₯
If enterprise mode is disabled, then legacy WPA2-Enterprise access points are no longer available to be connected to or roamed to. π’
If open mode is disabled, then non-OWE enabled access points will not be connected to. πͺ
Properly configured Access Points will typically update this setting appropriately via Transition Disable indications. User customization of this value is thus typically not required. π«
UseDefaultEccGroupβ Values:true,false. Forces the use of the default ECC group (19) for protocols using ECC (WPA3 and OWE) if set true. If unset IWD will learn the capabilities of the network based on its initial association and retain that setting for the duration of its process lifetime. π§
π Network Authentication Settings π
Okay so the [Security] group is where all the Wi-Fi security and authentication configuration lives. This group can be encrypted by enabling SystemdEncrypt β see iwd.config for details on this option.
π¨ Bestie, listen: if this section is encrypted (only containsEncryptedSalt/EncryptedSecurity), do not modify it. Changing these values will result in the inability to connect to that network. Like, do not touch. Periodt. π
Passphraseβ 8..63 character string. The passphrase to use when connecting to WPA-Personal networks. Itβs required when connecting to WPA3-Personal (SAE) networks. Itβs also required if thePreSharedKeyis not provided. If itβs not provided in settings, the agent will be asked for the passphrase at connection time. πβ¨PasswordIdentifierβ string. An identifier string to be used with the passphrase. This is used for WPA3-Personal (SAE) networks if the security has enabled password identifiers for clients. πͺͺPreSharedKeyβ 64 character hex string. The processed passphrase for this network in the form of a hex-encoded 32 byte pre-shared key. Must be provided ifPassphraseis omitted. πEAP-Methodβ one of the following methods:AKA,AKA',MSCHAPV2,PEAP,PWD,SIM,TLS,TTLS. The following additional methods are allowed as TTLS/PEAP inner methods:GTC,MD5. π§EAP-Identityβ string. The identity string transmitted in plaintext. Depending on the EAP method, this value can be optional or mandatory.GTC,MD5,MSCHAPV2,PWDrequire an identity, so if not provided, the agent will be asked for it at connection time. TLS based methods (PEAP,TLS,TTLS) might still require anEAP-Identityto be set, depending on the RADIUS server configuration. π«ΆEAP-Passwordβ string. The password to be provided for WPA-Enterprise authentication. If not provided, the agent will be asked for the password at connection time. Required by:GTC,MD5,MSCHAPV2,PWD. π₯EAP-Password-Hashβ hex string. Some EAP methods can accept a pre-hashed version of the password. ForMSCHAPV2, a MD4 hash of the password can be given here. πEAP-TLS-CACert,EAP-TTLS-CACert,EAP-PEAP-CACertβ absolute file path or embedded pem. Path to a PEM-formatted X.509 root certificate list to use for trust verification of the authenticator. The authenticator's server's certificate chain must be verified by at least one CA in the list for the authentication to succeed. If omitted, then authenticator's certificate chain will not be verified (not recommended.) πEAP-TLS-ClientCertβ absolute file path or embedded pem. Path to the client X.509 certificate or certificate chain to send on server request. πEAP-TLS-ClientKeyβ takes an absolute file path orembedded pemπ. This is the path to the client private key that pairs with the public key you provided inEAP-TLS-ClientCert. The recommended format isPKCS#8 PEM.EAP-TLS-ClientKeyBundleβ takes an absolute file path. As an alternative toEAP-TLS-ClientCertandEAP-TLS-ClientKey, IWD can load both the certificate and the private key from a container file pointed to by this setting. The recommended format isPKCS#12when this is used. πEAP-TLS-ClientKeyPassphraseβ takes astring. This is the decryption key for the client key files. Use it if the certificate or the private key in the files mentioned above is encrypted. When it's not given, the agent is asked for the passphrase at connection time. πEAP-TLS-ServerDomainMask,EAP-TTLS-ServerDomainMask,EAP-PEAP-ServerDomainMaskβ takes astring. This is a mask for the domain names contained in the server's certificate. At least one of the domain names present in the certificate's Subject Alternative Name extension's DNS Name fields or the Common Name has to match at least one mask, or authentication will fail. Multiple masks can be given separated by semicolons. The masks are split into segments at the dots. Each segment has to match its corresponding label in the domain name. An asterisk segment in the mask matches any label. An asterisk segment at the beginning of the mask matches one or more consecutive labels from the beginning of the domain string. π¦EAP-TLS-FastReauthentication,EAP-TTLS-FastReauthentication,EAP-PEAP-FastReauthenticationβ values:true,false. This controls whether TLS session caching for EAP-TLS, EAP-TTLS and EAP-PEAP is used. It allows for faster re-connections to EAP-Enterprise based networks. β¨
β οΈ Real talk, bestie: some network authenticators may be misconfigured in a way that TLS session resumption is allowed but actually attempting it will cause the EAP method to fail or time out. In that case, assuming the credentials and other settings are correct, every other connection attempt will fail as sessions are cached and forgotten in alternating attempts. Use this setting to disable caching for this network.
EAP-TTLS-Phase2-Methodβ Phase 2 authentication method for EAP-TTLS. It can be either one of the TTLS-specific non-EAP methods (Tunneled-*) or any EAP method documented here. The following values are allowed:Tunneled-CHAPTunneled-MSCHAPTunneled-MSCHAPv2Tunneled-PAP- or a valid EAP method name (see
EAP-Method)
The following two settings are used if any of the non-EAP methods is used. π
EAP-TTLS-Phase2-Identityβ the secure identity/username string for the TTLS non-EAP Phase 2 methods. If it's not provided,iwdwill request a username at connection time. π«ΆEAP-TTLS-Phase2-Passwordβ password string for the TTLS non-EAP Phase 2 methods. If it's not provided,IWDwill request a passphrase at connection time. π
okay so these two wildcard entries are the inner-method setup vibe:
EAP-TTLS-Phase2-*β Any settings to be used for the inner EAP method if one was specified asEAP-TTLS-Phase2-Method, rather than a TTLS-specific method. The prefixEAP-TTLS-Phase2-replaces theEAP-prefix in the setting keys and their usage is unchanged. Since the inner method's negotiation is encrypted, a secure identity string can be provided. πEAP-PEAP-Phase2-*β Any settings to be used for the inner EAP method with EAP-PEAP as the outer method. The prefixEAP-PEAP-Phase2-replaces theEAP-prefix in the setting keys and their usage is unchanged. Since the inner method's negotiation is encrypted, a secure identity string can be provided. π«Ά
π Network Configuration Settings
The group [Network] contains general network settings and any network specific overrides for global defaults defined in the main iwd configuration file. π
MulticastDNSβ Values:true,false,resolve. Configures multicast DNS for this network. If not specified, systemd-resolved's default value will remain untouched. Seeman 5 systemd.networkfor details. Only applies whenNameResolvingService=systemd. β¨
The group [IPv4] contains settings for Internet Protocol version 4 (IPv4) network configuration with the static addresses. π’
Addressβ IPv4 address string. The IPv4 address to assign. This field is required for the static configuration. π¬Gatewayβ IPv4 address string. The IPv4 address of the gateway (router). This field is required for the static configuration. πͺDNSβ IPv4 address string list, space delimited. The IPv4 address(es) of the Domain Name System (DNS). This field is optional. DNS setting can be used to override the DNS entries received from the DHCP server. π¦Netmaskβ IPv4 address string. The IPv4 address of the subnet. This field is optional.255.255.255.0is used as default Netmask. πBroadcastβ IPv4 address string. The IPv4 address to be used for the broadcast. This field is optional. π‘DomainNameβ string. TheDomainNameis the name of the local Internet domain. This field is optional.DomainNamesetting can be used to override theDomainNamevalue obtained from the DHCP server. πSendHostnameβ Values:true,false. Configures DHCP to include the hostname in the request. This setting is disabled by default. β
β¨ [IPv6] β¨
okay so the [IPv6] group? Thatβs your Internet Protocol version 6 (IPv6) network configuration corner, bestie. Itβs giving βwe are doing IPv6 today.β π
Enabledβ Boolean β Whether IPv6 is enabled for this network. If not provided, then the global default provided by[Network].EnableIPv6setting will be used. If IPv6 is disabled, then thedisable_ipv6setting in sysfs will be set to1and no IPv6 addresses or routes will be created for this network.Addressβ IPv6 address string β The IPv6 address to assign. This field is required for the static configuration. The recognized format is according toinet_ptonfollowed by/and prefix length. If prefix length is omitted, then128is assumed.Gatewayβ IPv6 address string β The IPv6 address of the gateway (router). This field is required for the static configuration.DNSβ IPv6 address string list, space delimited β The IPv6 address(es) of the Domain Name System (DNS). This field is optional.DNSsetting can be used to override the DNS entries received from the DHCPv6 server or via Router Advertisements.DomainNameβ string β TheDomainNameis the name of the local Internet domain. This field is optional.DomainNamesetting can be used to override theDomainNamevalue obtained from the DHCPv6 server or via Router Advertisements.
π Embedded PEMs π
Rather than including an absolute path to a PEM file (for certificates and keys), the PEM itself can be included inside the settings file and referenced directly. This allows IEEE 802.1x network provisioning using a single file without any references to certificates or keys on the system. obsessed with the convenience tbh π«Ά
An embedded PEM can appear anywhere in the settings file using the following format (in this example the PEM is named my_ca_cert):
[@pem@my_ca_cert]
----- BEGIN CERTIFICATE -----
<PEM data>
----- END CERTIFICATE -----
After this special group tag itβs as simple as pasting in a PEM file including the BEGIN/END tags. Now my_ca_cert can be used to reference the certificate elsewhere in the settings file by prefixing the value with embed::
EAP-TLS-CACert=embed:my_ca_cert
This is not limited to CA Certificates either. Client certificates, client keys (encrypted or not), and certificate chains can be included. literally so flexible β¨
πΈ EXAMPLES πΈ
The following are some examples of common configurations. screenshot these, bestie πΈ
π¦ Open Network (Hidden) π¦
[Settings]
Hidden=true
π¦ Pre-Shared Key (PSK) π¦
[Security]
Passphrase=secret123
π¦ PWD π¦
[Security]
EAP-Method=PWD
EAP-Identity=user@domain.com
EAP-Password=secret123
π¦ TLS π¦
[Security]
EAP-Method=TLS
EAP-TLS-ClientCert=/certs/client-cert.pem
EAP-TLS-ClientKey=/certs/client-key.pem
EAP-TLS-CACert=/certs/ca-cert.pem
EAP-TLS-ServerDomainMask=*.domain.com
π¦ TTLS + PAP π¦
[Security]
EAP-Method=TTLS
EAP-Identity=open@identity.com
EAP-TTLS-CACert=/certs/ca-cert.pem
EAP-TTLS-Phase2-Method=Tunneled-PAP
EAP-TTLS-Phase2-Identity=username
EAP-TTLS-Phase2-Password=password
EAP-TTLS-ServerDomainMask=*.domain.com
π¦ PEAP + MSCHAPv2 π¦
[Security]
EAP-Method=PEAP
EAP-Identity=open@identity.com
EAP-PEAP-CACert=/certs/ca-cert.pem
EAP-PEAP-Phase2-Method=MSCHAPV2
EAP-PEAP-Phase2-Identity=username
EAP-PEAP-Phase2-Password=password
EAP-PEAP-ServerDomainMask=*.domain.com
π SEE ALSO π
π Author π
- Marcel Holtmann
<marcel@holtmann.org> - Denis Kenzior
<denkenz@gmail.com> - Andrew Zaborowski
<andrew.zaborowski@intel.com> - Tim Kourt
<tim.a.kourt@linux.intel.com> - James Prestwood
<prestwoj@gmail.com>
π Copyright π
2013-2019 Intel Corporation
okay bye bestie β this iconic lil page is iwd.network(5) from iwd, dated 22 September 2019 β mwah πβ¨
π¦ where this page comes from
- alpine 3.24: iwd-doc 3.12-r0 Β· LGPL-2.1-or-later
- fedora 44: iwd 3.12-1.fc44 Β· LGPL-2.1-or-later
- nixos 26.05: iwd 3.12
- ubuntu resolute: iwd 3.10-1ubuntu1 Β· LGPL-2.1-or-later
- ubuntu stonking: iwd 3.10-1ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms