Linux debian wifi driver

Настройка Wi-Fi в Linux Debian

Для работы wi-fi карты необходим драйвер. Нужного драйвера может не быть в системе. Что бы узнать какое устройство (сетевая карта) используется, можно посмотреть ID производителя и ID устройства с помощью команды «lspci -nn» или, если USB карта, «lsusb» эти команды выводят список устройств в системе, а также показывают их идентификатор. Пример строки из вывода команды lsusb:

Bus 001 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN

Видно, что wi-fi карточка Realtek, модель: RTL8188CUS, ID у неё: 0bda:8176 (первые четыре шестнадцатеричные цифры — это ID производителя, вторые — ID устройства). В данном случае модель уже известна и искать её по номеру ID нет смысла. Многие драйвера для проводных и беспроводных карт Realtek собраны в пакете firmware-realtek, однако после его установки и подключения usb wi-fi карты, беспроводной интерфейс у меня не появился. Тогда я скачал с сайта производителя драйвера нужной мне модели под Linux(Unix). В архиве находились исходные тексты драйвера, скрипт установки «install.sh» и документация. После запуска скрипта install.sh, произошла компиляция модуля драйвера (8192cu) и его установка в систему. После чего появился беспроводной интерфейс wlan0.

Узнать, что он появился можно командой «ifconfig -a«

2. Установка необходимых пакетов для работы с Wi-Fi

Настройку Wi-Fi сети можно произвести в графическом режиме с помощью NetworkManager или Wicd либо в консольном. Я рассмотрю вариант настройки в консольном.

Для работы с беспроводными интерфейсами есть пакет: wireless-tools (содержит утилиты: iwconfig, iwlist и пр.)

Для поддержки WPA и WPA2 нужен пакет: wpasupplicant

Следует установить эти два пакета.

3. Настройка Wi-Fi

Первым делом нужно включить беспроводной интерфейс командой: «ifconfig wlan0 up«

Далее можно просканировать доступные беспроводные сети командой: «iwlist wlan0 scan» (команда «iwlist» доступна после установки пакета wireless-tools)

vmwpc1:~# iwlist wlan0 scan
wlan0 Scan completed :
Cell 01 - Address: B8:A3:86:12:75:BA
ESSID:"Wi-Fi Net"
Protocol:IEEE 802.11bg
Mode:Master
Frequency:2.427 GHz (Channel 4)
Encryption key:on
Bit Rates:54 Mb/s
Extra:rsn_ie=30140100000fac020100000fac020100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
Quality=93/100 Signal level=70/100
Cell 02 - Address: 1C:AF:F7:26:BD:C8
ESSID:"k-60-net"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.427 GHz (Channel 4)
Encryption key:on
Bit Rates:150 Mb/s
Extra:wpa_ie=dd160050f20101000050f20401000050f20401000050f20 2
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Quality=100/100 Signal level=91/100

Читайте также:  Количество открытых портов linux

Видно, что найдены две беспроводных сети. Из вывода команды можно увидеть используемые идентификаторы сети (ESSID), частоты (каналы), протоколы, методы шифрование, уровень сигнала и прочее.

Настройка Wi-Fi сети производится в файле: «/etc/network/interfaces», так как там будет храниться ключ для доступа к беспроводной сети, то нужно ограничить доступ к файлу командой «chmod 0600 /etc/network/interfaces» (команда выставляет права чтения и записи в файл только для владельца файла, владельцем является root).

Пример файла «/etc/network/interfaces»:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
wpa-ssid «k-60-net»
wpa-psk «dsqTtfsvsNyfiCsNMaga»

wpa-ssid — задает идентификатор беспроводной сети

wpa-psk — задаёт парольную фразу на доступ к сети. (Может быть задана в виде ASCII, как в примере, либо в виде 64 битного шестнадцатиричного числа сгенерированного утилитой wpa_passphrase на основании ASCII парольной фразы)

Настройку Wi-Fi сети можно задать и в отдельном файле-конфиге для wpa_supplicant и указав его в «/etc/network/interfaces».

Пример такого файла «/etc/network/interfaces»:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/network/wpa_supp.conf

Пример файла «/etc/network/wpa_supp.conf«:

network= ssid="k-60-net"
proto=WPA2
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
psk
>

CCMP — соответствует шифрованию AES

После настройки конфигурационных файлов можно включить интерфейс командой: «ifup wlan0«

Посмотреть состояние беспроводного интерфейса можно командой «iwconfig«, однако эта команда не распознаёт использование WPA/WPA2 и показывает Security mode: Open.

Для достоверного отображение информации лучше использовать команду «wpa_cli status«

Selected interface 'wlan0'
bssid=1c:af:f7:26:bd:c8
ssid=k-60-net
id=0
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.0.10

