Ubuntu 20.04.1 LTS系统WiFi已连接但无网络问题求助
Hey there, sorry to hear you're stuck with this annoying WiFi glitch—let's walk through some troubleshooting steps that often fix this exact issue:
Check your IP address & DHCP status
First, make sure your system is getting a valid IP from your router. Open a terminal and run:ip addr show wlan0
(If your wireless interface isn'twlan0, replace it with the correct name—you can find it usingip link show.)
Look for an IP that starts with something like192.168.x.xor10.x.x.x. If you see a169.254.x.xaddress, that means your system couldn't get an IP from the DHCP server. Try releasing and renewing the lease with:sudo dhclient -r wlan0 && sudo dhclient wlan0Restart the NetworkManager service
Temporary glitches in the network service are super common. Restart it with:sudo systemctl restart NetworkManager
Wait a few seconds, then check if your internet works.Fix DNS resolution issues
Sometimes you're connected but can't resolve domain names. Test this by pinging a public IP:ping 8.8.8.8
If this works but pinginggoogle.comdoesn't, your DNS settings are messed up. You can manually set a reliable DNS like Google's:- Open NetworkManager from the top bar, go to your WiFi network's settings.
- Under the IPv4 tab, switch from "Automatic (DHCP)" to "Automatic (DHCP) addresses only".
- Add
8.8.8.8and8.8.4.4to the DNS servers list, then save.
Disable WiFi power saving
Ubuntu's default power saving can sometimes interfere with stable WiFi connections. Edit the power save config:sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
Changewifi.powersave = 3towifi.powersave = 2, save the file (Ctrl+O, Enter) and exit (Ctrl+X), then restart NetworkManager again.Update your wireless drivers & system
Outdated drivers or system packages might cause compatibility issues. Run these commands to update everything:sudo apt update && sudo apt upgrade -y
Reboot your system after the update finishes, then test the WiFi.Reset NetworkManager configurations
If none of the above works, corrupted connection profiles might be the culprit. Delete old profiles and start fresh:sudo rm /etc/NetworkManager/system-connections/*
Restart NetworkManager, then reconnect to your WiFi network.
If you still have no luck, share more details like your wireless card model (run lspci | grep Network or lsusb if it's a USB adapter) and the output of dmesg | grep wlan0—that'll help narrow down the issue further!
备注:内容来源于stack exchange,提问作者Stranger

