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:
- 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 toens32
,eth1
toens33
and so on.
- 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 loiface 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
- Adjust the file.
- If the file is created again, restart the system.
- If changes are made to the /etc/network/interfaces file, restart the system with the following command:
sudo init 6