How I Set Up Wifi In Debian 11
Tags: linux, beginners
Published: 2021-09-14 23:14:10

I just made the switch to Debian 11 last night. If you're new to Debian, you may be surprised to see that Wifi doesn't seem to work right out of the box. I'll walk you through the steps that I took to get Wifi up and running. Please note, I am by no means a Linux expert. I'm just a web developer who runs an older laptop and doesn't want to deal with Windows ever again. 

If you just installed Debian 11 you may want to run through [this article](https://www.linuxtechi.com/things-to-do-after-installing-debian-11/) first (it won't help with the wifi, but some of these items are probably necessary/helpful).

*Note: Your experience may vary based on your machine*

## Add non-free and contrib sources to your SourcesList
So...due to Debian's FOSS philosophy, you'll need to add some repo sources to your SourcesList. You can find the sources.list file here: `/etc/apt/sources.list`. 

My sources.list file currently looks like this:
```
# Line commented out by installer because it failed to verify:
deb http://security.debian.org/debian-security bullseye-security main contrib
# Line commented out by installer because it failed to verify:
deb-src http://security.debian.org/debian-security bullseye-security main contrib

# bullseye-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
# A network mirror was not selected during install.  The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free

deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free

deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian/ bullseye-updates main contrib

deb-src http://deb.debian.org/debian/ bullseye-updates main contrib
```

Notice that I've added the non-free and contrib repo sources. You'll want to do the same. You can learn more about the SourcesList [here](https://wiki.debian.org/SourcesList).

*Note. I'm not sure which of these sources is the one that gave me access to the package I needed to get my wifi up and running, but am pretty sure it's the non-free*

## Figure out which wifi adapter you have
This is a super important step. You'll need to know which wifi adapter you have in order to know which package to install to use it. I accomplished this by using the `lshw` command. If you do not have 'lshw' installed you can easily install it by running `sudo apt install lswh`.

Once you have `lshw` installed, you can run `sudo lshw -html > lshw.html`. This will pipe out the results in to a nice html file for you. 

Open the HTML file and look for an entry with a description of "network controller" or something similar. My entry looked like this:
![Network Controller Entry](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2vkh9ithfw8kxd8qubgy.png)

I was able to see that I have the Wireless 7265 network controller from Intel. I did a quick internet search for "intel wireless 7265 debian 11" and found [this link](https://wiki.debian.org/iwlwifi). 
*Note: You will need to search for your network controller and pray to your favorite deity that Debian has a package that will enable wifi for you*

## Install the necessary package
Now that you hopefully found the right package, it just needs to be installed. The `iwlwifi` page from Debian gave me a couple of command line instructions to run. Once installed, I was able to connect to my wifi. I did have to switch to the root user to run those commands. You can do that by running `su - root`.

## Hope this helps
I hope at least one person out there finds this article helpful. Also, if you're a more experienced Linux user, please feel free to critique my post, give advice, etc..so long as it's helpful and not condescending. Thanks!