Autoconfigure network in Debian minimal base system

Posted on

Problem :

I installed Debian base system only from network install ISO in a VMWare Workstation VM. The network adapter is set to NAT. However, I noticed that the installer didn’t detect the network automatically. After some googling, I found that all I have to do is add these 3 lines to /etc/network/interfaces:

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

I rebooted the system and checked eth0 with ip a and it wasn’t there. I tried ifup eth0 but it failed with Failed to get interface index: No such device.

How can I set up networking?

Solution :

Due to the recent changes in Debian network interfaces names which took place from Debian 9 Stretch Read More, eth0 is no longer a valid interface name. To identify the available network interfaces on your machine, open terminal and run

networkctl

Available network interfaces will appear under the IDX LINK tab.
Then use the ifup command to activate your preffered network interface.

In my case, output from networkctl is

dev@debian:~$ networkctl
WARNING: systemd-networkd is not running, output will be incomplete.

IDX LINK             TYPE               OPERATIONAL SETUP     
  1 lo               loopback           n/a         unmanaged 
  2 ens5             ether              n/a         unmanaged 
  3 wlo1             wlan               n/a         unmanaged 
  4 anbox0           bridge             n/a         unmanaged 
  5 docker0          bridge             n/a         unmanaged 

5 links listed.

To enable wlo1 (Wireless network interface), I have to run the command:

ifup wlo1

Leave a Reply

Your email address will not be published.