Thu. Jun 4th, 2020

How to setup IPv4 on Ethernet network interface on Linux

1 min read
All network interface settings in Debian/Ubuntu and distributions based on them, such as Raspbian, Kali, etc. produced in the configuration file /etc/network/interfaces. Today we will get acquainted with the basic configuration of network interfaces. To do this, open the file /etc/network/interfaces and see what is in it.

loopback interface

auto lo
iface lo inet loopback
The following configuration allows the wlan0 interface to start automatically and receive network settings via DHCP:
allowhotplug wlan0
iface eth0 inet dhcp
The manual method says that there are no default settings for the eth0 interface. The eth0 interface can be further configured manually, or by scripts from the /etc/network/if-*.d directories.
auto eth0
iface eth0 inet manual
and the last method is static. In it, we set all the network settings manually. Some options may be redundant.
auto eth1
iface eth1 inet static
address – IP address (in the example:
netmask – netmask (in the example:, network / 24)
network-used network (in the example:
broadcast – broadcast address (in the example:
gateway – gateway address (in the example:
nameserver – list of DNS servers (in the example: and
When using the dhcp or static methods, you can specify the MAC address:
hwaddress ether 03:53:55:17:98:AB