No network from minimum net install

  • I did a minimum net install, but my new system is not starting the network automatically -- No IP address with my eth0 device.
  • I installed dhclient package myself but that doesn't help. I thought it should have been taken care of by the post-install of the dhclient package.
  • Searching for the answer myself, I found this page, hinting that I have to write such systemd unit for myself.
  • If so, I have to first understand what's systemd unit activate vs enable, whereas previously in init5, all I need to do is to install a service package and its post-install will take care of enabling the service itself.

All these have been way too complicated than it should, I believe. Somebody help please.

UPDATE:

OK, maybe the reason is that this is a minimum net install, and I don't have all those things required. Here is more info:

$ 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 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:0c:29:56:d8:4c brd ff:ff:ff:ff:ff:ff
    altname enp2s1
    altname ens33

$ ls /etc/netplan
ls: cannot access '/etc/netplan': No such file or directory

$ sudo service NetworkManager status
Unit NetworkManager.service could not be found.

$ ls /usr/lib/systemd/system/dhcpcd.service
ls: cannot access '/usr/lib/systemd/system/dhcpcd.service': No such file or directory

But still, if I run dhclient myself manually, I will get IP under such minimum install. I.e., the NetworkManager is not absolutely necessary, I hope. And I hope there is a fix for situation like this, whether using dhcpcd or dhclient.


You don't have network-manager installed, so your host cannot obtain an IP address. You have two choices: 1) manually configure the eth0 interface in /etc/network/interfaces or 2) install network-manager

  1. Manually Configure

cd /etc/network/

nano interfaces

Add these lines at the bottom:

auto eth0

iface eth0 inet dhcp

  1. Install Network Manager

sudo apt install network-manager

After whichever approach you choose, reboot the machine. Do not do both, as network-manager will ignore what's in interfaces once enabled. Tested and confirmed Ubuntu 20.x and Debian Bullseye.


Installing the dhcpcd got my IP, but only for IPv6, no IPv4 address. So I'm closing this one and opening another one for that instead.