During installation using a keyboard and monitor with a very cheap little WiFi adaptor, the Server 22.04 installer detects what I call the adaptor ID which for USB WiFi adaptors always seems to start with wlx followed by twelve more alphanumeric characters. It uses this along with the requested WiFi network SSID and passcode to build a yaml file in /etc/netplan/
I was experimenting with the format of the yaml file at the same time as I was Google searching answers to questions and responding to file format warnings so didn't keep notes at the time but this is the working configuration I ended up with:-
# This is the network config written by 'subiquity' network: version: 2 wifis: wlxAdaptorID: access-points: YourWiFiSSID: password: YourWiFiPasscode accept-ra: no dhcp4: no dhcp6: no addresses: - 192.168.x.y/24 - Your:Fixed:IPv6::y/64 routes: - to: default via: 192.168.x.1 - to: default via: Your:Fixed:IPv6::1 nameservers: addresses: - 208.67.222.222 - 208.67.220.220 - 8.8.8.8 - 2620:119:35::35 - 2620:119:53::53assuming that, under routes: the router address 192.168.something.1. The file name will be something like 00-installer-config-wifi.yaml. There was also another yaml file for the on board Ethernet socket which I disabled by adding .hide to the end of the file name.
I am no expert at all on this stuff, but as far as I know the
accept-ra: no
line prevents the kernel from automatically generating an IPv6 address for
the interface so that I can specify my own static address which can
then be referenced in my DNS settings. I also disable DHCP so that I can
specify my own choice of name servers.
Now, how to change WiFi adaptors without messing up and locking yourself out of your server!
The very cheap adaptor (about £5.00 posted from China) I first used really didn't have enough signal strength to reliably reach maybe six metres through internal walls and a floor. You can't just pull it out and replace it with another because the adaptor ID then won't match the ID in the yaml file and there will be no connection.
Now, tell the server to reboot itself in a few minutes
sudo shutdown -r HH:MM
giving yourself time to go to the server and swap in the new adaptor
before it does so. You shouid then be able to ssh in again over the WiFi
and the new adaptor.
If you should happen to find this page and it is of use to you please email me using hswf at my domain thefletchers.net.