How to Fix Network Issues on Ubuntu 24.04 LTS: Wi-Fi, Ethernet, DNS, and Netplan Troubleshooting Guide

1. Introduction

Ubuntu is widely used thanks to its stability and flexibility. However, especially in the latest version, Ubuntu 24.04 LTS, some users have reported issues where the network does not function correctly. This article provides detailed methods for troubleshooting and resolving such network connectivity problems.

This guide is intended for beginners to intermediate users. It offers helpful information for situations where Wi-Fi or wired LAN is not recognized, or when DNS errors prevent an internet connection.

2. Network Issues in Ubuntu 24.04: Causes and Overview

Common Network Connectivity Issues

Network connectivity problems in Ubuntu can appear in many forms. Below are some of the main examples:

  • Wi-Fi cannot connect
    The access point may not be detected, or the connection may fail even when the correct password is entered.
  • Wired LAN is not recognized
    Even when the network cable is connected, the system may fail to detect an active connection.
  • Cannot access the internet due to DNS errors
    An IP address may be assigned, but websites cannot be reached.

Primary Causes

Network connectivity issues can generally be classified into the following causes:

  1. Hardware issues
    There may be physical problems with the network card or Wi-Fi adapter.
  2. Configuration mistakes or Netplan errors
    Incorrect or incomplete configuration files can block connectivity.
  3. Driver incompatibility
    Some drivers may not yet be fully compatible with the latest version of Ubuntu.
  4. Software conflicts
    Multiple network management tools interfering with each other may cause issues.

3. Basic Troubleshooting Steps

Simple Checks

First, eliminate physical causes by checking the following:

  • Check cables and physical connections
    For wired LAN, make sure the cable is properly connected. For Wi-Fi, verify that the access point is functioning.
  • Wi-Fi switch status
    Some laptops have physical switches that disable Wi-Fi. Ensure it is enabled.

Basic Checks Using Commands

Next, use the terminal to check the current network status.

  1. The ip address command
    Check the current interfaces and their statuses.
   ip address

Example output:

   3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
       link/ether 00:1a:2b:3c:4d:5e brd ff:ff:ff:ff:ff:ff
       inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic wlan0

If the interface is not in the UP state, it may be disabled.

  1. The ping command
    Test network connectivity.
   ping -c 4 8.8.8.8

If there is no response, the connection to the external network is blocked.

Reboot and Reset Network Services

If the problem persists, try the following:

  1. Reboot the entire system
    A reboot often resolves many issues.
   sudo reboot
  1. Restart the network service
    Restart NetworkManager to reset connections.
   sudo systemctl restart NetworkManager

4. Specific Issues and Solutions

4.1 When the Device Is Not Recognized

If the network interface is not recognized, first verify the interface status.

How to Check the Interface

  1. Check with the ip link command
    Confirm whether the network device is detected by Ubuntu.
   ip link

If neither eth0 (wired LAN) nor wlan0 (Wi-Fi) appears in the results, the system may not be recognizing the device correctly.

  1. Verify and install necessary drivers
    The required drivers may not be installed. Use the following steps to resolve this:
   lspci | grep -i network

Based on the results, search for and install the appropriate drivers.
Example:

   sudo apt install linux-modules-extra-$(uname -r)
   sudo reboot

Hardware Testing

  • If you are using a USB Wi-Fi adapter, try a different USB port or verify whether the adapter itself is defective.

4.2 Incorrect Netplan Configuration

In Ubuntu 24.04, Netplan is the default network management system. If the configuration file contains errors, the network will not function properly.

Check the Netplan Configuration File

  1. The configuration files are located in the /etc/netplan/ directory. Display the configuration with the following command:
   sudo nano /etc/netplan/01-netcfg.yaml

Example configuration:

   network:
     version: 2
     renderer: networkd
     ethernets:
       eth0:
         dhcp4: true
  1. After saving the file, apply the Netplan configuration.
   sudo netplan apply

