Lines Matching refs:network
10 systemd provides three target units related to network configuration:
12 ## Network pre-configuration: `network-pre.target`
14 `network-pre.target` is used to order services before any network interfaces
16 that want to establish a firewall *before* any network interface is up.
18 `network-pre.target` is a passive unit: it cannot be started directly and it is
19 not pulled in by the the network management service, but instead a service that
21 should set `After=network-pre.target`, but not `Wants=network-pre.target` or
22 `Requires=network-pre.target`. Services that want to be run before the network
23 is configured should use `Before=network-pre.target` and
24 `Wants=network-pre.target`. This way, unless there's actually a service that
25 needs to be ordered before the network is up, this target is not pulled in,
28 ## Network management services: `network.target`
30 `network.target` indicates that the network management stack has been started.
31 Ordering after it it has little meaning during start-up: whether any network
36 any unit that has `After=network.target` can be sure that it is *stopped*
37 before the network is shut down when the system is going down. This allows
41 Note that `network.target` is a passive unit: you cannot start it directly and
42 it is not pulled in by any services that want to make use of the network.
43 Instead, it is pulled in by the network management services
44 themselves. Services using the network should hence simply place an
45 `After=network.target` stanza in their unit files, without
46 `Wants=network.target` or `Requires=network.target`.
48 ## Network connectivity has been estabilished: `network-online.target`
50 `network-online.target` is a target that actively waits until the network is
51 "up", where the definition of "up" is defined by the network management
54 network has been set up.
57 requiring the network to be up, but is not pulled in by the network management
59 of this service, in order to make sure the network is up before attempts to
60 connect to a network share are made. Note that normally, if no service requires
62 the boot, thus avoiding any delays during boot should the network not be
64 liberally: for example network server software should generally not pull this
66 before any routable network interface is up). Its primary purpose is network
67 client software that cannot operate without network.
75 LSB defines a `$network` dependency for legacy init scripts. Whenever systemd
76 encounters a `$network` dependency in LSB headers of init scripts it will
78 `network-online.target`, staying relatively close to traditional LSB behaviour.
82 The meaning of `$network` is defined [only very
87 * The network management software is up.
88 * All "configured" network interfaces are up and an IP address has been assigned to each.
90 * The network has been set up precisely to the level that a DNS server is reachable.
101 All these are valid approaches to the question "When is the network up?", but
105 networks, network configuration changes, hardware is added and removed, virtual
110 servers. Software that is written under the assumption that network
113 configuration changes. It should react to changing network configuration and
114 make the best of it. If it cannot reach a server it must retry. If network
116 to local network configuration changes in daemon code is not particularly
117 hard. In fact many well-known network-facing services running on Linux have
122 `$network` / `network-online.target` is a mechanism that is required only to
123 deal with software that assumes continuous network is available (i.e. of the
126 listen on it. OTOH a network file system client might need DNS up, and the
131 if a network DHCP server does not react, this should not slow down boot on most
132 setups, but only for those where network connectivity is strictly needed (for
133 example, because the host actually boots from the network).
137 ## How do I make sure that my service starts after the network is *really* online?
140 above). If you need to delay you service after network connectivity has been
144 After=network-online.target
145 Wants=network-online.target
150 This will delay boot until the network management software says the network is "up".
155 The services that are ordered before `network-online.target` define it's
156 meaning. *Usually* means that all configured network devices are up and have an
160 `network-online.target` will time out after 90s. Enabling this might
165 the network, `systemd-networkd-wait-online.service` if `systemd-networkd` is
169 will be enabled too, which means that `network-online.target` will include
175 `network-online.target`.
184 ## Should `network-online.target` be used?
186 Please note that `network-online.target` means that the network connectivity
188 design of the network, connectivity may briefly or permanently disappear, so
192 If you are a developer, instead of wondering what to do about `network.target`,
193 please just fix your program to be friendly to dynamically changing network
196 faster by not delaying services until network connectivity has been
202 1. Watch rtnetlink and react to network configuration changes as they
207 network changes, as all you listen on is catch-all and private addresses.
212 towards network configuration changes. This is provided as `FreeBind=`
216 An exception to the above recommendations is services which require network
220 during boot, and pull in and be ordered after `network-online.target`, but as
223 "simplistic" way, where it doesn't try to wait for the network connectivity to
224 be (re-)established, but is instead started when the network has connectivity,
225 and if the network goes away, it fails and relies on the system manager to
228 ## Modyfing the meaning of `network-online.target`
243 [systemd.network(5)](http://www.freedesktop.org/software/systemd/man/systemd.socket.html).
245 It is also possible to plug in additional checks for network state. For
246 example, to delay `network-online.target` until some a specific host is
254 Before=network-online.target
260 WantedBy=network-online.target