ifconfig

Console

  • ifconfig eth0 down
  • ifconfig eth0 inet [IP]
  • ifconfig eth0 netmask [MASK]
  • route add [GW] gw [IP]
  • ifconfig eth0 up

Scripts

nano /etc/network/interfaces

Scripts

nano /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

Eror: bash: ifconfig: command not found

The ifconfig command has been deprecated and thus missing by default on Debian Linux, starting from Debian stretch.

# ifconfig
-bash: ifconfig: command not found

The new and recommended alternative for examining a network configuration on Debian Linux is ip command. For example to use ip command to display a network configuration run the following:

# ip address

The above ip command can be abbreviated to:

# ip a

If you still prefer to use ifconfig as part of your daily sys admin routine, you can easily install it as part of the net-tools package.