2

I am trying to use ifdown command on my network interface (enp0s3), but it claims, that this interface is not known. When I try the same command with my loopback lo it works fine. What could be the problem ? My network-manager is sure off, only networking daemon is running.

lsb_release -d 

Ubuntu 18.04.1 LTS

cat /etc/netplan/50-cloud.init.yami

emphasized text

You should probably know, it is on VM.

John Ronald
  • 2,526

2 Answers2

1

You're currently set to use networkd, not NetworkManager.

ifup and ifdown and nmcli are NetworkManager commands.

Remove all modifications to /etc/network/interfaces.

You should work with the ip command. Type man ip for more info.

Here are some example ip commands that should work for you...

   ip addr
       Shows addresses assigned to all network interfaces.

ip neigh Shows the current neighbor table in kernel.

ip link set enp0s3 up Bring up interface enp0s3.

ip link set enp0s3 down Bring down interface enp0s3.

ip route Show table routes.

Minor twit... your /etc/netplan/*.yaml file should look like this... spacing and indentation are very important...

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      addresses: [192.168.0.110/24]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]

Or, if you wish to use NetworkManager...

network:
  version: 2
  renderer: NetworkManager

Followed by:

sudo netplan generate

sudo netplan apply

heynnema
  • 73,649
0

Make sure, that you define the interface enp0s3 here: /etc/network/interfaces.

Dominik K
  • 306