Since 2016 · 50,000+ customers · ★ 5.0 on Google Live chatWhatsAppTelegramOpen a ticket
Get started
Linux

ifdown Command Not Found on Ubuntu? How to Bring Interfaces Up and Down

ifdown command on Ubuntu VPS by 99RDP

ifdown and ifup were the classic commands for taking a network interface down and bringing it back up on Debian and Ubuntu. Modern Ubuntu releases (18.04 and later) use Netplan with systemd-networkd or NetworkManager instead, so the commands are not installed and you see ifdown: command not found or "unknown interface". This guide explains why, shows the modern equivalents, how to list interfaces, when installing ifupdown makes sense, and how to avoid locking yourself out of a VPS.

Quick answerUse ip instead of ifdown/ifup:

sudo ip link set dev eth0 down
sudo ip link set dev eth0 up

To re-apply network settings after editing Netplan, run sudo netplan apply. On a remote server, taking down the interface you are connected through cuts your SSH session, so use the provider's console or a delayed command.

Why ifdown is missing

ifdown and ifup come from the ifupdown package and read /etc/network/interfaces. Since Ubuntu 17.10, network configuration lives in YAML files in /etc/netplan/, which Netplan turns into configuration for systemd-networkd (Ubuntu Server) or NetworkManager (Ubuntu Desktop). ifupdown is no longer installed by default, so:

  • "ifdown: command not found" means the package is not installed.
  • "ifdown: unknown interface eth0" or "interface not configured" means ifupdown is installed but the interface is not defined in /etc/network/interfaces, because Netplan manages it.
Diagram of how Ubuntu configures networking with Netplan feeding systemd-networkd or NetworkManager instead of ifupdown
Why ifdown is gone

Step 1: List your network interfaces

ip -br link
ip -br addr
networkctl list

Typical names are eth0, ens3, enp1s0 or enX0 for wired and virtual NICs, and lo for loopback. networkctl also shows whether systemd-networkd manages each interface.

Comparison of ifdown/ifup and ip link set down/up on Ubuntu
ifdown vs ip link

Step 2: Bring an interface down and up (modern way)

With ip (works everywhere)

sudo ip link set dev eth1 down
sudo ip link set dev eth1 up

This changes the link state immediately. The manager (networkd or NetworkManager) normally reconfigures addresses when the link comes back up.

With networkctl (Ubuntu Server, systemd-networkd)

sudo networkctl down eth1
sudo networkctl up eth1
sudo networkctl reconfigure eth1     # re-read its configuration

With nmcli (Ubuntu Desktop, NetworkManager)

nmcli device status
sudo nmcli device disconnect enp1s0
sudo nmcli device connect enp1s0

Re-apply all configuration with Netplan

sudo netplan try      # apply with automatic rollback if you lose access
sudo netplan apply

netplan try is the safest way to test changes on a remote server: if you do not confirm within 120 seconds, the old configuration is restored.

Do not cut off your own SSH session

On a VPS with one network interface, ip link set eth0 down immediately drops your SSH connection, and the server stays unreachable until it is brought back up from the provider's VNC or web console. If you must restart the main interface remotely, run both commands together in the background so the second still executes:

sudo sh -c 'ip link set eth0 down; sleep 2; ip link set eth0 up' &

Better still, use netplan try for configuration changes, or work from the provider's console.

Ways to take a network interface down on a remote server without losing SSH access
Do not lock yourself out

Installing ifupdown (if you really need it)

Some older scripts or tools expect ifup/ifdown. You can install them:

sudo apt install ifupdown

But they only manage interfaces defined in /etc/network/interfaces. Moving an interface from Netplan to ifupdown means removing it from the Netplan YAML and defining it in /etc/network/interfaces; having both manage the same interface causes conflicts. On a VPS, do this only with console access and a backup of your network configuration. For most people, updating the script to use ip or networkctl is the better fix.

Use cases for taking an interface down

  • Applying a new IP address or MTU to a secondary interface.
  • Isolating a private network interface during maintenance.
  • Troubleshooting a flapping link or testing failover in a bonded setup.
  • Resetting a VPN or tunnel interface such as wg0 (for WireGuard, use wg-quick down wg0 and wg-quick up wg0).

Command equivalents

Old commandModern equivalent
ifdown eth0ip link set dev eth0 down or networkctl down eth0
ifup eth0ip link set dev eth0 up or networkctl up eth0
ifconfigip addr
/etc/init.d/networking restartsudo netplan apply
Edit /etc/network/interfacesEdit /etc/netplan/*.yaml

Frequently asked questions

Why is ifdown not found on Ubuntu?

Ubuntu uses Netplan with systemd-networkd or NetworkManager, and the ifupdown package that provides ifdown is no longer installed by default.

What replaced ifup and ifdown?

ip link set dev IFACE up/down, networkctl up/down, nmcli device connect/disconnect, and netplan apply for configuration changes.

How do I restart networking on Ubuntu?

Run sudo netplan apply, or sudo systemctl restart systemd-networkd on servers. Use netplan try when working remotely.

What does "ifdown: interface not configured" mean?

ifupdown is installed, but the interface is managed by Netplan, not defined in /etc/network/interfaces. Use the modern commands instead.

Nishant Kumar, Sr. Server Engineer at 99RDP
Written byNishant KumarSr. Server Engineer, 99RDP. Part of the team that runs our servers and answers support.
Keep reading

More Linux guides

All Linux guides

Need a server for this?

✓ Setup in minutes✓ Full admin access✓ 7-day refund on new services