Debian 12 (22-2024) does not recognize your Ethernet or Wi-Fi, on asus

If Debian 12 (22-2024) does not recognize your Ethernet or Wi-Fi, for ASUS PRIME H510M-K R2.0 motherboard, due to missing non-free firmware or drivers. Here’s how to fix it:


1. Identify Your Network Hardware

Boot into Debian and run:

lspci -nn | grep -i -E 'network|ethernet'

OR

ip link show

This will show the network adapters.


2. Load Missing Non-Free Firmware

Debian does not include proprietary drivers by default. You need to install them.

Enable Non-Free Repositories

  1. Open a terminal and run:
sudo nano /etc/apt/sources.list
  1. Add contrib non-free non-free-firmware to the repository lines:
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  1. Save and exit (Ctrl + X, Y, Enter).

  2. Update and install firmware:

sudo apt update && sudo apt install firmware-linux firmware-misc-nonfree firmware-iwlwifi firmware-realtek -y

3. Load the New Firmware

Restart your system:

sudo reboot

Check if Ethernet and Wi-Fi work:

ip a

4. If Ethernet Still Doesn't Work

Try manually loading the module:

sudo modprobe r8169

If your Ethernet controller is Realtek, install drivers:

sudo apt install r8168-dkms
sudo modprobe -r r8169 && sudo modprobe r8168

5. If Wi-Fi Still Doesn’t Work

  1. Load the driver:
sudo modprobe iwlwifi
  1. Check Wi-Fi networks:
nmcli dev wifi list
  1. If nmcli is missing, install NetworkManager:
sudo apt install network-manager -y

Then restart:

sudo systemctl restart NetworkManager

6. Final Steps

  • If you still don’t see Wi-Fi, check logs:

      dmesg | grep iwlwifi
    
  • If needed, reinstall kernel modules:

      sudo apt install linux-headers-$(uname -r) -y