Networking Setup

Chapter 9 — Configuring Networking

Networking on Linux is managed by a tool called NetworkManager, which handles both wired and wireless connections automatically on most desktop distros. For the majority of users, network setup is invisible — you plug in an Ethernet cable or click a WiFi network and it just works. This chapter covers the graphical tools, how to configure a static IP address, and what to do when things don't connect as expected.

1. How Linux Networking Is Organised

Like audio, networking in Linux has several layers. You don't need to understand them all in depth, but knowing which layer a problem is at saves a lot of troubleshooting time.

🌐
Applications — Browser, email, SSH, etc.
These use the network through standard system calls. They don't manage connections themselves.
📡
NetworkManager — connection management
Manages which networks you're connected to, handles DHCP, saves WiFi passwords, creates VPN connections. This is what you configure in the GUI settings panel.
⚙️
Linux kernel — network stack and drivers
TCP/IP implementation, routing tables, firewall (iptables/nftables). Network interface drivers live here. You interact with this layer via ip, ss, and ping commands.
🔌
Hardware — Ethernet NIC, WiFi adapter
The physical network interface card or WiFi chip. Requires a matching kernel driver to function.
Server distros use different tools. Ubuntu Server and Debian use systemd-networkd and Netplan instead of NetworkManager for network configuration. This chapter focuses on desktop setups where NetworkManager is the standard. Server networking is a topic for a later, more advanced course.

2. Wired Ethernet

Ethernet is the simplest case. Plug in a cable and NetworkManager connects automatically — it requests an IP address via DHCP from your router and you're online within seconds. No configuration is needed for most home and office setups.

Verify your Ethernet connection

The network icon in your system tray will show a plug symbol when Ethernet is connected. On GNOME, click the top-right corner and look for the wired network status. On Mint/Cinnamon, the network applet in the taskbar shows connection status.

# Check all network interfaces and their status $ ip link show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 ... 2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 ... link/ether a0:b1:c2:d3:e4:f5 brd ff:ff:ff:ff:ff:ff 3: wlp2s0: <BROADCAST,MULTICAST> mtu 1500 ...

Interface names follow a predictable pattern on modern Linux:

  • enp3s0 / ens33 / eth0 — Ethernet (wired) interfaces. en = Ethernet, p3s0 = PCI bus location.
  • wlp2s0 / wlan0 — WiFi (wireless) interfaces. wl = wireless LAN.
  • lo — the loopback interface (127.0.0.1), always present, always up.

Check your IP address

$ ip addr show 2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> inet 192.168.1.105/24 brd 192.168.1.255 scope global dynamic enp3s0 valid_lft 85432sec preferred_lft 85432sec # Or shorter — just show the IP addresses: $ hostname -I 192.168.1.105

3. WiFi — Connecting Graphically

WiFi connection on a Linux desktop is nearly identical to Windows. NetworkManager handles scanning, connecting, and saving passwords automatically.

Ubuntu (GNOME)

  • 1
    Click the top-right corner of the screen to open the quick settings panel. Click the WiFi icon or the arrow next to it.
  • 2
    A list of available networks appears. Click your network name.
  • 3
    Enter the WiFi password when prompted and click Connect. NetworkManager saves the password — you won't need to enter it again.

Linux Mint (Cinnamon) / XFCE / MATE

Click the network icon in the system tray (bottom-right of the screen). Available WiFi networks are listed. Click one, enter the password, and connect. The process is identical in behaviour to Windows.

Managing saved connections

To view, edit, or delete saved WiFi connections, right-click the network icon and choose "Edit Connections" (or Network Connections on Mint). This opens the NetworkManager connection editor where you can see all saved networks, change passwords, set auto-connect behaviour, and configure advanced options.

WiFi not appearing? First check that the WiFi adapter isn't turned off. Look for a hardware switch on the laptop (many have a physical WiFi toggle key, often Fn+F2 or similar). Also check Settings → WiFi to make sure the software toggle is on. If the adapter doesn't appear at all, it may need a proprietary driver — see Chapter 6 on Additional Drivers.

4. WiFi — Connecting from the Terminal

If you need to connect to WiFi without a graphical interface (a server install, a broken desktop, or an SSH session), use nmcli — the NetworkManager command-line tool.

