LinuxCommandLibrary

ifup

Activate a network interface

TLDR

Enable interface eth0

$ ifup [eth0]
copy

Enable all the interfaces defined with "auto" in /etc/network/interfaces
$ ifup [[-a|--all]]
copy

SYNOPSIS

ifup [options] interface
ifup [options] -a | --all

PARAMETERS

interface
    The name of the network interface to bring up (e.g., eth0, wlan0).

-a, --all
    Bring up all interfaces marked auto in the /etc/network/interfaces file.

-i FILE, --interfaces=FILE
    Specify an alternative interfaces configuration file instead of the default.

-v, --verbose
    Show verbose output, detailing the commands being executed.

-n, --no-act
    Perform a dry run; do not actually execute any commands, just show what would be done.

-f, --force
    Force configuration even if the interface is already up or appears configured.

-X PATTERN, --exclude=PATTERN
    Exclude interfaces matching the specified shell PATTERN from being brought up with --all.

-V, --version
    Display the version information for ifup.

-h, --help
    Display a help message and exit.

DESCRIPTION

The ifup command activates a network interface based on its configuration defined in the /etc/network/interfaces file. It is part of the ifupdown package, commonly found on Debian-based Linux distributions like Ubuntu. Unlike simple tools like ip link set up, ifup reads a declarative configuration file, automatically setting up IP addresses, netmasks, gateways, DNS servers, and executing pre-up/post-up scripts defined for the interface.

It handles complex network configurations such as DHCP, static IP assignments, bridges, bonds, and VLANs, bringing the interface completely online and ready for network communication. ifup ensures that all necessary dependencies and services are initiated or configured correctly for the specified interface to function. Its counterpart, ifdown, is used to deactivate and deconfigure an interface.

CAVEATS

ifup is primarily used on Debian, Ubuntu, and their derivatives. Other Linux distributions often use different network management tools (e.g., NetworkManager, systemd-networkd, or legacy ifcfg scripts on RHEL/CentOS). It requires root privileges to execute and correctly apply network configurations. Misconfigurations in /etc/network/interfaces can lead to network connectivity issues.

CONFIGURATION FILE

ifup relies on the /etc/network/interfaces file for interface definitions. This file specifies how each network interface should be configured (e.g., DHCP, static IP, bridge, VLAN), including associated scripts and options.

PERMISSIONS

Running ifup typically requires administrative (root) privileges due to its direct interaction with system network settings and kernel parameters.

HISTORY

The ifup command, along with its counterpart ifdown, has been a foundational component of network management on Debian-based Linux systems for many years. It was developed as part of the ifupdown package, providing a robust, script-driven approach to configure network interfaces declaratively. Its design predates and offers an alternative to modern network managers like NetworkManager or systemd-networkd, remaining a preferred choice for server environments where consistent, file-based configuration is valued.

SEE ALSO

ifdown(8), interfaces(5), ip(8), ifconfig(8), netplan(8)

Copied to clipboard