0

I am newby to ubuntu, trying to install ubuntu-server 20.04. During my 1st installation, the network was working good. Per my memory, there was a "enxxx" item at Network Connections page, but I deleted it somehow when I was messing with it.

For some reasons, I have to reinstall the system, but this time I can't find the item indicating the ethernet card. Worse, I can't get any tool since no access to the Internet after installation, say, sudo apt-get install ifconfig is impossible.

I hv tried edit the netplan /etc/netplan, as the answer suggested. also I'd checked the bios, the mac of the ethernet is there.

Please advise how I can solve this issue, or any hint is most welcome. Thanks.

btw, the newly-installed system even doesn't know auto command.

the regular network connection page

Screen when installing Screen when installing

result for ip a ip a

result for lshw lshw

result for lspci lspci

I can find the ethernet controller with sudo lshw -class Net but can't make it work.

lshw -class Net

for better understanding, here is my lshw -c network and netplan

  *-network UNCLAIMED
       description: Ethernet controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 1f.6
       bus info: pci@0000:00:1f.6
       version: 11
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list
       configuration: latency=0
       resources: memory:53300000-5331ffff

netplan

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
Lorenz Keel
  • 8,905
  • Can you [edit your question] to include the output of ip a, sudo lshw -C network and lspci? This will show hardware and network-related information that may help with an answer. – matigo Jun 26 '21 at 07:19
  • @matigo many thanks, pls find the images attached. Seems the ethernet care is there, but I just don't know how to get it working. – Eric Huang Jun 26 '21 at 07:40
  • Do you have a physical button in your laptop or a hotkey in your laptop's keyboard to enable/disable the Ethernet/Wifi?. Is it a USB dongle or a dedicated Ethernet port?. Cheers – Carles Mateo Jun 26 '21 at 07:48
  • @CarlesMateo No, I don't think so, unfortunately. – Eric Huang Jun 26 '21 at 08:20
  • @EricHuang please execute this command and paste the output. You should see your Ethernet device in there: ls -al /sys/class/net – Carles Mateo Jun 26 '21 at 13:22
  • @CarlesMateo only the "lo" soft linked to ../../devices/virtual/net/lo , Even I can see it, but I jus can't make it work. – Eric Huang Jun 26 '21 at 15:25
  • Are those screenshots from the current running system that has no ethernet? If so, edit your question and show me cat /etc/netplan/*.yaml and a full output of sudo lshw -C network. Start comments to me with @heynnema or I'll miss them. – heynnema Jun 26 '21 at 17:59
  • @heynnema Mnay thanks! for better reading experience, pls find the edited post. I'd added the content of the files on it. – Eric Huang Jun 27 '21 at 02:59
  • @EricHuang when you say that you deleted eth0, what exact command did you execute to make this happen?. – Carles Mateo Jun 27 '21 at 11:16
  • @EricHuang With little information to go on, please see my initial answer. If it helps to solve the problem, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks! – heynnema Jun 27 '21 at 13:42
  • @CarlesMateo when ip a I see nothing, but with lshw -c network, I can see it. Assuming that the os sees it, but don' t know how to deal with it, and that should be driver issue. – Eric Huang Jun 28 '21 at 01:58

1 Answers1

0

This assumes that you're installing Ubuntu Server 20.04...

Confirm that /etc/network/interfaces (if it exists) contains only this:

auto lo
iface lo inet loopback

Confirm that /etc/NetworkManager/NetworkManager.conf contains this:

[ifupdown]
managed=false

We'll change /etc/netplan/*.yaml...

cd /etc/netplan # change directory

ls -al # find the filename

sudo pico the_filename_shown_above.yaml # edit the file

Change this:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

To this:

# Let systemd-networkd manage all devices on this system
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: true

Save the file.

sudo netplan generate

sudo netplan apply

reboot

heynnema
  • 70,711
  • Thanks, my question is that, how can it know the name of the ethernet care is enp0s3, since the os only see it at hardware level? one new information. I just checked with gigabyte, the motherboard company, they say they don't provide ubunbtu driver yet, I guess I have to go find it, and work again. – Eric Huang Jun 28 '21 at 02:02
  • @EricHuang It would be useful to know how/where you deleted eth0. Then I could come up with a more accurate answer. There is no driver required from GB. Try my .yaml file and see if it works. – heynnema Jun 28 '21 at 02:44
  • 1
    @EricHuang You could also boot to a Ubuntu Desktop USB/DVD and see if the ethernet works. If it does, do sudo lshw -C network and edit that output into your question. – heynnema Jun 28 '21 at 02:47
  • @EricHuang Status please... – heynnema Jun 30 '21 at 03:02
  • @EricHuang Status please... – heynnema Jul 10 '21 at 15:19