TransWikia.com

No internet connection after ubuntu server 20.04 install, ifconfig not available

Ask Ubuntu Asked by aswin prabhakar on November 19, 2021

I recently installed Ubuntu Server 20.04 LTS on my desktop, and found out there was no internet connection even though I had the LAN cable connected. ifconfig and iwconfig failed saying the corresponding packages net-tools and wireless-tools were not installed.

EDIT

Here is the info requested. Please find the image here.

2 Answers

A short addon to chili555's answer: In my case, the only problem was that for some strange reason, Ubuntu believed my network interface name in /etc/netplan/01-netcfg.yaml to be enp0s5 instead of enp0s4 which was the correct for my VM.

Answered by Heigre on November 19, 2021

Networking in Ubuntu server is managed by netplan. Your file lacks the details needed to connect the ethernet properly.

First, let's rename the file:

sudo mv /etc/netplan/*.yaml  /etc/netplan/01-netcfg.yaml

Now, let's change it to include the required details:

sudo nano /etc/netplan/01-netcfg.yaml   

Change the file to read:

network:
  version: 2
  renderer: networkd
  ethernets:
    ens33:
      dhcp4: true

Netplan is very particular about spacing, indentation, etc. Proofread carefully twice. Save (Ctrl+o followed by Enter) and exit (Ctrl+x) the text editor. Follow with:

sudo netplan generate
sudo netplan apply

You should be all set.

Answered by chili555 on November 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP