On some Unix-like operating systems, ifup activates a network interface, making it available to transmit and receive data.

The ifdown command disables a network interface, placing it in a state where it cannot transmit or receive data.

The ifquery command displays information about a network interface’s configuration.

This page describes the GNU/Linux version of these commands.

Technical description

The ifup and ifdown commands can configure network interfaces based on interface definitions in the file /etc/network/interfaces.

  • Technical description
  • Syntax
  • Files
  • Known limitations
  • Examples
  • Related commands
  • Linux commands help

The ifquery command is used to parse interface configuration data.

Syntax

ifup [-nv] [–no-act] [–verbose] [-i FILE|–interfaces=FILE] [–allow CLASS] -a|IFACE…

ifup -h|–help

ifup -V|–version

ifdown [-nv] [–no-act] [–verbose] [-i FILE|–interfaces=FILE] [–allow CLASS] -a|IFACE…

ifquery [-nv] [–no-act] [–verbose] [-i FILE|–interfaces=FILE] [–allow CLASS] -a|IFACE…

ifquery -l|–list [-nv] [–no-act] [–verbose] [-i FILE|–interfaces=FILE] [–allow CLASS] -a|IFACE…

Options

Files

Known limitations

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 is still 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 or ifplugd.

Examples

ifup -a

Bring up all the interfaces defined with auto in /etc/network/interfaces.

ifup eth0

Bring up interface eth0.

ifup eth0=home

Bring up interface eth0 as logical interface home.

ifdown -a

Bring down all interfaces that are currently up.

ifquery -l

Print names of all interfaces specified with the auto keyword.

ifquery -l –allow=hotplug

Print names of all interfaces specified with the allow-hotplug keyword.

ifquery eth0

Display the interface options as specified in the ifupdown configuration. Each key-value pair is printed out on individual line using “: " as separator.

ifconfig — View or modify the configuration of network interfaces.