2
  • 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.

4
  • 2
    What OS & release are you asking about?
    – guiverc
    Oct 25 at 13:19
  • The 20.04 LTS @guiverc
    – xpt
    Oct 25 at 13:45
  • 1
    Please edit your question to show the result of these terminal commands: ip a and also: cat /etc/netplan/*.yaml and finally: sudo service NetworkManager status | grep Active I doubt that a post on an Arch forum that is nine years old is valid here.
    – chili555
    Oct 25 at 14:16
  • Thanks @chili555, basically, this is a minimum net install, and I don't have all those things you requested. See my updated OP.
    – xpt
    Oct 25 at 15:38
2

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.

5
  • 1
    Third option would be Installing the dhcpcd, and it got my IP fixed, so the NetworkManager is not absolutely necessary. But I'll upvote for you.
    – xpt
    Oct 25 at 19:54
  • 1
    @xpt ideally, a static configuration in interfaces would better than all three, especially if this is public facing as you don’t want to just blindly accept dhcp server solicitations … but yeah that works too, since it is the dhcp portion of network manager, but likely that’s less skinny than a simple configuration if space and minimalism is your intent. ;)
    – oemb1905
    Oct 25 at 19:58
  • 1
    I believe that /etc/network/interfaces is deprecated in 20.04 in favor of netplan.
    – chili555
    Oct 25 at 20:24
  • This is legacy fix for sure, but it’s for a minimal install, still works, and is very elegant.
    – oemb1905
    Oct 25 at 20:51
  • Also, interfaces is only deprecated on desktop Ubuntu, not server Ubuntu and/or Debian.
    – oemb1905
    Nov 7 at 16:38
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.