Skip to content

Instantly share code, notes, and snippets.

@latusikl
Last active May 23, 2023 20:41
Show Gist options
  • Save latusikl/1ccd41f77325aeca4942c6aa340e7ec0 to your computer and use it in GitHub Desktop.
Save latusikl/1ccd41f77325aeca4942c6aa340e7ec0 to your computer and use it in GitHub Desktop.
Ubuntu Server 22 LTS Wi-Fi

Setup Wi-Fi for Ubuntu server

Wi-Fi connections are not enabled by default on Ubuntu Server. You will need to enable it manually. You can do it during installation (this didn't work for me) and after. Here are steps I needed to do to enable Wi-Fi on my Ubuntu Server. You may need wired connections at first to download some packages or provide them using e.g. USB drive.

I am not and expert in this field so if you find something that can be improved in the Gist let me know :)

1. Download rfkill and unblock Wi-Fi

In my case I needed to unblock Wi-Fi interfaces. For that I used rfkill. It was not availalbe out of the box in the server so I needed to download additional package.

sudo apt-get install rfkill

Then I unblocked the Wi-Fi intefaces. (Without that switching interface up using ipconfig was blocked)

sudo rfkill unblock wifi

2. Setup Netplan

From some time Ubuntu uses netplan for easy configuring networking system. Configuration is based on the YAML file located in /ect/netplan/<filename>.yaml. You have to adjust that configuration (root pliviliges are required). I wanted to have both Ethernet and Wi Fi configured so my netplan configuration looks as shown below.

network:
  version: 2
  renderer: networkd
  ethernets:
    <INTERFACE_NAME>:
      dhcp4: true
  wifis:
    <INTERFACE_NAME>:
      dhcp4: true
      access-points:
        <NETWORK_NAME>:
          password: <NETWORK_PASS>
  version: 2

You can try out the netplan configuration.

sudo netplan try -v

Or apply them directly

sudo netplan generate
sudo netplan apply

3. Switch on the interface

I needed to enable my wi-fi interface manually. For that I used ifconfig and ip command to get the interface name.

ifconfig needs to be installed it is part of net-tools package

sudo apt-get install ifconfig

You can get the interface name using the ip command.

ip a

And then turn it on

ifconfig <INTERFACE_NAME> up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment