Sometimes the network configuration does not appear during the Debian installation or IP addresses and routes change. In this case, you have to configure the network manually:

  1. Before editing the file, check the name of the network card being used by entering the following command:
    ip –h addr
  • This command replaces the previous ifconfig command.
  • The previous notation for eth0 changes to ens32, eth1 to ens33 and so on.
  1. Example: Open the file vi /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 ens32
    iface ens32 inet static
    address 10.0.0.20
    netmask 255.255.255.0
    network 10.0.0.0
    broadcast 10.0.0.255
    gateway 10.0.0.100
  1. Adjust the file.
  1. If the file is created again, restart the system.
  1. If changes are made to the /etc/network/interfaces file, restart the system with the following command: sudo init 6