# List all visible WiFi networks $ nmcli device wifi list IN-USE SSID MODE CHAN RATE SIGNAL SECURITY MyHomeNetwork Infra 6 130 Mbit/s 87 WPA2 Neighbour_5G Infra 36 405 Mbit/s 52 WPA2 # Connect to a network (will prompt for password) $ nmcli device wifi connect "MyHomeNetwork" password "mysecretpassword" Device 'wlp2s0' successfully activated with '...' # Show all saved/active connections $ nmcli connection show # Disconnect from current WiFi $ nmcli device disconnect wlp2s0 # Reconnect to a saved network by name $ nmcli connection up "MyHomeNetwork"

5. Checking Connectivity from the Terminal

A handful of terminal commands are invaluable for diagnosing network problems. These work on every Linux distro and are worth knowing even if you rarely use the terminal.

CommandWhat it doesExample
ping Sends packets to a host and reports if they arrive. Tests basic connectivity. ping -c 4 google.com
ip addr Shows IP addresses assigned to all network interfaces. ip addr show enp3s0
ip route Shows the routing table — how traffic is directed to destinations including the default gateway. ip route show
nmcli NetworkManager CLI — manage connections, check status, connect to WiFi. nmcli device status
ss Shows open network sockets — which ports are listening and which connections are active. ss -tuln
dig / nslookup DNS lookup — resolves a hostname to an IP address. Tests DNS is working. dig google.com
curl Makes HTTP/HTTPS requests. Quick test for internet connectivity and web server responses. curl -I https://google.com
traceroute Shows the path packets take to reach a destination — identifies where a connection fails. traceroute google.com

A quick connectivity test sequence

# 1. Is the interface up and do I have an IP address? $ ip addr show # Look for "inet x.x.x.x" under your interface — if missing, no DHCP lease # 2. Can I reach my router (replace with your gateway IP)? $ ping -c 3 192.168.1.1 # If this fails: physical connection problem or wrong gateway # 3. Can I reach the internet by IP (bypasses DNS)? $ ping -c 3 8.8.8.8 # If this fails but step 2 works: router/ISP problem # 4. Can I resolve domain names (tests DNS)? $ ping -c 3 google.com # If this fails but step 3 works: DNS problem

6. Setting a Static IP Address

By default, your computer gets an IP address from your router via DHCP — the address can change each time you reconnect. For home servers, printers, or any device you want to reach by a fixed address, a static IP is useful.

Router reservation vs static IP on the device. The easiest approach for home use is to configure a DHCP reservation in your router settings — the router always gives the same IP to your computer's MAC address. This avoids configuring anything on the Linux side. Static IP configuration on the device itself is useful when you don't control the router (office networks, VPSes) or need an address outside the DHCP range.

Graphical method — NetworkManager

  • 1
    Click the network icon in the system tray → click the gear icon next to your active connection, or open Settings → Network and click the gear next to your connection.
  • 2
    Go to the IPv4 tab.
  • 3
    Change the method from "Automatic (DHCP)" to "Manual".
  • 4
    Enter your settings. Here's an example for a typical home network:
Example static IP configuration — home network (192.168.1.x)
Address
192.168.1.50
Choose an address outside your router's DHCP range to avoid conflicts. Check your router settings for the DHCP range — often .100–.200, so .50 is safe.
Netmask
255.255.255.0
Also entered as /24. Standard for home networks.
Gateway
192.168.1.1
Your router's IP address. Run ip route | grep default to find it if unsure.
DNS
1.1.1.1, 8.8.8.8
Cloudflare (1.1.1.1) and Google (8.8.8.8) are reliable public DNS servers. Or use your router's IP as DNS (it forwards to your ISP).
  • 5
    Click Apply, then disconnect and reconnect the network connection for the static IP to take effect.

Terminal method — nmcli

# Find your connection name first $ nmcli connection show NAME UUID TYPE DEVICE Wired a1b2c3... ethernet enp3s0 MyHomeNetwork d4e5f6... wifi wlp2s0 # Set a static IP on the wired connection $ nmcli connection modify "Wired" \ ipv4.method manual \ ipv4.addresses 192.168.1.50/24 \ ipv4.gateway 192.168.1.1 \ ipv4.dns "1.1.1.1,8.8.8.8" # Apply the change by bouncing the connection $ nmcli connection down "Wired" && nmcli connection up "Wired" # Revert to DHCP if needed $ nmcli connection modify "Wired" ipv4.method auto ipv4.addresses "" ipv4.gateway "" ipv4.dns "" $ nmcli connection down "Wired" && nmcli connection up "Wired"

7. DNS Configuration

