You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Ubuntu 16.04 LTS服务器每次重启后网络禁用问题求助

Fix Ubuntu 16.04 LTS Network Disabling After Reboot

Hey there, let's troubleshoot why your server's network keeps getting disabled every time it reboots. Since you can get it working via recovery mode, the hardware and core drivers are probably fine—this is likely a configuration or service startup issue. Here are the steps I'd recommend:

1. Verify Your Network Configuration File

The main culprit is often a missing or incorrect setting in /etc/network/interfaces. This file tells Ubuntu how to configure your network on boot.

  • First, check the current config with:
    cat /etc/network/interfaces
    
  • Look for lines like this (replace eth0 with your actual network interface name—you can find it with ip link show):
    auto eth0
    iface eth0 inet dhcp
    
    • The auto eth0 line is critical—it tells Ubuntu to bring up this interface automatically on boot. If it's missing, add it.
    • If you use a static IP instead of DHCP, your config should look like:
      auto eth0
      iface eth0 inet static
      address 192.168.1.100
      netmask 255.255.255.0
      gateway 192.168.1.1
      dns-nameservers 8.8.8.8 8.8.4.4
      
  • After editing, save the file and restart the network service to test:
    sudo systemctl restart networking
    
    Then reboot to see if the network stays enabled.

2. Check NetworkManager vs. Traditional Networking Service

Ubuntu 16.04 can use either NetworkManager (common on desktops) or the traditional networking service. Sometimes these two conflict, causing the network to fail on boot.

  • Check which service is running:
    sudo systemctl status NetworkManager
    sudo systemctl status networking
    
  • If you're using a server (not a desktop), the traditional networking service is usually preferred. Disable NetworkManager to avoid conflicts:
    sudo systemctl stop NetworkManager
    sudo systemctl disable NetworkManager
    sudo systemctl enable networking
    sudo systemctl start networking
    
  • If you need NetworkManager (e.g., for dynamic network setups), make sure it's enabled on boot:
    sudo systemctl enable NetworkManager
    

3. Ensure Network Services Start on Boot

Sometimes the network service isn't set to start automatically. Double-check with:

sudo systemctl is-enabled networking

If it returns disabled, enable it:

sudo systemctl enable networking

4. Check for Driver Loading Issues (Less Likely, But Worth Checking)

In rare cases, the network adapter driver might not load on boot. To verify:

  • List your network adapter and its driver:
    lspci -k | grep -A 3 Ethernet
    
    Look for the Kernel driver in use: line to find the driver name.
  • If the driver isn't loading, try manually loading it:
    sudo modprobe <driver-name>
    
  • To make it load automatically on boot, add the driver name to /etc/modules:
    echo "<driver-name>" | sudo tee -a /etc/modules
    

After trying these steps, reboot your server and see if the network comes up automatically. If none of these work, feel free to share the output of ip link show and cat /etc/network/interfaces and we can dig deeper!

内容的提问来源于stack exchange,提问作者Michael Lin

火山引擎 最新活动