| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE stylesheet [ |
| 3 |
<!ENTITY % entities SYSTEM "common.ent" > |
| 4 |
%entities; |
| 5 |
]> |
| 6 |
<xsl:stylesheet version="1.0" |
| 7 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 8 |
|
| 9 |
<xsl:output |
| 10 |
method="xml" |
| 11 |
doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" |
| 12 |
doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" |
| 13 |
/> |
| 14 |
|
| 15 |
<xsl:template match="nm-setting-docs"> |
| 16 |
<refentry id="nm-settings-keyfile"> |
| 17 |
<refentryinfo> |
| 18 |
<title>nm-settings-keyfile</title> |
| 19 |
<author>NetworkManager developers</author> |
| 20 |
</refentryinfo> |
| 21 |
<refmeta> |
| 22 |
<refentrytitle>nm-settings-keyfile</refentrytitle> |
| 23 |
<manvolnum>5</manvolnum> |
| 24 |
<refmiscinfo class="source">NetworkManager</refmiscinfo> |
| 25 |
<refmiscinfo class="manual">Configuration</refmiscinfo> |
| 26 |
<refmiscinfo class="version">&NM_VERSION;</refmiscinfo> |
| 27 |
</refmeta> |
| 28 |
<refnamediv> |
| 29 |
<refname>nm-settings-keyfile</refname> |
| 30 |
<refpurpose>Description of <emphasis>keyfile</emphasis> settings plugin</refpurpose> |
| 31 |
</refnamediv> |
| 32 |
<refsect1 id='description'><title>Description</title> |
| 33 |
<para> |
| 34 |
NetworkManager is based on the concept of connection profiles that contain |
| 35 |
network configuration (see <citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle> |
| 36 |
<manvolnum>5</manvolnum></citerefentry> for details). The profiles can be |
| 37 |
stored in various formats. NetworkManager uses plugins for reading and writing |
| 38 |
the data. The plugins can be configured in <citerefentry> |
| 39 |
<refentrytitle>NetworkManager.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. |
| 40 |
</para> |
| 41 |
<para> |
| 42 |
The <emphasis>keyfile</emphasis> plugin is the generic plugin that supports all |
| 43 |
the connection types and capabilities that NetworkManager has. The files are |
| 44 |
in a .ini-style format and located in <filename>/etc/NetworkManager/system-connections/</filename>, |
| 45 |
<filename>/usr/lib/NetworkManager/system-connections/</filename> and |
| 46 |
<filename>/run/NetworkManager/system-connections/</filename>. |
| 47 |
This plugin is always enabled and will automatically be used to store |
| 48 |
any connections that are not supported by any other active plugin. |
| 49 |
For security, it will ignore files that are readable or writable by any user |
| 50 |
other than 'root' since private keys and passphrases may be stored |
| 51 |
in plaintext inside the file. |
| 52 |
</para> |
| 53 |
</refsect1> |
| 54 |
<refsect1 id='file_format'><title>File Format</title> |
| 55 |
<para> |
| 56 |
The <emphasis>keyfile</emphasis> config format is a simple .ini-style |
| 57 |
format. It consists of sections (groups) of key-value pairs. |
| 58 |
More information of the generic key file format can be found at |
| 59 |
<ulink url="https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html#glib-Key-value-file-parser.description"> |
| 60 |
GLib key file format</ulink> (Lines beginning with a '#' are comments, |
| 61 |
lists are separated by character <literal>;</literal> etc.). |
| 62 |
</para> |
| 63 |
<para> |
| 64 |
Each section corresponds to a setting name as described in the settings |
| 65 |
specification (<citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle> |
| 66 |
<manvolnum>5</manvolnum></citerefentry>). Each key/value pair in a |
| 67 |
section is one of the properties from the specification. |
| 68 |
</para> |
| 69 |
<para> |
| 70 |
The majority of properties are written in the same format as the |
| 71 |
specification into the <emphasis>keyfile</emphasis>. However, some |
| 72 |
values are inconvenient for people to use so they are stored in the |
| 73 |
<emphasis>keyfile</emphasis> in more readable ways. These properties |
| 74 |
that differ from the specification are described below. |
| 75 |
An example could be IP addresses that are not written as integer arrays, |
| 76 |
but more reasonably as "1.2.3.4/12 1.2.3.254". |
| 77 |
Also, some lists of complex values (addresses, routes, routing-rules), |
| 78 |
instead of using a semicolon separated list, use one key-value pair |
| 79 |
per list element, with the key being the singular of the property name |
| 80 |
followed by the numeric index (i.e address1, address2, ...). |
| 81 |
</para> |
| 82 |
<para> |
| 83 |
Users can create or modify the <emphasis>keyfile</emphasis> connection files |
| 84 |
manually, even if that is not the recommended way of managing the profiles. |
| 85 |
However, if they choose to do that, they must inform NetworkManager about |
| 86 |
their changes (for example via <emphasis>nmcli con (re)load</emphasis>). |
| 87 |
</para> |
| 88 |
<formalpara> |
| 89 |
<title>Examples of <emphasis>keyfile</emphasis> configuration</title> |
| 90 |
<para> |
| 91 |
<programlisting> |
| 92 |
<emphasis role="bold">A sample configuration for an ethernet network:</emphasis> |
| 93 |
[connection] |
| 94 |
id=Main eth0 |
| 95 |
uuid=27afa607-ee36-43f0-b8c3-9d245cdc4bb3 |
| 96 |
type=802-3-ethernet |
| 97 |
autoconnect=true |
| 98 |
|
| 99 |
[ipv4] |
| 100 |
method=auto |
| 101 |
|
| 102 |
[802-3-ethernet] |
| 103 |
mac-address=00:23:5a:47:1f:71 |
| 104 |
</programlisting> |
| 105 |
</para> |
| 106 |
<para> |
| 107 |
<programlisting> |
| 108 |
<emphasis role="bold">A sample configuration for WPA-EAP (PEAP with MSCHAPv2) and always-ask secret:</emphasis> |
| 109 |
[connection] |
| 110 |
id=CompanyWIFI |
| 111 |
uuid=cdac6154-a33b-4b15-9904-666772cfa5ee |
| 112 |
type=wifi |
| 113 |
autoconnect=false |
| 114 |
|
| 115 |
[wifi] |
| 116 |
ssid=CorpWLAN |
| 117 |
mode=infrastructure |
| 118 |
security=802-11-wireless-security |
| 119 |
|
| 120 |
[wifi-security] |
| 121 |
key-mgmt=wpa-eap |
| 122 |
|
| 123 |
[ipv4] |
| 124 |
method=auto |
| 125 |
|
| 126 |
[ipv6] |
| 127 |
method=auto |
| 128 |
|
| 129 |
[802-1x] |
| 130 |
eap=peap; |
| 131 |
identity=joe |
| 132 |
ca-cert=/home/joe/.cert/corp.crt |
| 133 |
phase1-peapver=1 |
| 134 |
phase2-auth=mschapv2 |
| 135 |
password-flags=2 |
| 136 |
</programlisting> |
| 137 |
</para> |
| 138 |
<para> |
| 139 |
<programlisting> |
| 140 |
<emphasis role="bold">A sample configuration for openvpn:</emphasis> |
| 141 |
[connection] |
| 142 |
id=RedHat-openvpn |
| 143 |
uuid=7f9b3356-b210-4c0e-8123-bd116c9c280f |
| 144 |
type=vpn |
| 145 |
timestamp=1385401165 |
| 146 |
|
| 147 |
[vpn] |
| 148 |
service-type=org.freedesktop.NetworkManager.openvpn |
| 149 |
connection-type=password |
| 150 |
password-flags=3 |
| 151 |
remote=ovpn.my-company.com |
| 152 |
cipher=AES-256-CBC |
| 153 |
reneg-seconds=0 |
| 154 |
port=443 |
| 155 |
username=joe |
| 156 |
ca=/etc/openvpn/ISCA.pem |
| 157 |
tls-remote=ovpn.my-company.com |
| 158 |
|
| 159 |
[ipv6] |
| 160 |
method=auto |
| 161 |
|
| 162 |
[ipv4] |
| 163 |
method=auto |
| 164 |
ignore-auto-dns=true |
| 165 |
never-default=true |
| 166 |
</programlisting> |
| 167 |
</para> |
| 168 |
<para> |
| 169 |
<programlisting> |
| 170 |
<emphasis role="bold">A sample configuration for a bridge and a bridge port:</emphasis> |
| 171 |
[connection] [connection] |
| 172 |
id=MainBridge id=br-port-1 |
| 173 |
uuid=171ae855-a0ab-42b6-bd0c-60f5812eea9d uuid=d6e8ae98-71f8-4b3d-9d2d-2e26048fe794 |
| 174 |
interface-name=MainBridge interface-name=em1 |
| 175 |
type=bridge type=ethernet |
| 176 |
controller=MainBridge |
| 177 |
[bridge] port-type=bridge |
| 178 |
interface-name=MainBridge |
| 179 |
</programlisting> |
| 180 |
</para> |
| 181 |
<para> |
| 182 |
<programlisting> |
| 183 |
<emphasis role="bold">A sample configuration for a VLAN:</emphasis> |
| 184 |
[connection] |
| 185 |
id=VLAN for building 4A |
| 186 |
uuid=8ce1c9e0-ce7a-4d2c-aa28-077dda09dd7e |
| 187 |
interface-name=VLAN-4A |
| 188 |
type=vlan |
| 189 |
|
| 190 |
[vlan] |
| 191 |
interface-name=VLAN-4A |
| 192 |
parent=eth0 |
| 193 |
id=4 |
| 194 |
</programlisting> |
| 195 |
</para> |
| 196 |
</formalpara> |
| 197 |
</refsect1> |
| 198 |
|
| 199 |
<refsect1 id='details'><title>Details</title> |
| 200 |
<para> |
| 201 |
<emphasis>keyfile</emphasis> plugin variables for the majority of NetworkManager |
| 202 |
properties have one-to-one mapping. It means a NetworkManager property is stored |
| 203 |
in the keyfile as a variable of the same name and in the same format. |
| 204 |
There are several exceptions to this rule, mainly for making keyfile syntax easier |
| 205 |
for humans. The exceptions handled specially by <emphasis>keyfile</emphasis> |
| 206 |
plugin are listed below. Refer to |
| 207 |
<link linkend='nm-settings-nmcli'><citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle><manvolnum>5</manvolnum></citerefentry></link> |
| 208 |
for all available settings and properties and their description. |
| 209 |
</para> |
| 210 |
<formalpara><title>Name aliases</title> |
| 211 |
<para> |
| 212 |
Some of the NetworkManager setting names are somewhat hard to type or remember. Therefore |
| 213 |
<emphasis>keyfile</emphasis> introduces aliases that can be used instead of the names. |
| 214 |
<!-- Hmm, why doesn't <simplelist type='horiz' columns='2'> create two columns? --> |
| 215 |
<simplelist type='horiz' columns='1'> |
| 216 |
<member><emphasis>setting name keyfile alias</emphasis></member> |
| 217 |
<member>802-3-ethernet = ethernet</member> |
| 218 |
<member>802-11-wireless = wifi</member> |
| 219 |
<member>802-11-wireless-security = wifi-security</member> |
| 220 |
</simplelist> |
| 221 |
</para> |
| 222 |
</formalpara> |
| 223 |
<xsl:apply-templates/> |
| 224 |
<refsect2 id="secrets-flags"> |
| 225 |
<title>Secret flags</title> |
| 226 |
<para> |
| 227 |
Each secret property in a NetworkManager setting has an associated <emphasis>flags</emphasis> |
| 228 |
property that describes how to handle that secret. In the <emphasis>keyfile</emphasis> plugin, |
| 229 |
the value of <emphasis>-flags</emphasis> variable is a decimal number (0 - 7) defined as a sum |
| 230 |
of the following values: |
| 231 |
</para> |
| 232 |
<itemizedlist> |
| 233 |
<listitem> |
| 234 |
<para>0 - (NM owned) - the system is responsible for providing and storing this secret.</para> |
| 235 |
</listitem> |
| 236 |
<listitem> |
| 237 |
<para>1 - (agent-owned) - a user-session secret agent is responsible for providing |
| 238 |
and storing this secret; when it is required, agents will be asked to provide it.</para> |
| 239 |
</listitem> |
| 240 |
<listitem> |
| 241 |
<para>2 - (not-saved) - this secret should not be saved but should be requested |
| 242 |
from the user each time it is required.</para> |
| 243 |
</listitem> |
| 244 |
<listitem> |
| 245 |
<para>4 - (not-required) - in some situations it cannot be automatically determined |
| 246 |
that a secret is required or not. This flag hints that the secret is not required |
| 247 |
and should not be requested from the user.</para> |
| 248 |
</listitem> |
| 249 |
</itemizedlist> |
| 250 |
</refsect2> |
| 251 |
</refsect1> |
| 252 |
|
| 253 |
<refsect1 id='files'><title>Files</title> |
| 254 |
<para><filename>/etc/NetworkManager/system-connections/*</filename></para> |
| 255 |
</refsect1> |
| 256 |
|
| 257 |
<refsect1 id='see_also'><title>See Also</title> |
| 258 |
<para><link linkend='nm-settings-nmcli'><citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>, |
| 259 |
<link linkend='nm-settings-ifcfg-rh'><citerefentry><refentrytitle>nm-settings-ifcfg-rh</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>, |
| 260 |
<link linkend='NetworkManager'><citerefentry><refentrytitle>NetworkManager</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>, |
| 261 |
<link linkend='NetworkManager.conf'><citerefentry><refentrytitle>NetworkManager.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>, |
| 262 |
<link linkend='nmcli'><citerefentry><refentrytitle>nmcli</refentrytitle><manvolnum>1</manvolnum></citerefentry></link>, |
| 263 |
<link linkend='nmcli-examples'><citerefentry><refentrytitle>nmcli-examples</refentrytitle><manvolnum>7</manvolnum></citerefentry></link></para> |
| 264 |
</refsect1> |
| 265 |
</refentry> |
| 266 |
</xsl:template> |
| 267 |
|
| 268 |
<xsl:template match="setting"> |
| 269 |
<xsl:variable name="setting_name" select="../@name"/> |
| 270 |
<xsl:if test="property/@name != ''"> |
| 271 |
<table> |
| 272 |
<title><xsl:value-of select="@name"/> setting (section)</title> |
| 273 |
<tgroup cols="4"> |
| 274 |
<thead> |
| 275 |
<row> |
| 276 |
<entry>Property</entry> |
| 277 |
<entry>Keyfile Variable</entry> |
| 278 |
<entry>Format</entry> |
| 279 |
<entry>Description</entry> |
| 280 |
</row> |
| 281 |
</thead> |
| 282 |
<tbody> |
| 283 |
<xsl:apply-templates/> |
| 284 |
</tbody> |
| 285 |
</tgroup> |
| 286 |
</table> |
| 287 |
</xsl:if> |
| 288 |
</xsl:template> |
| 289 |
|
| 290 |
<xsl:template match="property"> |
| 291 |
<row> |
| 292 |
<entry align="left"><xsl:value-of select="@name"/></entry> |
| 293 |
<entry align="left"><xsl:value-of select="@variable"/></entry> |
| 294 |
<entry align="left"><xsl:value-of select="@format"/></entry> |
| 295 |
<entry align="left"> |
| 296 |
<xsl:value-of select="description"/> |
| 297 |
<xsl:if test="string-length(@example)"> |
| 298 |
<emphasis role="bold"> |
| 299 |
|
| 300 |
Example: </emphasis><xsl:value-of select="@example"/> |
| 301 |
</xsl:if> |
| 302 |
<xsl:if test="string-length(@values)"> |
| 303 |
<emphasis role="bold"> |
| 304 |
|
| 305 |
Allowed values: </emphasis><xsl:value-of select="@values"/> |
| 306 |
</xsl:if> |
| 307 |
</entry> |
| 308 |
</row> |
| 309 |
</xsl:template> |
| 310 |
|
| 311 |
</xsl:stylesheet> |