Ubuntu (alternate) server 18.04: no network interfaces

12,251

Networking in Ubuntu Server 18.04 and later is handled by netplan and no longer in /etc/network/interfaces. Please remove your additions to that file.

Please edit your /etc/netplan/01-netcfg.yaml file to read:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  wifis:
    wlp2s0:
      dhcp4: true
      dhcp6: true
      access-points:
        "network_ssid_name":
          password: "**********"

Please note that the access point name and password are enclosed in quotation marks. Also, netplan is very specific as to indentation and spacing. Please proofread carefully.

After saving the file, please do:

sudo netplan generate
sudo netplan apply

Reboot. Check to see if you connected. Do you have an IP address?

ip addr show

Are you connected?

ping -c3 www.ubuntu.com
Share:
12,251

Related videos on Youtube

user10853
Author by

user10853

Updated on September 18, 2022

Comments

  • user10853
    user10853 over 1 year

    I installed Ubuntu 18.04 using the alternate server installer. During the installation no network interfaces were detected.

    I could not figure out how to setup networking (neither ethernet nor wifi). For wired networking I have to use a usb Type-C adapter (Dell XPS 15).

    Moreover, ifup/ifdown are not installed. How can I configure the network? I eventually want to install the Ubuntu-desktop. The reason I went with the alternate installer is because I wanted more control on the partitioning than the standard installer allows.

    In /etc/network/interfaces I had added:

    auto eth0
    iface eth0 inet dhcp
    
    auto wlp2s0
    wpa-ssid <essid>
    wpa-psk <pass>
    

    ip add show shows:

    1: lo <LOOPBACK,UP,LOWER_UP> mtu ##### qdisq noqueue state UKNOWN group default qlen 1000
        link/loopbac 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet <ip> scope host lo
            valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host lo
            valid_lft forever preferred_lft forever
    2: wlp2so: <BROADCAST,MULTICAST> mtu #### qdisc noop state DOWN group default qlen 1000
        link/ether <mac> brd <brd>
    

    cat /etc/netplan/*.yaml outputs:

    # This file describes the network interfaces available on your system
    # For more information, see netplan(5).
    network:
      version: 2
      renderer: networkd
    

    systemctl status systemd-networkd reports:

    ● systemd-networkd.service - Network Service
       Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
         Docs: man:systemd-networkd.service(8)
    

    By the way lshw shows:

    network DISABLED
    
    • George Udosen
      George Udosen over 5 years
      run ip add show and post the results!
    • user10853
      user10853 over 5 years
      @GeorgeUdosen I added that it shows lo and wkp2s0
    • George Udosen
      George Udosen over 5 years
      Is that all it showed?
    • user10853
      user10853 over 5 years
      No. I updated it excluding addresses
    • George Udosen
      George Udosen over 5 years
      Were there any specific error messages shown while installing as to why no interface was detected? Please run systemctl systemd-networkd and lets see if your networld is running!
    • chili555
      chili555 over 5 years
      Do you wish to use wireless or ethernet? Please edit your question to add the result of the terminal command: cat /etc/netplan/*.yaml
    • user10853
      user10853 over 5 years
      I would like both. Updated with the requested results.
    • user10853
      user10853 over 5 years
      @GeorgeUdosen systemd-networkd following systemctl does not exist!
    • George Udosen
      George Udosen over 5 years
      My bad it should be systemctl status systemd-networkd!!!!
    • chili555
      chili555 over 5 years
      Your ip addr show doesn't include ethernet. As well, we doubt that it is named eth0. Please clarify. I will propose an answer covering wireless only at this time until there are further details.
    • user10853
      user10853 over 5 years
      @chili555 probably because I do not have the adapter plugged in. The ethernet is received through the usb type-C adapter. I remember it was eth0 when I used to connect on my ubutnu desktop (on this laptop).
    • user10853
      user10853 over 5 years
      @GeorgeUdosen updated
    • George Udosen
      George Udosen over 5 years
      Start that service with sudo systemctl start systemd-networkd && sudo systemctl enable systemd-networkd
    • user10853
      user10853 over 5 years
      @GeorgeUdosen done, it's active. What then?
    • George Udosen
      George Udosen over 5 years
      Now connect your ethernet cable and let's see how networkd handles it.
    • user10853
      user10853 over 5 years
      When I said it is active I was referring to the wifi wlp2s0. The eth0 is not shown in ip addr show as I do not have it connected (not with me right now). I will try it about 2 hours when I have it with me.
    • user10853
      user10853 over 5 years
      I eventually tried it. No connection.
  • user10853
    user10853 over 5 years
    No it does not connect. No IP
  • chili555
    chili555 over 5 years
    Well, I am very embarassed! I warned about intentation and made just such a mistake myself! Please see my edit above in a few moments. After making the correction, again run: sudo netplan generate followed by: sudo netplan apply Note and post any errors or warnings. Sorry for my misstep.
  • user10853
    user10853 over 5 years
    No problem. I tried it but it doesn't work. I mean I don't have a connection.
  • chili555
    chili555 over 5 years
    Is there any clue in the log? dmesg | grep wlp Please edit your question to show the result.
  • user10853
    user10853 over 5 years
    After a fresh boot I get wlp2s0: renamed from wlan0
  • user10853
    user10853 over 5 years
    I had something else in /etc/netplan/01-netcdg.yaml. I was testing something yesterday. After changing it back dmesg also shows wlp2s0: link is not ready. No ip address though and ping returns Temporary failure in name resolution.
  • chili555
    chili555 over 5 years
    It's time to dive deep. Please download and run the wireless script from here: askubuntu.com/questions/425155/… Paste the result here and give us the link: paste.ubuntu.com