ifup(8) | ifup(8) |
ifup - bring a network interface up
ifdown - take a network interface down
ifquery - parse interface configuration
ifup [-nv] [--no-act] [--verbose]
[-i FILE|--interfaces=FILE]
[--state-dir=DIR] [--allow CLASS]
-a|IFACE...
ifup -h|--help
ifup -V|--version
ifdown [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--state-dir=DIR] [--allow CLASS] -a|IFACE...
ifquery [-nv] [--verbose] [-i FILE|--interfaces=FILE] [--state-dir=DIR] [--allow CLASS] IFACE...
ifquery -l|--list [-nv] [--verbose] [-i FILE|--interfaces=FILE] [--state-dir=DIR] [--allow CLASS] [-a|IFACE...]
ifquery --state [--state-dir=DIR] [--allow CLASS] [-a|IFACE...]
The ifup and ifdown commands may be used to configure (or, respectively, deconfigure) network interfaces based on interface definitions in the file /etc/network/interfaces. ifquery command may be used to parse interfaces configuration.
A summary of options is included below.
ifup, ifdown, and ifquery are actually the same program called by different names.
The program does not configure network interfaces directly; it runs low level utilities such as ip to do its dirty work.
When invoked, ifdown checks if ifup is still running. In that case, SIGTERM is sent to ifup.
During interface deconfiguration, ifdown ignores errors the same way as if --ignore-errors was specified.
Ifupdown uses per-interface locking to ensure that concurrent ifup and ifdown calls to the same interface are run in serial. However, calls to different interfaces will be able to run in parallel.
For ifup and ifdown, the exit status will be 0 if the given interface(s) have all been (de)configured successfully, 1 if there was any error. The result of these commands is idempotent; running ifup on an interface that is already up will result in an exit status of 0, and similarly running ifdown on an interface that is not up will also result in an exit status of 0.
ifquery will normally return with exit status 0 if an interface with a matching iface stanza, 1 if there is no matching stanza. ifquery --state will also return with exit status 1 if the given interface was known but was not up.
The program keeps records of whether network interfaces are up or down. Under exceptional circumstances these records can become inconsistent with the real states of the interfaces. For example, an interface that was brought up using ifup and later deconfigured using ifconfig will still be recorded as up. To fix this you can use the --force option to force ifup or ifdown to run configuration or deconfiguration commands despite what it considers the current state of the interface to be.
The file /run/network/ifstate must be writable for ifup or ifdown to work properly. If that location is not writable (for example, because the root filesystem is mounted read-only for system recovery) then /run/network/ifstate should be made a symbolic link to a writable location. If that is not possible then you can use the --force option to run configuration or deconfiguration commands without updating the file.
Note that the program does not run automatically: ifup alone does not bring up interfaces that appear as a result of hardware being installed and ifdown alone does not bring down interfaces that disappear as a result of hardware being removed. To automate the configuration of network interfaces you need to install other packages such as udev(7) or ifplugd(8).
The ifupdown suite was created by Anthony Towns <aj@azure.humbug.org.au>, and is currently maintained by Guus Sliepen <guus@debian.org>.
Many others have helped develop ifupdown over time, see /usr/share/doc/ifupdown/changelog.Debian.gz for a full history.
11 Jan 2017 | IFUPDOWN |