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 [-vnafh] [-i interfaces-file] [--allow=class] [--force] [--no-scripts] [--state=state-file] interface

PARAMETERS

-a, --all
    Bring up all interfaces marked 'auto'

-v, --verbose
    Print verbose log messages

-n, --noact, --dryrun
    Do not actually configure, just test

-h, --help
    Show help and exit

--force
    Force up even if already up

--no-scripts
    Skip running pre-up/up/post-up scripts

--allow=<class>
    Only allow interfaces in specified class

-i <file>, --interfaces=<file>
    Use alternative interfaces file

--state=<file>
    Use alternative state file

DESCRIPTION

The ifup command brings up (activates) network interfaces defined in configuration files, typically /etc/network/interfaces. It is part of the ifupdown suite, commonly used in Debian-based systems like Ubuntu for managing network settings via scripts.

Upon invocation, ifup reads the interfaces file, parses the stanza for the specified interface (or all if -a is used), and executes hooks: pre-up, up, and post-up scripts. It handles IP assignment (static or DHCP via dhclient/udhcpc), routing, and other settings like MTU or wireless ESSID.

For example, a config might specify:
auto eth0
iface eth0 inet dhcp

Running ifup eth0 activates it. It supports logical interfaces (aliases, VLANs via vconfig), bonding, bridges, and tunnels.

Primarily for servers or scripts; desktop users often prefer NetworkManager. Requires root privileges. Logs to syslog with -v. Dry-run mode (-n) simulates without changes.

CAVEATS

Requires root; deprecated in systemd-heavy distros favoring systemd-networkd or NetworkManager. May conflict with other managers. Interfaces file syntax errors halt execution.

CONFIGURATION EXAMPLE

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1

USAGE NOTE

Run as root: sudo ifup -a at boot via /etc/rc.local or systemd service.

HISTORY

Developed for Debian's ifupdown package in the 1990s by Anthony Towns and Bernd Eckenfels. Integral to Debian sysadmin tools; ported to other distros. Persists in Ubuntu server editions despite shift to netplan/systemd.

SEE ALSO

ifdown(8), ifquery(8), ifstatus(8), ip(8), ifconfig(8)

Copied to clipboard