ubuntu server 20.04 wifi via netplan doesn't work

6,880

Your .yaml file is incomplete.

Use this (and keep exact spacing, indentation, and no tabs):

network:
  version: 2
  renderer: networkd
  wifis:
    wlp2s0:
      dhcp4: true
      access-points:
        "K+T":
          password: "xxxxxxxxx"

sudo netplan generate

sudo netplan apply

Then install wpasupplicant (via ethernet or USB):

sudo apt-get update

sudo apt-get install wpasupplicant

reboot

Note: This all will work only if you install the wpasupplicant package and its dependencies. So either you need the ethernet connection, or download to USB and install manually. Without wpasupplicant wi-fi will not work.

Share:
6,880
Tomas Luptak
Author by

Tomas Luptak

Updated on September 18, 2022

Comments

  • Tomas Luptak
    Tomas Luptak over 1 year

    I'm not skilled in Linux, but I'm able to follow the guides. yet, it doesn't work for me. I ran this to get the wifi interface name: ls /sys/class/net

    I got the name. I configured the netplan yaml in /etc/netplan

      wlp2s0:
        access-points:
          "K+T":
            password: "xxxxxxxxx"
        dhcp4: true
    

    I ran this without error and rebooted and yet it doesn't work. if I install Ubuntu desktop, I can connect to my wifi network just fine...

    sudo netplan apply --debug
    
  • Stephen Boston
    Stephen Boston over 3 years
    Usually don't need to reboot. netplan apply recycles the networking.
  • Boris Hamanov
    Boris Hamanov over 3 years
    @StephenBoston netplan apply ususally does "recycle" the networking, except when there's static IP. And what better way to know if your configuration is reliable/operational, then to reboot the system and make sure wireless comes up? And oh, I forgot to add wpasupplicant... back to a quick edit. That WILL require a reboot.
  • Tomas Luptak
    Tomas Luptak over 3 years
    ok, got it, how can I check why it's not connecting if reboot isn't needed? output of "ip a" gives 3: wlp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
  • Boris Hamanov
    Boris Hamanov over 3 years
    @TomasLuptak Without wpasupplicant, it certainly won't work, and reboot is the only way to tell if it connects or not.
  • Tomas Luptak
    Tomas Luptak over 3 years
    @heynnema, then Ubuntu should say in every guide that you can't enable wifi without connected to ethernet... and yet Ubuntu presents it that wpasupplicant is something obsolete and not needed anymore as netplan should be successor far more versatile and superior. well, it is not... was it so difficult to add wpasupplicant to the server iso?
  • Boris Hamanov
    Boris Hamanov over 3 years
    @TomasLuptak Yes, I agree. wpasupplicant should have been added to the .iso server install. But I'm not here to complain about it... only to help out when I can. Is wireless working for you now?
  • slangasek
    slangasek over 3 years
    Where does "Ubuntu" say that wpasupplicant is obsolete? This is not a message we should be communicating anywhere. And wifi has never been supported out of the box on our server images - the fact that you can now enable it by "only" installing wpasupplicant and not installing NetworkManager is a new feature.
  • Boris Hamanov
    Boris Hamanov over 3 years
    @slangasek You meant to ping "@TomasLuptak"? I didn't say that.
  • Boris Hamanov
    Boris Hamanov over 3 years
    @slangasek The problem with installing wpasupplicant (and any dependencies) means it requires a working ethernet connection, or using a USB flash key after manually downloading the files. It should be installed during the server installation from .iso.
  • Stephen Boston
    Stephen Boston over 3 years
    I use static IP and have never had to reboot to activate the connection.
  • Tomas Luptak
    Tomas Luptak over 3 years
    @slangasek I read it in some forum I can't find right now that netplan is successor of wpasupplicant. not that wpasupplicant can't be installed as alternative, but that netplan is successor. therefore I deducted that wpasupplicant is obsolete. nevertheless, even if wifi is not supported out of the box on server edition, not including wpasupplicant ubuntu caused headache for people with devices without ethernet connection with that decision.
  • Boris Hamanov
    Boris Hamanov over 3 years
    @TomasLuptak Did you finally get wpasupplicant installed, and is wireless working now? netplan is not a successor to wpasupplicant.
  • Tomas Luptak
    Tomas Luptak over 3 years
    @slangasek it would be useful and helpful to have it at least as an option during the installation if ssh server is offered as an option too.
  • Tomas Luptak
    Tomas Luptak over 3 years
    @heynnema no I have no idea how to do that. I found site (packages.ubuntu.com/bionic/wpasupplicant) with the package, do I need to download all that dependancies either? and then, when I got it to my device, how do I install it locally from the usb?
  • Boris Hamanov
    Boris Hamanov over 3 years
    @TomasLuptak Do you have access to an ethernet connection? If not, download wpasupplicant.deb, copy the file off to your Downloads folder, and just try to install it with sudo apt install ~/Downloads/wpasupplicant.deb and hopefully it'll tell you exactly which dependencies it can't find.
  • Boris Hamanov
    Boris Hamanov over 3 years
    @TomasLuptak During/after the Server install, wasn't ssh already there?
  • Boris Hamanov
    Boris Hamanov over 3 years
    @TomasLuptak You don't want the Bionic version of wpasupplicant, so adjust your search/download link.
  • Tomas Luptak
    Tomas Luptak over 3 years
    I was searching for bionic beaver version because in the meanwhile I tried 18.05 if that would make any difference. it didn't. and I just said ssh is offered as an option during install, why not wifi tools?
  • Tomas Luptak
    Tomas Luptak over 3 years
    I installed the missing dependancies and wpa-supplicant manually. now the netplan guide works. I'm connected.
  • slangasek
    slangasek over 3 years
    This is not the place to make feature requests for the server installer. Please file a bug at bugs.launchpad.net/subiquity/+filebug to request wpasupplicant support.
  • Boris Hamanov
    Boris Hamanov over 3 years
    @TomasLuptak Status please... Please remember to accept my answer by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
  • Boris Hamanov
    Boris Hamanov over 3 years
    @TomasLuptak Status please...