1<?xml version='1.0'?> <!--*-nxml-*--> 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> 4<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> 5 6<refentry id="systemd-networkd-wait-online.service" conditional='ENABLE_NETWORKD' 7 xmlns:xi="http://www.w3.org/2001/XInclude"> 8 9 <refentryinfo> 10 <title>systemd-networkd-wait-online.service</title> 11 <productname>systemd</productname> 12 </refentryinfo> 13 14 <refmeta> 15 <refentrytitle>systemd-networkd-wait-online.service</refentrytitle> 16 <manvolnum>8</manvolnum> 17 </refmeta> 18 19 <refnamediv> 20 <refname>systemd-networkd-wait-online.service</refname> 21 <refname>systemd-networkd-wait-online@.service</refname> 22 <refname>systemd-networkd-wait-online</refname> 23 <refpurpose>Wait for network to come online</refpurpose> 24 </refnamediv> 25 26 <refsynopsisdiv> 27 <para><filename>systemd-networkd-wait-online.service</filename></para> 28 <para><filename>systemd-networkd-wait-online@.service</filename></para> 29 <para><filename>/usr/lib/systemd/systemd-networkd-wait-online</filename></para> 30 </refsynopsisdiv> 31 32 <refsect1> 33 <title>Description</title> 34 35 <para><command>systemd-networkd-wait-online</command> is a 36 oneshot system service (see <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>), that waits for the network to be 37 configured. By default, it will wait for all links it is aware of 38 and which are managed by 39 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> 40 to be fully configured or failed, and for at least one link to be online. Here, online means that 41 the link's operational state is equal or higher than <literal>degraded</literal>. The threshold 42 can be configured by <option>--operational-state=</option> option.</para> 43 44 <para>The service <filename>systemd-networkd-wait-online.service</filename> invokes 45 <command>systemd-networkd-wait-online</command> without any options. Thus, it waits for all managed 46 interfaces to be configured or failed, and for at least one to be online.</para> 47 48 <para>The service <filename>systemd-networkd-wait-online@.service</filename> takes an interface 49 name, and invokes <command>systemd-networkd-wait-online</command> with <option>-i</option> and the 50 specified interface name. Thus, wait for the specified interface to be configured and online. For 51 example, <filename>systemd-networkd-wait-online@eth0.service</filename> waits for 52 <filename>eth0</filename> to be configured by <command>systemd-networkd</command> and online. 53 </para> 54 </refsect1> 55 56 <refsect1> 57 <title>Options</title> 58 59 <para>The following options are understood:</para> 60 61 <variablelist> 62 <varlistentry> 63 <term><option>-i</option> <replaceable>INTERFACE</replaceable><optional>:<replaceable>MIN_OPERSTATE</replaceable><optional>:<replaceable>MAX_OPERSTATE</replaceable></optional></optional></term> 64 <term><option>--interface=</option><replaceable>INTERFACE</replaceable><optional>:<replaceable>MIN_OPERSTATE</replaceable><optional>:<replaceable>MAX_OPERSTATE</replaceable></optional></optional></term> 65 66 <listitem><para>Network interface to wait for before deciding if the system is online. This 67 is useful when a system has several interfaces which will be configured, but a particular 68 one is necessary to access some network resources. When used, all other interfaces are ignored. 69 This option may be used more than once to wait for multiple network interfaces. When this 70 option is specified multiple times, then <command>systemd-networkd-wait-online</command> waits 71 for all specified interfaces to be online. Optionally, required minimum and maximum operational 72 states can be specified after a colon <literal>:</literal>. Please see 73 <citerefentry><refentrytitle>networkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> 74 for possible operational states. If the operational state is not specified here, then 75 the value from <varname>RequiredForOnline=</varname> in the corresponding 76 <filename>.network</filename> file is used if present, and <literal>degraded</literal> otherwise. 77 </para></listitem> 78 </varlistentry> 79 80 <varlistentry> 81 <term><option>--ignore=</option><replaceable>INTERFACE</replaceable></term> 82 83 <listitem><para>Network interfaces to be ignored when deciding 84 if the system is online. By default, only the loopback 85 interface is ignored. This option may be used more than once 86 to ignore multiple network interfaces. </para></listitem> 87 </varlistentry> 88 89 <varlistentry> 90 <term><option>-o</option> <replaceable>MIN_OPERSTATE</replaceable><optional>:<replaceable>MAX_OPERSTATE</replaceable></optional></term> 91 <term><option>--operational-state=</option><replaceable>MIN_OPERSTATE</replaceable><optional>:<replaceable>MAX_OPERSTATE</replaceable></optional></term> 92 93 <listitem><para>Takes a minimum operational state and an optional maximum operational state. 94 Please see <citerefentry><refentrytitle>networkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> 95 for possible operational states. If set, the specified value overrides 96 <varname>RequiredForOnline=</varname> settings in <filename>.network</filename> files. 97 But this does not override operational states specified in <option>--interface=</option> option. 98 </para></listitem> 99 </varlistentry> 100 101 <varlistentry> 102 <term><option>-4</option></term> 103 <term><option>--ipv4</option></term> 104 105 <listitem><para>Waiting for an IPv4 address of each network interface to be configured. If this 106 option is specified with <option>--any</option>, then 107 <command>systemd-networkd-wait-online</command> exits with success when at least one interface 108 becomes online and has an IPv4 address. If the required minimum operational state is 109 below <literal>routable</literal>, then each link (or at least one link with 110 <option>--any</option>) must have an IPv4 link-local or routable address. If the required 111 minimum operational state is <literal>routable</literal>, then each link must have an IPv4 112 routable address.</para> 113 <para>If neither <option>--ipv4</option> nor 114 <option>--ipv6</option> is specified, then the value from 115 <varname>RequiredFamilyForOnline=</varname> in the corresponding <filename>.network</filename> 116 file is used if present.</para></listitem> 117 </varlistentry> 118 119 <varlistentry> 120 <term><option>-6</option></term> 121 <term><option>--ipv6</option></term> 122 123 <listitem><para>Waiting for an IPv6 address of each network interface to be configured. If this 124 option is specified with <option>--any</option>, then 125 <command>systemd-networkd-wait-online</command> exits with success when at least one interface 126 becomes online and has an IPv6 address. If the required minimum operational state is 127 below <literal>routable</literal>, then each link (or at least one link with 128 <option>--any</option>) must have an IPv6 link-local or routable address. If the required 129 minimum operational state is <literal>routable</literal>, then each link must have an IPv6 130 routable address.</para> 131 <para>If neither <option>--ipv4</option> nor 132 <option>--ipv6</option> is specified, then the value from 133 <varname>RequiredFamilyForOnline=</varname> in the corresponding <filename>.network</filename> 134 file is used if present.</para></listitem> 135 </varlistentry> 136 137 <varlistentry> 138 <term><option>--any</option></term> 139 140 <listitem><para>Even if several interfaces are in configuring state, 141 <command>systemd-networkd-wait-online</command> exits with success when at least one interface 142 becomes online. When this option is specified with <option>--interface=</option>, then 143 <command>systemd-networkd-wait-online</command> waits for one of the specified interfaces to be 144 online. This option is useful when some interfaces may not have carrier on boot. 145 </para></listitem> 146 </varlistentry> 147 148 <varlistentry> 149 <term><option>--timeout=</option><replaceable>SECS</replaceable></term> 150 151 <listitem><para>Fail the service if the network is not online 152 by the time the timeout elapses. A timeout of 0 disables the 153 timeout. Defaults to 120 seconds. </para></listitem> 154 </varlistentry> 155 156 <varlistentry> 157 <term><option>-q</option></term> 158 <term><option>--quiet</option></term> 159 160 <listitem><para>Suppress log messages.</para></listitem> 161 </varlistentry> 162 163 <xi:include href="standard-options.xml" xpointer="help" /> 164 <xi:include href="standard-options.xml" xpointer="version" /> 165 </variablelist> 166 </refsect1> 167 168 <refsect1> 169 <title>See Also</title> 170 <para> 171 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, 172 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, 173 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, 174 <citerefentry><refentrytitle>networkctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> 175 </para> 176 </refsect1> 177 178</refentry> 179