table of contents
NM-ONLINE(1) | General Commands Manual | NM-ONLINE(1) |
NAME¶
nm-online - ask NetworkManager whether the network is connected
SYNOPSIS¶
nm-online [OPTIONS...]
DESCRIPTION¶
nm-online is a utility to find out whether we are online. It is done by asking NetworkManager about its status. When run, nm-online waits until NetworkManager reports an active connection, or specified timeout expires. On exit, the returned status code should be checked (see the return codes below).
This tool is not very useful to call directly. It is however used by NetworkManager-wait-online.service with --wait-for-startup argument. This is used to delay the service and indirectly network-online.target, until networking is up. Don't order your own systemd services after NetworkManager-wait-online.service directly. Instead if necessary, order your services after network-online.target. Even better is to have your services react to network changes dynamically and don't order them with respect to network-online.target at all.
By default NetworkManager waits for IPv4 dynamic addressing to complete but does not wait for the auto IPv6 dynamic addressing. To wait for IPv6 addressing to complete, either (1) change the network connection's IPv6 may-fail setting to no, and/or (2) change the IPv6 addressing method to manual or dhcp, to indicate that IPv6 connectivity is expected.
OPTIONS¶
-h | --help
-q | --quiet
-s | --wait-for-startup
There are various ways to affect when startup complete is reached. For example, by setting a connection profile to autoconnect, such a profile possibly will activate during startup and thus delay startup complete being reached. Also, a profile is considered ready when it fully reached the logical connected state in NetworkManager. That means, properties like ipv4.may-fail and ipv6.may-fail affect whether a certain address family is required. Generally, a failure of NetworkManager-wait-online.service indicates a configuration error, where NetworkManager won't be able to reach the desired connectivity state during startup. An example for that are bridge or bond master profiles, that get autoconnected but without activating any slaves. Such master devices hang in activating state indefinitely, and cause NetworkManager-wait-online.service to fail.
-t | --timeout seconds
-x | --exit
EXIT STATUS¶
nm-online exits with status 0 if it succeeds, a value greater than 0 is returned if an error occurs.
0
1
2
SEE ALSO¶
NetworkManager 1.18.8 |