ubuntu-asahi icon indicating copy to clipboard operation
ubuntu-asahi copied to clipboard

Recommended way to setup Wifi after v24.04 server successful install

Open TheStophe opened this issue 1 year ago • 9 comments

What is the recommended way to setup a wifi or ethernet connection after successful install? I also ran into this issue with v22 server install. If netplan in /etc/netplan what is the recommended filename? Also, is there a group name to set them UP? (E.g. sudo ip link set wlp1s0f0 up)

I have a mac mini m1 with ip a of end0 and wlp1s0f0.

ip a ... end0: <BROADCAST, MULTICAST> MTU 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00: .... altname enp3s0 ... wlp1s0f0: <BROADCAST, MULTICAST> MTU 1500 qdisc noop state DOWN group default qlen 1000 ...

TheStophe avatar Nov 18 '24 13:11 TheStophe

The netplan docs have a wifi example that should almost work. On Ubuntu Server you need to use renderer: networkd. renderer: NetworkManager won't work because NetworkManager is not installed.

It should looks something like:

network:
  version: 2
  renderer: networkd
  wifis:
    wlp1s0f0:
      dhcp4: yes
      access-points:
        "network_ssid_name":
          password: "**********"

The file name doesn't matter as long as in ends in .yaml and is placed in /etc/netplan/, so default.yaml or wifi.yaml should both work.

EDIT: after creating the file you will have to run netplan apply to apply it.

tobhe avatar Nov 18 '24 14:11 tobhe

I "replace" netplan by installing network manager and:

$ cat /etc/NetworkManager/conf.d/manage-all.conf 
[keyfile]
unmanaged-devices=none
$ # delete other /etc/netplan/*.yaml
$ sudo cat /etc/netplan/00-nm.yaml
network:
  version: 2
  renderer: NetworkManager
$ sudo netplan generate
$ sudo netplan apply
$ sudo systemctl disable systemd-networkd-wait-online.service 
$ sudo reboot

eslerm avatar Nov 18 '24 23:11 eslerm

Agree but this is assuming you don't have any internet connections yet to install / update.

TheStophe avatar Nov 19 '24 01:11 TheStophe

Still couldn't get wifi up but at least I got ethernet end0 working from the netplan yaml...

TheStophe avatar Nov 19 '24 05:11 TheStophe

@ccgarant if you run ip link set wlp1s0f0 up what does that return? You might need to apt install rfkill and rfkill unblock all.

tobhe avatar Nov 19 '24 09:11 tobhe

Thanks @tobhe, I set wlp1s0f0 to "up" and no errors. I installed rfkill and ran those commands, all good.

Now upon sudo systemctl restart ssh (enable and start tried before), there seems to be the following status errors.

Ssh.service not found.

I manually created one and type it into /etc/systemd/system/ssh.service

I've tried sudo apt install openssh-server and there seems to be a dependency package warning.

Upon daemon-reload, and restart ssh, there is another warning.

Ssh.socket not found. Not sure if this is all from openssh-server not installing correctly...

TheStophe avatar Nov 19 '24 14:11 TheStophe

This looks like ssh socket activation: https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189 in short: instead of managing ssh via the service it is now managed via the ssh.socket. That means systemd starts the service automatically as soon as it sees a network packet arrive on the ssh port. Restart does not exist because a new process is spawned for each connection.

tobhe avatar Nov 19 '24 16:11 tobhe

Still couldn't get wifi up but at least I got ethernet end0 working from the netplan yaml...

For everyone like me who is trying to figure out why the wifi is not working after changing the .yaml file, you are probably using a WPA protected network. As such Netplan needs a package called wpasupplicant which was missing by default. Without ethernet, I believe the only way to install it is with a USB drive, be aware that you need to install both wpasupplicant and libpcsclite1 (which is a missing dependency). Hope this helps!

jmssa avatar Aug 20 '25 22:08 jmssa

Oh really. I will check why wpa_supplicant isn't installed by default, I'd expect it to be there by default.

tobhe avatar Aug 20 '25 22:08 tobhe