You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

重装Ubuntu后无法连接家庭WiFi,DHCP疑似故障(静态IP可用)

Fixing Ubuntu WiFi DHCP Issue After Reinstallation

Hey there, I’ve dealt with this exact kind of head-scratcher before—reinstalling Ubuntu, only to have your home WiFi refuse to connect via DHCP while other networks work fine. Let’s walk through some practical fixes to get this sorted:

1. Verify NetworkManager & DHCP Service Status

First, make sure the core network service is running properly:

  • Open a terminal and check NetworkManager’s status:
    sudo systemctl status NetworkManager
    
  • If you see it’s inactive or throwing errors, restart and enable it:
    sudo systemctl start NetworkManager
    sudo systemctl enable NetworkManager
    
    This ensures the service starts automatically on boot too.

2. Reset NetworkManager Configuration

Old cached settings from your previous install might be interfering. Let’s wipe them clean:

  • Back up existing configs first (just in case):
    sudo mv /etc/NetworkManager/NetworkManager.conf /etc/NetworkManager/NetworkManager.conf.bak
    sudo mv /var/lib/NetworkManager /var/lib/NetworkManager.bak
    
  • Restart NetworkManager to generate fresh configs:
    sudo systemctl restart NetworkManager
    
    Now try connecting to your home WiFi again.

3. Switch to a Different DHCP Client

Ubuntu uses dhclient by default, but sometimes swapping to dhcpcd resolves compatibility issues with certain routers:

  • Install dhcpcd5:
    sudo apt update && sudo apt install dhcpcd5
    
  • Modify NetworkManager to use this new client:
    sudo nano /etc/NetworkManager/NetworkManager.conf
    
    Add this line under the [main] section:
    dhcp=dhcpcd
    
  • Save the file (press Ctrl+O, hit Enter, then Ctrl+X), then restart NetworkManager:
    sudo systemctl restart NetworkManager
    

4. Troubleshoot Your Home Router

Don’t rule out the router being the culprit—even if it worked before:

  • Reboot the router: Unplug it for 30 seconds, plug it back in, and wait 5 minutes before testing the connection.
  • Check DHCP pool limits: Log into your router’s admin panel (usually at 192.168.1.1 or 192.168.0.1) and make sure the DHCP address pool isn’t full. If it is, expand the range or release unused IPs.
  • Verify MAC filtering: If your router has MAC address filtering enabled, confirm your Ubuntu machine’s WiFi MAC address is on the allowed list. You can find your MAC with:
    ip link show | grep wlan0
    
    (Replace wlan0 with your actual WiFi interface name if needed.)

5. Diagnose DHCP Traffic with Packet Capture

To narrow down where the issue lies, capture DHCP traffic:

  • Run this command in the terminal (replace wlan0 with your WiFi interface):
    sudo tcpdump -i wlan0 port 67 or port 68
    
  • Try connecting to your home WiFi while the capture runs. You’ll see:
    • If you see DHCPDISCOVER messages but no DHCPOFFER, the router isn’t responding—focus on router troubleshooting.
    • If you don’t see any DHCPDISCOVER messages at all, the problem is on the Ubuntu side, so revisit the earlier steps.

6. Manually Specify DHCP Server Address

If all else fails, force your Ubuntu machine to use your router as the DHCP server:

  • Open Network Settings, select your home WiFi network, and click "Settings".
  • Go to the IPv4 tab, change the method from "Automatic (DHCP)" to "Automatic (DHCP) addresses only".
  • In the "DHCP server" field, enter your router’s IP address (usually 192.168.1.1 or 192.168.0.1).
  • Save the settings and reconnect.

内容的提问来源于stack exchange,提问作者James B

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:01:29