0

I just installed Ubuntu Server 20.04.3 in a VMware virtual machine. Now I am not able to use this command:

cat /etc/network/interfaces

as I am not able to see any network interfaces:

No such file or directory

How should I edit my /etc/network/interfaces and assign an IP?

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
Amar Moses
  • 11
  • 1
  • 1
  • Does this answer your question? [What's the default /etc/network/interfaces?](https://askubuntu.com/questions/214170/whats-the-default-etc-network-interfaces) – Error404 Jan 08 '22 at 08:41
  • 1
    The method `/etc/network/interfaces` is long since deprecated. Please check here: https://askubuntu.com/questions/976464/why-is-the-network-configuration-i-set-in-etc-network-interfaces-ignored-on-ubu/976497#976497 Possibly a duplicate. – chili555 Jan 08 '22 at 14:21
  • You could also use "ip" command to set IP temporary. – John Ronald Jan 08 '22 at 14:29
  • Use netplan. Edit your question and show me `sudo lshw -C network` and `cat /etc/netplan/*.yaml`. Start comments to me with @heynnema or I'll miss them. – heynnema Jan 08 '22 at 16:38

1 Answers1

3

Since version 18.04 Ubuntu by default uses netplan to configure network.

Go to /etc/netplan, here you will find your network configuration.

It will look something like this:

00-installer-config.yaml

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens18:
      dhcp4: true
  version: 2
Thomas Aichinger
  • 2,746
  • 5
  • 23
  • 48