Common Errors and Fixes

  • YAML formatting errors
    Improper spacing or indentation will cause failures. Use an online YAML validator to confirm formatting.
  • Errors during apply
    If errors occur when applying the configuration, try the following command:
   sudo netplan try

 

5. Case Study: Real-World Solutions

5.1 Wi-Fi Not Detected in Ubuntu 24.04

Situation
After installing Ubuntu 24.04, some users report that Wi-Fi is not detected, making network connection impossible. The Wi-Fi interface does not appear, and access points are not discovered.

Solution

  1. Install Wi-Fi drivers
    If the Wi-Fi adapter is not functioning correctly, installing the required firmware often resolves the issue.
   sudo apt update
   sudo apt install linux-firmware
   sudo reboot

After rebooting, verify whether Wi-Fi is detected.

  1. Restart the network service
    If drivers are not the issue, restart NetworkManager.
   sudo systemctl restart NetworkManager
  1. Enable the Wi-Fi interface
    If the interface is disabled, manually enable it.
   sudo ip link set wlan0 up
  1. Disable Wi-Fi power management
    Certain Wi-Fi adapters may disconnect due to power-saving features. Disable them as follows:
   sudo iwconfig wlan0 power off

5.2 Wired LAN Suddenly Stops Working

Situation
A wired LAN connection may suddenly stop working, especially after a system update or kernel change.

Solution

  1. Check the cable and port
    Try a different LAN cable or port to ensure the issue is not hardware-related.
  2. Fix the Netplan configuration
    If the wired LAN settings are incorrect, edit the configuration file.
   sudo nano /etc/netplan/01-netcfg.yaml

Example configuration:

   network:
     version: 2
     renderer: networkd
     ethernets:
       eth0:
         dhcp4: true

Apply the updated settings:

   sudo netplan apply
  1. Reinstall drivers
    After a kernel update, the NIC (network interface card) driver may no longer function.
   sudo apt install --reinstall linux-modules-extra-$(uname -r)
   sudo reboot
  1. Check system logs
    If the issue persists, inspect system logs for detailed errors.
   sudo dmesg | grep -i eth

Use the output to determine further actions.

6. Differences in Network Configuration: Comparing Ubuntu 20.04, 22.04, and 24.04

Ubuntu 24.04 introduces several enhancements to its network management system. These changes result in different configuration methods compared to previous versions. This section explains the major differences and important considerations when upgrading.

Evolution of Netplan

Since Ubuntu 20.04, Netplan has been the default network configuration tool. However, Ubuntu 24.04 includes the following enhancements:

  1. Simplified default configuration
    In 24.04, the initial Netplan setup is more streamlined. In many cases, renderer: NetworkManager is used by default.
  • Example: On Wi-Fi-enabled systems, NetworkManager often manages the wireless environment, eliminating manual configuration.
  1. More flexible YAML syntax
    Netplan files now provide greater tolerance for minor YAML errors, reducing configuration failures due to indentation issues.
  2. Additional supported parameters
    Ubuntu 24.04 improves DNS settings, allowing easier configuration of multiple DNS servers.

Notes When Migrating from Ubuntu 20.04 or 22.04

  1. Configuration file compatibility
    Netplan configurations used in 20.04 or 22.04 may not work as-is in 24.04. Verify them using:
   sudo netplan try

If errors occur, review the file format and parameters.

  1. Behavior of NetworkManager
  • If you used renderer: networkd in earlier versions, you may need to switch to NetworkManager after upgrading to 24.04.
  • Example configuration:
    network: version: 2 renderer: NetworkManager ethernets: eth0: dhcp4: true

Changes in DNS Settings

Ubuntu 24.04 unifies DNS settings at the system level, introducing several improvements:

  1. Enhanced systemd-resolved
  • DNS caching is now enabled by default.
  • You can clear or restart DNS services easily using systemctl restart systemd-resolved.
  1. Changes to manual DNS settings
  • Direct editing of /etc/resolv.conf is no longer recommended.
  • Use /etc/systemd/resolved.conf for persistent DNS configuration.

Improvements to Wi-Fi Configuration

