0

I have deleted the yaml config file. Now, what could I do to restore back?

the yaml file resides in

cat /etc/netplan/ 
2
  • Is this a server or desktop installation?
    – chili555
    Jul 3, 2018 at 12:09
  • Ubuntu server 18.04 Jul 3, 2018 at 13:04

1 Answer 1

3

First, using the terminal command ifconfig, find the relevant interface that you are trying to configure. It may be something like ens3 or enp3s0 or similar.

Now recreate the file:

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

Write the following:

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

Of course, substitute the interface you found if not enp3s0.

Spacing and indentation are crucial and must be perfect. Proofread carefully twice. Save (Ctrl+o followed by Enter) and exit (Ctrl+x) the text editor.

Now apply the settings:

sudo netplan apply

You should be all set.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .