The majority of network setup can be done via the interfaces configuration file at /etc/network/interfaces. Here, you can give your network card an IP address (or use dhcp), set up routing information, configure IP masquerading, set default routes and much more.
Remember to add interfaces that you want brought up at boot time to the 'auto' line.
See man interfaces for more options. NetworkConfiguration.
The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a client–server architecture. Wikipedia.
After Debian installation completed when you open /etc/network/interfaces file, you see network configuration like this:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens18
iface ens18 inet dhcp
For define which interface should be configured user "ip a" command:
user@localhost:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether bc:24:11:d6:61:90 brd ff:ff:ff:ff:ff:ff
altname enp0s18
inet 10.0.255.112/16 brd 10.0.255.255 scope global dynamic ens18
valid_lft 6419sec preferred_lft 6419sec
inet6 fe80::be24:11ff:fed6:6190/64 scope link
valid_lft forever preferred_lft forever
Now we need to configure "ens18" named interface.
If you want configure interface manually (set static IP address) delete last two lines (for interface "ens18") and enter this configs:
auto ens18
allow-hotplug ens18
iface ens18 inet static
address 10.0.255.112
netmask 255.255.0.0
gateway 10.0.0.1
dns-nameservers 10.0.0.1 8.8.8.8 8.8.4.4
Use "CTRL + X" for exit and press "Y", then "Enter" for save changes.
For applying changes reload network interfaces:
sudo systemctl restart networking.service