Wi-Fi management has been further simplified in Ubuntu 24.04. NetworkManager automatically handles Wi-Fi connections, reducing the need for manual adjustments.

  • Reduced delay when switching between multiple access points.
  • No need to manually configure SSID or authentication settings in most environments.

Changes in Virtual Environments

  1. Default network mode changes
  • Virtual machines now default to NAT mode for more stable internet connectivity.
  • You can still switch to bridge mode if needed.
  1. Improved automatic IP assignment
  • DHCP performance has been optimized, ensuring accurate IP assignment even in virtualized systems.

7. Frequently Asked Questions (FAQ)

Q1: Why does my Wi-Fi connect briefly and then disconnect immediately?

Cause:
The Wi-Fi adapter’s power management setting may cause the device to enter sleep mode, resulting in an unstable connection.

Solution:

  1. Check the current power management status.
   iwconfig wlan0

If the output shows Power Management: on, it needs to be disabled.

  1. Disable Wi-Fi power management using the following command:
   sudo iwconfig wlan0 power off
  1. To make this setting persistent, create or modify a configuration file:
   sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

Edit the contents as follows:

   [connection]
   wifi.powersave = 2

Q2: Why can I ping an IP address, but websites still won’t load?

Cause:
DNS resolution may not be functioning correctly, preventing hostname lookup.

Solution:

  1. Check the current DNS configuration.
   cat /etc/resolv.conf

If the file is blank, no DNS server is configured.

  1. Temporarily specify Google Public DNS.
   sudo nano /etc/resolv.conf

Replace the contents with the following:

   nameserver 8.8.8.8
   nameserver 8.8.4.4
  1. For persistent changes, modify /etc/systemd/resolved.conf:
   sudo nano /etc/systemd/resolved.conf

Example configuration:

   [Resolve]
   DNS=8.8.8.8 8.8.4.4
  1. Apply the changes:
   sudo systemctl restart systemd-resolved

Q3: I’m using Ubuntu in a virtual machine, but there’s no network connection. What should I do?

Cause:
The virtual machine’s network settings may be incorrect.

Solution:

  1. Verify the network mode in the virtualization settings.
  • For VirtualBox:
    Set the virtual machine’s network mode to “NAT” or “Bridged Adapter.”
  • For VMware:
    Set the “Network Adapter” to “Bridged” or “NAT.”
  1. Check interfaces within the virtual machine:
   ip link

If eth0 or ens33 is not in the UP state, enable it:

   sudo ip link set eth0 up
  1. Reacquire an IP address using DHCP:
   sudo dhclient eth0

Q4: My wired LAN is no longer recognized. How can I diagnose the issue?

Cause:
Possible reasons include physical connection issues, driver errors, or incorrect Netplan configuration.

Solution:

  1. Test another cable or port to rule out hardware failure.
  2. Check the status of network interfaces:
   ip link

If no device appears, check the driver:

   lspci | grep -i ethernet
  1. Reinstall the driver if required:
   sudo apt install linux-modules-extra-$(uname -r)
   sudo reboot
  1. Correct the Netplan configuration if necessary:
   sudo nano /etc/netplan/01-netcfg.yaml

Example:

   network:
     version: 2
     renderer: networkd
     ethernets:
       eth0:
         dhcp4: true

Apply the configuration:

   sudo netplan apply

8. Summary

Network connectivity issues in Ubuntu 24.04 can stem from multiple factors. However, most problems can be resolved by performing systematic checks and applying the troubleshooting steps introduced in this guide. By following these procedures, you can achieve the following results:

  • Quick identification and resolution of common issues
  • A better understanding of Netplan configuration and DNS management
  • Optimized network performance in virtual machine environments

If the methods described here do not resolve your issue, consider seeking additional support from the official Ubuntu documentation or community-based forums such as Ask Ubuntu.

Try solutions that best match your environment and enjoy a smoother, more stable Ubuntu networking experience!

Reference Sites

Backend-agnostic network configuration in YAML.…

 

侍エンジニア塾