DNS (Domain Name System) translates hostnames like google.com into IP addresses. On most desktop installations, NetworkManager handles DNS automatically using your router's DNS server. You can override this with faster or more privacy-respecting public DNS servers.

Check current DNS servers

$ resolvectl status Global Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported resolv.conf mode: stub Link 2 (enp3s0) Current Scopes: DNS Protocols: +DefaultRoute Current DNS Server: 192.168.1.1 DNS Servers: 192.168.1.1

Popular public DNS servers

  • Cloudflare1.1.1.1 and 1.0.0.1 — fast, privacy-focused, no logging
  • Google8.8.8.8 and 8.8.4.4 — very reliable, widely used
  • Quad99.9.9.9 — blocks known malicious domains automatically

Set DNS via NetworkManager as shown in the static IP section above, or in the graphical IPv4 settings panel of your connection.

8. Troubleshooting Common Network Problems

No internet after connecting to WiFi — shows "connected" but nothing loads
Run the 4-step connectivity test from Section 5. If you can ping 8.8.8.8 but not google.com, the problem is DNS. Try ping 1.1.1.1 — if that works too, set a manual DNS server via NetworkManager (1.1.1.1 or 8.8.8.8). Restart the connection after changing DNS. If 8.8.8.8 also fails, the problem is upstream of your machine — check your router.
WiFi disconnects frequently or has an unstable signal
Power management: Linux WiFi drivers sometimes aggressively power-down the adapter to save battery, causing dropouts. Disable WiFi power management:
sudo iwconfig wlp2s0 power off
To make this permanent, create /etc/NetworkManager/conf.d/wifi-powersave-off.conf containing:
[connection]
wifi.powersave = 2
Then restart NetworkManager: sudo systemctl restart NetworkManager.
WiFi adapter not detected — no networks appear at all
1. Check ip link show — if no wl interface appears, the driver isn't loaded. Run lspci | grep -i wireless or lsusb | grep -i wireless to identify the chip. Search for "[chip name] Linux driver" — Broadcom and some Realtek chips require proprietary packages.

2. Try the Ubuntu/Mint Additional Drivers tool (Chapter 6). It detects and installs Broadcom drivers automatically if connected via Ethernet.
Ethernet not working — cable plugged in but no connection
Check ip link show — the Ethernet interface should show UP and LOWER_UP when a cable is connected. If it shows DOWN, the cable or port may be faulty — try a different cable and port.
If UP but no IP address: sudo dhclient enp3s0 forces a new DHCP request. If that fails, check your router's DHCP server is enabled.
Can't connect to a specific WiFi network (wrong password error even with correct password)
Delete the saved connection and reconnect from scratch. In NetworkManager connection editor, find the network in the saved list and delete it. Or via terminal: nmcli connection delete "NetworkName". Then reconnect as if for the first time and re-enter the password carefully — pay attention to case sensitivity.
NetworkManager not running — nmcli gives "Error: NetworkManager is not running"
Start and enable NetworkManager:
sudo systemctl start NetworkManager
sudo systemctl enable NetworkManager
If it fails to start, check the logs: sudo journalctl -u NetworkManager -n 50. On server distros that use Netplan/networkd instead, NetworkManager may be intentionally absent.

Chapter Summary

TopicKey points
NetworkManager Manages all connections on desktop Linux. Handles DHCP, saves WiFi passwords, creates VPNs. Configured via GUI tray icon or nmcli in terminal.
Ethernet Auto-connects on cable insertion. Check with ip link show (interface should be UP) and ip addr show (should have an inet address).
WiFi (GUI) Click network tray icon → select network → enter password. NetworkManager saves the password and reconnects automatically.
WiFi (terminal) nmcli device wifi list to scan, nmcli device wifi connect "Name" password "pass" to connect.
Connectivity test Ping gateway → ping 8.8.8.8 → ping google.com. Failure at each step tells you which layer the problem is at.
Static IP Set via NetworkManager GUI (IPv4 → Manual) or nmcli connection modify. Prefer router DHCP reservation for home use.
DNS Managed automatically by NetworkManager. Override with 1.1.1.1 (Cloudflare), 8.8.8.8 (Google), or 9.9.9.9 (Quad9) for speed or privacy.
WiFi dropout fix Disable power management: create /etc/NetworkManager/conf.d/wifi-powersave-off.conf with wifi.powersave = 2.
Next: Chapter 10 — Installing software. We cover the Software Centre graphical tool, the basics of apt and dnf/yum, and the universal package formats Flatpak, Snap, and AppImage.