Network issue. Ifup says unknown interface

84,086

Solution 1

ifup and ifdown are used to set up interfaces listed in /etc/network/interfaces . enp0s3 isn't described in this file, so it's absolutely expected that ifup and ifdown don't know what to do with it. Add some lines such as

iface enp0s3 inet dhcp

And you'll see that it will work much better.

Solution 2

I used the following commands:

cat /proc/net/dev
ls /sys/class/net
ip link show
ifconfig

sudo ifconfig [interface-name] down / up
Share:
84,086

Related videos on Youtube

searcot jabali
Author by

searcot jabali

Updated on September 18, 2022

Comments

  • searcot jabali
    searcot jabali over 1 year

    This is the output of ifconfig

    # ifconfig
    enp0s3    Link encap:Ethernet  HWaddr 08:00:27:ef:b6:e6
              inet addr:192.168.2.3  Bcast:192.168.2.255  Mask:255.255.255.0
              inet6 addr: fe80::cf19:776a:4d5c:36e0/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:713069 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6767 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:45869812 (45.8 MB)  TX bytes:667164 (667.1 KB)
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:1108 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1108 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:86846 (86.8 KB)  TX bytes:86846 (86.8 KB)
    

    When I do

    # ifdown enp0s3
    

    It says Unknown interface enp0s3

    The network is fine and works without any issues. Its just the command that does not work

    Ubuntu 16.04 (Xenial)

    Below is the output of ip a s

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
    2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:ef:b6:e6 brd ff:ff:ff:ff:ff:ff
        inet 192.168.2.7/24 brd 192.168.2.255 scope global enp0s3
           valid_lft forever preferred_lft forever
        inet6 fe80::cf19:776a:4d5c:36e0/64 scope link
           valid_lft forever preferred_lft forever
    

    Below is my /etc/network/interfaces

    # interfaces(5) file used by ifup(8) and ifdown(8)
    auto lo
    iface lo inet loopback
    

    Output of nmcli conn sh

    Wired connection 1  42d740b1-21c3-3b7c-8b9e-5922fe8a6380  802-3-ethernet  enp0s3
    
    • Admin
      Admin over 6 years
      Have you tried ip link set dev enp0s3 up Does enp0s3 match your configuration in /etc/network/interfaces ?
    • Admin
      Admin over 6 years
      What is the output of ip a s ?
    • Admin
      Admin over 6 years
      @bgtvfr : The output is too long to paste in one go. So Multi comment 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever
    • Admin
      Admin over 6 years
      @bgtvfr: Part 2 of output 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 08:00:27:ef:b6:e6 brd ff:ff:ff:ff:ff:ff inet 192.168.2.7/24 brd 192.168.2.255 scope global enp0s3 valid_lft forever preferred_lft forever inet6 fe80::cf19:776a:4d5c:36e0/64 scope link valid_lft forever preferred_lft forever
    • Admin
      Admin over 6 years
      @val0x00ff: Weirdly my interfaces file has only this in it # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback
    • Admin
      Admin over 6 years
      @searcotjabali please update your question with these additional details. Comments read very hard! Your network is controlled by NetworkManager and you can use nmcli conn sh to see the connections. Also ifconfig is obsoleted by ip which is a command from iproute2 tools. Use ip instead as I stated in my first comment
    • Admin
      Admin over 6 years
      @val0x00ff: Sorry. I am kinda used to ifconfig. I updated my question with the details. Thanks :-)
    • Admin
      Admin over 6 years
      @searcotjabali please see man nmcli how to control your interfaces. You are using NetworkManager which controls your interfaces. The man page has many examples that show you how to bring an interface up or down.
  • Hellreaver
    Hellreaver almost 3 years
    Sorry, can you explain what's done here? Are you just defining the interface enp0s3 as an internet+dhcp interface?
  • wazoox
    wazoox almost 3 years
    @Hellreaver Yes. Notice that the interface must already exist in the "ip" or "ifconfig" output. For the detailed syntax of /etc/network/interfaces please Read The Fine Manual: "man interfaces" or see manpages.org/etc-network-interfaces/5