Подключение с использованием WEP а не WPA/WPA2 рассматривать не будем, так как метод WEP уже устаревает и довольно легко взламывается.

В этой и прошлых статьях (Настройка сети в Linux Debian, Настройка PPPoE в Linux Debian) мы рассмотрели как можно произвести типовую настройку сети в Linux Debian.

Более сложную конфигурацию сети с использованием VLAN, а так же конфигурацию с использованием объединения сетевых интерфейсов рассмотрим в следующих статьях (Настройка VLAN в Linux и Linux bonding — объединение сетевых интерфейсов в Linux).

Читайте также:  Mysql workbench linux debian

Источник

How to Enable WiFi in Debian 11 Bullseye, Fix Missing wlan0

How to Enable WiFi in Debian 11 Bullseye, Fix Missing wlan0

Are you looking for a way to fix no Wi-Fi problem on Debian? If yes, then you have landed on the right page. In this tutorial, I will share a straightforward method that you can apply to fix the missing Wi-Fi adapter issue on Debian.

If you just did a fresh Debian install on a PC, then you will most likely run into an issue where you can’t access Wi-Fi. Debian will not even show you wlan0 device if you run ip addr show the command.

This happens because the Debian ISO doesn’t include the Wi-Fi firmware by default. Thus, you have to manually install the firmware from a non-free repo in order to use the Wi-Fi facility.

Depending on the network card manufacturer of your computer, you have to install the correct firmware. If you are using a laptop of popular brands such as Lenovo, Acer, Samsung or Asus, which usually use Atheros network card, it could be a little daunting to find the right version of the firmware to install.

I ran into this issue a little while ago and couldn’t find a quick solution so I thought maybe share the fix, so others do not have to face what I went through. Let’s cut to the chase and see the steps involved:

  1. First, identify the manufacturer of your Wi-Fi network card.
  2. Install the firmware matching your network card manufacturer.

See how to complete these two steps below.

Step 1: Identifying Wi-Fi Network Card Manufacturer on Debian

There is a CLI utility called lshw which can help you identify all the hardware installed on your computer, including the network card. A very good chance is that it will be pre-installed. If not, then you will have to install it by connecting your PC to an Ethernet connection. You can use your Android phone as an Ethernet device via USB tethering.

Install lshw like this:

sudo apt install lshw

It is now time to use lshw to find out the network card vendor. Run the command below and wait for it to generate the HTML report.

lshw -html > lsh.html

lshw generate hardware report in html

Open the generated HTML report(lsh.html) in the browser and search for network or network controller. You will find the result something like this:

Читайте также:  Linux kernel missing autoconf h

lshw showing network controller

From this screenshot, it is now evident that the vendor of my network card is Atheros! But it can also be Intel. It all depends on the PC/laptop manufacturer. Never mind, it doesn’t matter because, firmware for both these cards available for Debian. See in next section, how to install it.

Step 2: Installing firmware matching your network card manufacturer on Debian.

In the last step, you will know what network card is installed on your system. So, based on what card it is, you need to install the correct firmware.

For Atheros Card:

On my Lenovo Ideapad 300-15ISK, it was Atheros card, as evident from the snapshots above.

So, to install the firmware for Atheros, you issue the following command.

sudo apt install firmware-atheros

Install firmware-atheros on Debian

After the firmware installs, you can try restarting your computer. You will now see that it will detect the available Wi-Fi networks nearby.

Wi-Fi start showing

Alternatively, you can download the DEB file for the same firmware on some other device, transfer to the Debian PC, and manually install it.

After getting the DEB file, you open the terminal in the Downloads directory and issue this command.

sudo dpkg -i firmware-atheros*

After it completes, successfully, you will have both; wla0 will start showing along with the Wi-Fi network.

For Intel Card:

To install the firmware for Intel network controller, you issue the following command.

sudo apt install firmware-iwlwifi

After it installs successfully, restart your computer. You will now see that it will detect nearby Wi-Fi networks.

Alternatively, you also download the DEB file for the same firmware on some other device, transfer to the Debian PC, and install it manually.

Find and get Intel Wireless firmware here: firmware-iwlwifi (20210315-3) [non-free]

After getting the DEB file, you open the terminal in the Downloads directory and issue this command.

sudo dpkg -i firmware-iwlwifi*

install iwlwifi on Debian

After it completes, successfully, you will have both; wlan0 will start showing along with the Wi-Fi network.

These are the only two steps you have to perform. If you follow them correctly, I am sure you will get Wi-Fi access on Debian in easy way. Although, I hope that they make this process a bit smoother by restoring these back to the installation ISO.

Источник

Оцените статью
Adblock
detector