0

Im having issues after installing ubuntu server 22.04 on raspberry pi 4

The interface wlan0 is down.

After following the official tutorial from ubuntu (https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#3-wifi-or-ethernet), im unable to set the interface up. I've configured network-config file and rebooted but it doesn't connect. Also I've tried with:

ip link set dev wlan0 up

But it refuses to set the interface up. There is nothing in syslog or dmesg.

Also, I've edited /etc/netplan/50-cloud-init.yaml with the example given and running netplan apply, but it shows me the following error:

/etc/netplan/50-cloud-init.yaml:12:1: Error in network definition: unknown key 'wifis'

Does anybody know how to fix this problem?

I'm a bit new with netplan

I've edited the post to include the output of following commands: ip a && cat /etc/netplan/*.yaml

# ip a

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: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff 3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000 link/ether yy:yy:yy:yy:yy:yy brd ff:ff:ff:ff:ff:ff

.

# cat /etc/netplan/*.yaml

This file is generated from information provided by the datasource. Changes

to it will not persist acrossan instance reboot. To disable cloud-init's

network configuration capabilities, write a file

/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:

network: {config: disabled}

network: ethernets: eth0: dhcp4: true optional: true version: 2 wifis: wlan0: dhcp4: true optional: true access-point: "My SSID": password: "My Password"

Galois
  • 3
  • Please edit your question to show the result of these terminal commands: ip a and also: cat /etc/netplan/*.yaml There is obviously an error in the netplan file that needs to be fixed. Welcome to Ask Ubuntu. – chili555 May 10 '22 at 21:25
  • Thank you @chili555 :D – Galois May 10 '22 at 22:04

2 Answers2

1

Your netplan file has numerous errors in format. I suggest:

network:   
  version: 2   
  renderer: networkd   
  ethernets:
    eth0:
      dhcp4: true
      optional: true   
  wifis:
    wlan0:
    dhcp4: true
    optional: true
    access-points:
      "My SSID":
        password: "My Password"

Netplan is very specific about indentation and spacing, so proofread carefully twice. There are many templates for netplan that you can follow in /usr/share/doc/netplan/examples.

Follow with:

sudo netplan generate
sudo netplan apply

Please be certain that you install wpa-supplicant:

sudo apt update
sudo apt install wpasupplicant
chili555
  • 60,188
1

I tried to comment on this but I do not have enough credits to do so. However, with the answer provided, I believe the items listed after the wlan0 entry should be indented. Using the code as shown produces an error regarding the indenting after wlan0. I propose the following change:

network:   
  version: 2   
  renderer: networkd   
  ethernets:
    eth0:
      dhcp4: true
      optional: true   
  wifis:
    wlan0:
      dhcp4: true
      optional: true
      access-points:
        "My SSID":
          password: "My Password"

Also, I found if using a hidden SSID, add 'hidden' after the SSID entry: Example:

  wifis:
    wlan0:
      dhcp4: true
      optional: true
      access-points:
        "My SSID":
          hidden: true
          password: "My Password"
JonM
  • 11