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
  • 1,816
  • 3
  • 15
  • 29
  • ifup and ifdown generally only affect interfaces that are declared in /etc/network/interfaces. I suspect yours is not. Did you try: sudo ifconfig enp0s3 down? – chili555 Feb 14 '19 at 15:30
  • ifconfig works fine thanks. Even thought I added my interface into /etc/network/interfaces in this form : auto enp0s3 it still does not work, and claim unrecognized interface. – John Ronald Feb 14 '19 at 15:33
  • Please add output of nmcli general status to your question. – Pilot6 Feb 14 '19 at 15:39
  • Please edit your question to show the result of: lsb_release -d and also: cat /etc/network/interfaces – chili555 Feb 14 '19 at 15:49
  • 1
    What version Ubuntu? Edit your question with the output of cat /etc/netplan/*.yaml. Report back to @heynnema – heynnema Feb 14 '19 at 15:49

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
  • 70,711
0

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

Dominik K
  • 306