doc: Ethernet provisioning support
[platform/upstream/connman.git] / doc / config-format.txt
1 Connman configuration file format
2 *********************************
3
4 Connman uses configuration files to provision existing services. Connman will
5 be looking for its configuration files at STORAGEDIR which by default points
6 to /var/lib/connman/. Configuration file names must not include other
7 characters than letters or numbers and must have a .config suffix.
8 Those configuration files are text files with a simple format and we typically
9 have one file per provisioned network.
10
11 If the config file is removed, then Connman tries to remove the
12 provisioned service. If individual service entry inside config is removed,
13 then the corresponding provisioned service is removed. If service
14 entry is changed, then corresponding service is removed and then
15 immediately re-provisioned.
16
17
18 Global entry [global]
19 =====================
20
21 These files can have an optional global entry describing the actual file.
22 The 2 allowed fields for that entry are:
23 - Name: Name of the network.
24 - Description: Description of the network.
25 - Protected: Configuration protection against being removed, modified or
26 overwritten by a Manager.ProvisionService() call. If unset, this value defaults
27 to TRUE, i.e. configs are protected by default.
28
29
30 Service entry [service_*]
31 =========================
32
33 Each provisioned service must start with the [service_*] tag. Replace * with
34 an identifier unique to the config file.
35
36 Allowed fields:
37 - Type: Service type. We currently only support wifi and ethernet.
38 - IPv4: The IPv4 address, netmask and gateway. Format of the entry
39   is network/netmask/gateway. The mask length can be used instead
40   of netmask.
41   Example: 192.168.1.2/24/192.168.1.1
42            192.168.200.100/255.255.255.0/192.168.200.1
43 - IPv6: The IPv6 address, prefix length and gateway. Format of the entry
44   is network/prefixlen/gateway. For IPv6 addresses only prefix length is
45   accepted.
46   Example: 2001:db8::2/64/2001:db8::1
47 - IPv6.Privacy: IPv6 privacy option. Value can be either "disabled",
48   "enabled" or "prefered". See use_tempaddr variable description in Linux
49   kernel Documentation/networking/ip-sysctl.txt file.
50 - MAC: MAC address of the interface where this setting should be applied.
51   The MAC address is optional and if it is missing, then the first found
52   interface is used. The byte values must have prefix 0 added,
53   the bytes must be separated by ":" char and its length must be
54   exactly 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 = 17 characters.
55 - Nameservers: Comma separated list of nameservers
56 - SearchDomains: Comma separated list of DNS search domains
57 - Timeservers: Comma separated list of timeservers
58 - Domain: Domain name to be used
59
60 If IPv4 address is missing then DHCP is used. If IPv6 address is missing,
61 then SLAAC or DHCPv6 is used.
62
63 The following options are valid if Type is "wifi"
64 - Name: A string representation of an 802.11 SSID. If the SSID field is
65   present, the Name field is ignored.
66 - SSID: A hexadecimal representation of an 802.11 SSID. If the SSID field is
67   omitted, the Name field is used instead.
68 - EAP: EAP type. We currently only support tls, ttls or peap.
69 - CACertFile: File path to CA certificate file (PEM/DER).
70 - ClientCertFile: File path to client certificate file (PEM/DER).
71 - PrivateKeyFile: File path to client private key file (PEM/DER/PFX).
72 - PrivateKeyPassphrase: Password/passphrase for private key file.
73 - PrivateKeyPassphraseType: We only support the fsid passphrase type for now.
74   This is for private keys generated by using their own filesystem UUID as the
75   passphrase. The PrivateKeyPassphrase field is ignored when this field is set
76   to fsid.
77 - Identity: Identity string for EAP.
78 - Phase2: Phase2 (inner authentication with TLS tunnel) authentication method.
79   Prefix the value with "EAP-" to indicate the usage of an EAP-based inner
80   authentication method (should only be used with EAP = TTLS).
81 - Passphrase: RSN/WPA/WPA2 Passphrase
82 - Hidden: If set to true, then this AP is hidden. If missing or set to false,
83   then AP is not hidden.
84
85
86 Example
87 =======
88
89 This is a configuration file for a network providing EAP-TLS, EAP-TTLS and
90 EAP-PEAP services.
91 The respective SSIDs are tls_ssid, ttls_ssid and peap_ssid and the file name
92 is example.config.
93 Please note that the SSID entry is for hexadecimal encoded SSID (e.g. "SSID =
94 746c735f73736964"). If your SSID does not contain any exotic character then
95 you should use the Name entry instead (e.g. "Name = tls_ssid").
96
97
98 example@example:[~]$ cat /var/lib/connman/example.config
99 [global]
100 Name = Example
101 Description = Example network configuration
102
103 [service_tls]
104 Type = wifi
105 SSID = 746c735f73736964
106 EAP = tls
107 CACertFile = /home/user/.certs/ca.pem
108 ClientCertFile = /home/user/devlp/.certs/client.pem
109 PrivateKeyFile = /home/user/.certs/client.fsid.pem
110 PrivateKeyPassphraseType = fsid
111 Identity = user
112
113 [service_ttls]
114 Type = wifi
115 Name = ttls_ssid
116 EAP = ttls
117 CACertFile = /home/user/.cert/ca.pem
118 Phase2 = MSCHAPV2
119 Identity = user
120
121 [service_peap]
122 Type = wifi
123 Name = peap_ssid
124 EAP = peap
125 CACertFile = /home/user/.cert/ca.pem
126 Phase2 = MSCHAPV2
127 Identity = user
128
129 [service_home_ethernet]
130 Type = ethernet
131 IPv4 = 192.168.1.42/255.255.255.0/192.168.1.1
132 IPv6 = 2001:db8::42/64/2001:db8::1
133 MAC = 01:02:03:04:05:06
134 Nameservers = 10.2.3.4,192.168.1.99
135 SearchDomains = my.home,isp.net
136 Timeservers = 10.172.2.1,ntp.my.isp.net
137 Domain = my.home
138
139 [service_home_wifi]
140 Type = wifi
141 Name = my_home_wifi
142 Passphrase = secret
143 IPv4 = 192.168.2.2/255.255.255.0/192.168.2.1
144 MAC = 06:05:04:03:02:01