Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Linux Ethernet Configuration: Set Up Wired Network

· 5 min read · Home Networking

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Configuring Ethernet on Linux ensures your system has a stable, high-speed network connection, essential for servers, streaming, gaming, or remote access. Unlike Wi-Fi, wired connections don’t rely on signal strength or interference and often provide lower latency and higher throughput. This guide covers static and DHCP configuration using command-line tools common across most Linux distributions. Before you begin, ensure your system has a physical Ethernet port and a properly connected cable. You’ll also need administrator privileges to modify network settings.

What You'll Need

  • A Linux system with an Ethernet port
  • An Ethernet cable connected to a router or switch
  • Administrator (sudo) access
  • Basic familiarity with the terminal

Step-by-Step

  1. Identify your Ethernet interface by running ip link show. Look for an interface named something like eth0, enp3s0, or eno1. Note the exact name — it varies by system.
  2. Check if the interface is up by looking for the word UP in the output. If it says DOWN, bring it up with sudo ip link set [interface-name] up, replacing [interface-name] with your actual interface.
  3. Verify network connectivity by running ping -c 4 8.8.8.8. If you get replies, your system already has DHCP connectivity. If not, proceed to configure manually.
  4. To use DHCP (automatic IP assignment), run sudo dhclient [interface-name]. This requests an IP address from your router. Wait a few seconds, then run ip addr show [interface-name] to confirm an IP was assigned.
  5. To set a static IP, edit the network configuration file. On systemd-networkd systems (Ubuntu 18.04+, CentOS 8+, Fedora), create or edit /etc/systemd/network/10-eth.network with sudo nano /etc/systemd/network/10-eth.network. Add:
[Match]
Name=[interface-name]

[Network]
DHCP=no
Address=192.168.1.100/24
Gateway=192.168.1.1
DNS=8.8.8.8
DNS=8.8.4.4
  1. On older systems using NetworkManager, use nmcli: sudo nmcli con add type ethernet ifname [interface-name] ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns 8.8.8.8,8.8.4.4 ipv4.method manual.
  2. On systems using netplan (Ubuntu 18.04+), edit the YAML file in /etc/netplan/ (e.g., 01-netcfg.yaml). Replace its content with:
network:
  version: 2
  ethernets:
    [interface-name]:
      dhcp4: no
      addresses:
        - 192.168.1.100/24
      gateway4: 192.168.1.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
  1. Apply netplan changes with sudo netplan apply. For systemd-networkd, restart with sudo systemctl restart systemd-networkd.
  2. Test the configuration: ping your gateway (ping -c 4 192.168.1.1), then ping an external site like ping -c 4 google.com.
  3. Make the configuration persistent across reboots. On most modern systems, the above methods are persistent by default. If not, ensure the network service is enabled: sudo systemctl enable systemd-networkd or sudo systemctl enable NetworkManager.

Common Mistakes

  • Using the wrong interface name — double-check with ip link before applying settings.
  • Typing an incorrect subnet mask (e.g., using /32 instead of /24) — this breaks local network access.
  • Configuring a static IP in the same range as your router’s DHCP pool — this causes IP conflicts. Always choose an IP outside the DHCP range (e.g., if DHCP gives 192.168.1.100–199, use 192.168.1.200).
  • Forgetting to set a gateway, which prevents internet access even if local ping works.
  • Editing the wrong config file — different distributions use different tools (netplan vs. NetworkManager vs. systemd-networkd). Check your distribution’s documentation.

Tips

  • Use ip route show to see your current routing table — this confirms the default gateway is set.
  • If you’re configuring a server, leave DHCP enabled for simplicity unless you need a fixed IP for DNS or port forwarding.
  • Always back up config files before editing: sudo cp /etc/netplan/01-netcfg.yaml /etc/netplan/01-netcfg.yaml.bak.
  • Use nmcli dev show [interface-name] to see detailed interface information, including connection state and IP assignments.
  • For headless systems, configure Ethernet before disconnecting the console — you may lose access if misconfigured.

Troubleshooting

  • If ping 8.8.8.8 fails but ping 192.168.1.1 works, your gateway is reachable but DNS or outbound routing is broken. Check cat /etc/resolv.conf to confirm DNS servers are listed. If empty, manually add nameserver 8.8.8.8 to that file temporarily.
  • If the interface won’t come up, check for driver issues: dmesg | grep -i ethernet. Look for errors like eth0: Failed to initialize.
  • If NetworkManager is running but not managing the interface, run nmcli device status. If the interface shows unmanaged, edit /etc/NetworkManager/NetworkManager.conf and remove or comment out the line unmanaged-devices=interface-name:[interface-name].
  • On some systems, Ethernet is disabled in BIOS/UEFI. Reboot, enter firmware settings, and ensure the onboard LAN is enabled.
  • If no network interface appears at all, the hardware may be missing or faulty. Run lspci | grep -i ethernet to verify detection. If nothing appears, the card may need replacement.

Frequently Asked Questions

How do I find my Ethernet interface name in Linux?

Run ip link show. The interface names are listed as eth0, enp3s0, eno1, etc. Look for the one marked as UP or with a MAC address.

Can I configure Ethernet without a GUI?

Yes. All steps in this guide use terminal commands. GUI tools like GNOME Network Settings exist but are not required.

Why does my Ethernet connection drop after a reboot?

You likely didn’t enable the network service or misconfigured the persistent config file. Ensure systemd-networkd or NetworkManager is enabled and your config file is properly formatted and saved.

Do I need a static IP for a home server?

Not necessarily, but it’s recommended. A static IP ensures your server’s address doesn’t change, which is critical for port forwarding, remote access, or DNS records.

What if my router doesn’t assign an IP via DHCP?

Check that DHCP is enabled on your router. If it’s disabled, you must manually assign a static IP on the Linux system within the router’s subnet, and set the gateway manually.

Is Ethernet faster than Wi-Fi on Linux?

Yes, typically. Ethernet avoids wireless interference, signal degradation, and latency spikes. Speeds are limited only by your cable and hardware, not by radio conditions.