9

I have just upgraded from ubuntu 22.04 to 24.04 LTS. Everything's fine but Internet is not working after being connected.

8 Answers8

5

In my case, I deleted /etc/resolv.conf, renamed /etc/resolv.conf.old to /etc/resolv.conf, and the internet was back. After that the systemd-resolved was installaed to avoid any conflict:

sudo apt install systemd-resolved
Talaat Etman
  • 1,340
5

Upgraded Dell Latitude from 22.04 to 24.04. No internet. Nothing worked.

I changed /etc/NetworkManager/conf.d/dhcp-client.conf to include only

[main]
dhcp=dhcpcd

And then sudo systemctl restart NetworkManager

If this solved your problem, let me know. I spent 4 hours & I don't think, it's worth it. But, if this helps then it'll be.

Have a good one.

Ganesh
  • 191
  • 1
  • 7
3

Known problem https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/2055012

The problem was this: /etc/resolv.conf became a broken link along with systemd-resolve.service. I had to delete them both and write a new resolv.conf to fix the error.

Woorg
  • 31
2

I had the same issue and I will post my solution because I had to combine two of the above (the problem was indeed the bronken /etc/resolv.conf link):

1 rm /etc/resolv.conf

2 sudo dhcpcd (after this I gained access to internet again, necessary for step 3, but in navbar still looked disconnected)

3 sudo apt install systemd-resolved (after this navbar show me connected and everything was fine)

1

This issue is due to a broken symlink on /etc/resolv.conf follow below commands to fix it

  1. rm /etc/resolv.conf
  2. sudo dhcpcd

This should fix the problem

1

If you're encountering this issue, you can check the status of systemd-resolved using the following command:

sudo systemctl status systemd-resolved.service

In my case, it was both inactive and masked. If that's also the case for you, follow these steps:

  1. Unmask the service (only if it's masked):

    sudo systemctl unmask systemd-resolved.service
    
  2. Start the service:

    sudo systemctl start systemd-resolved.service
    
  3. Enable the service (to ensure it starts automatically on boot):

    sudo systemctl enable systemd-resolved.service
    

These steps resolved the issue for me.

1

The issue arises because your previous DHCP network configuration is likely lost after a system upgrade. This is often due to the introduction of netplan, a new network configuration tool that uses systemd-networkd or NetworkManager as renderers. Consequently, simply reinstalling NetworkManager or systemd-resolved will not permanently resolve the problem.

Solution: Recreate DHCP Configuration

While manually starting dhcpcd might provide a temporary fix, the configuration will not persist after a reboot. Therefore, recreating the DHCP configuration is the recommended approach.

Configuration for systemd-networkd (for systems using systemd-resolved):

According to the ArchWiki, if you are using systemd-resolved, the configuration for wired connections should be as follows:

  1. Create or edit the file /etc/systemd/network/20-wired.network and add the following content:

    [Match]
    Name=en*
    

    [Link] RequiredForOnline=routable

    [Network] DHCP=yes

    • [Match] Name=en*: Matches all network interfaces that start with en (typically wired network cards).
    • [Network] DHCP=yes: Enables DHCP.
    • [Link] RequiredForOnline=routable: According to Archwiki's Explaination

prevent systemd-networkd-wait-online.service from exiting before network interfaces have a routable IP address (and thus having other services that require a working network connection starting too early)

Configuration for NetworkManager:

If you are using NetworkManager, according to the ArchWiki, the configuration should be as follows:

  1. Create or edit the file /etc/NetworkManager/conf.d/dhcp-client.conf and add the following content: prevent systemd-networkd-wait-online.service from exiting before network interfaces have a routable IP address (and thus having other services that require a working network connection starting too early),

prevent systemd-networkd-wait-online.service from exiting before network interfaces have a routable IP address (and thus having other services that require a working network connection starting too early),

[main]
dhcp=dhcpcd
  • [main] dhcp=dhcpcd: Tells NetworkManager to use dhcpcd as the DHCP client.
cloud0310
  • 11
  • 2
0

I have faced the same issue in ubuntu:24.04 following solution is working for me. internet issue in ubuntu 24.04