ifupdown
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ifupdown [February 12, 2026 at 14:53] – yanevskiv | ifupdown [May 14, 2026 at 11:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # ifupdown | ||
| + | **ifupdown** is the traditional network manager on [[gnu-linux|GNU/ | ||
| + | It was especially commmon in Debian systems before Debian 12 (Bookworm). | ||
| + | |||
| + | The " | ||
| + | |||
| + | |||
| + | ## Install | ||
| + | On Debian 10 and Debian 11: | ||
| + | ``` | ||
| + | sudo apt install ifupdown | ||
| + | ``` | ||
| + | Don't install ifupdown if you're using a different network manager, such as systemd-networkd! | ||
| + | |||
| + | ## Manual | ||
| + | |||
| + | - `man ifup` | ||
| + | - `man ifdown` | ||
| + | - `man ifquery` | ||
| + | - `man interfaces` | ||
| + | |||
| + | ## / | ||
| + | All configuration lies in `/ | ||
| + | ``` | ||
| + | $ ls / | ||
| + | if-down.d | ||
| + | ``` | ||
| + | |||
| + | The main configuration file is `/ | ||
| + | |||
| + | The following is the minimal possible configuration. It only configures the loopback interface. Configuring the loopback interface gives you addresses `127.0.0.1` (IPv4) and `::1` (IPv6). These are home addresses so that you can ping yourself `ping 127.0.0.1` (hence why it's called a " | ||
| + | ```bash | ||
| + | # / | ||
| + | |||
| + | # Loopback | ||
| + | auto lo | ||
| + | iface lo inet loopback | ||
| + | |||
| + | # ... place your other config here ... | ||
| + | ``` | ||
| + | |||
| + | ## Configuration examples | ||
| + | |||
| + | To configure a loopback device (the only device that's technically necessary) | ||
| + | ```bash | ||
| + | # Loopback | ||
| + | auto lo | ||
| + | iface lo inet loopback | ||
| + | ``` | ||
| + | |||
| + | To configure an `eth0` interface dynamically (IPv4): | ||
| + | ```bash | ||
| + | # IPv4 dynamic (DHCPv4) | ||
| + | allow-hotplug eth0 | ||
| + | iface eth0 inet dhcp | ||
| + | ``` | ||
| + | |||
| + | To configure an `eth0` interface statically (IPv4): | ||
| + | ```bash | ||
| + | # IPv4 static | ||
| + | auto eth0 | ||
| + | iface eth0 inet static | ||
| + | address 192.168.1.50 | ||
| + | netmask 255.255.255.0 | ||
| + | gateway 192.168.1.1 | ||
| + | ``` | ||
| + | |||
| + | To configure an `eth0` interface dynamically (IPv6): | ||
| + | The interface acquires IPv6 through SLAAC via Router Advertisements (RA). | ||
| + | No DHCPv6 required. | ||
| + | ```bash | ||
| + | # IPv6 dynamic | ||
| + | auto eth0 | ||
| + | iface eth0 inet6 auto | ||
| + | accept_ra | ||
| + | ``` | ||
| + | |||
| + | To configure an `eth0` interface statically (IPv6): | ||
| + | ```bash | ||
| + | # IPv6 static | ||
| + | auto eth0 | ||
| + | iface eth0 inet6 static | ||
| + | address 2001: | ||
| + | netmask 64 | ||
| + | gateway 2001: | ||
| + | ``` | ||
| + | |||
| + | To configure an `eth0` interface statically (IPv4 + IPv6): | ||
| + | ```bash | ||
| + | # IPv4 static block | ||
| + | iface eth0 inet static | ||
| + | address 192.168.1.50 | ||
| + | netmask 255.255.255.0 | ||
| + | gateway 192.168.1.1 | ||
| + | |||
| + | # IPv6 static block | ||
| + | iface eth0 inet6 static | ||
| + | address 2001: | ||
| + | netmask 64 | ||
| + | gateway 2001: | ||
| + | ``` | ||
| + | |||
| + | Full configuration (loopback + IPv4 + IPv6) | ||
| + | ```bash | ||
| + | # / | ||
| + | |||
| + | # Loopback | ||
| + | auto lo | ||
| + | iface lo inet loopback | ||
| + | |||
| + | # IPv4 static block | ||
| + | iface eth0 inet static | ||
| + | address 192.168.1.50 | ||
| + | netmask 255.255.255.0 | ||
| + | gateway 192.168.1.1 | ||
| + | |||
| + | # IPv6 static block | ||
| + | iface eth0 inet6 static | ||
| + | address 2001: | ||
| + | netmask 64 | ||
| + | gateway 2001: | ||
| + | ``` | ||
| + | |||
| + | ## Commands (ifup ifdown ifquery) | ||
| + | There are three commands you should know about | ||
| + | |||
| + | - `ifup` - Reads `/ | ||
| + | - `ifdown` - Reads `/ | ||
| + | - `ifquery` - Reads `/ | ||
| + | |||
| + | Bringing an `eth0` interface up: | ||
| + | ``` | ||
| + | # ifup eth0 | ||
| + | ``` | ||
| + | |||
| + | Bringing all interfaces up | ||
| + | ``` | ||
| + | # ifup -a | ||
| + | ``` | ||
| + | |||
| + | Bringing `eth0` interface down | ||
| + | ``` | ||
| + | # if down eth0 | ||
| + | ``` | ||
| + | |||
| + | These examples assume your network interface is named `eth0` by [[udev|udev]]. | ||
| + | |||
| + | ## Relation to ifconfig and route | ||
| + | The commands `ifconfig` and `route` seem related to `ifup`, `ifdown` and `ifquery`. However the former two are rather low-level commands that modify the kernel state. The latter three are high-level commands that sit on top of the former two. | ||
| + | |||
| + | The `ifconfig` and `route` commands are themselves considered legacy and replaced with [[ip-command|ip]] command (provided by iproute2 package) in a similar way systemd-networkd replaces ifupdown. | ||
| + | |||
| + | ## Links | ||
| + | |||
| + | - https:// | ||
| + | - https:// | ||
| + | - https:// | ||
| + | - https:// | ||
| + | - https:// | ||
