Missed deadlines due to network issues? Setting a static IP on Ubuntu 24LTS might save your day.
There was a time when a missed deadline wasn’t just a minor inconvenience—it was a cascade of frustration sparked by my server’s flaky IP address.
I was juggling both wired and wireless devices on my Ubuntu 24LTS server, and every time DHCP shuffled IPs, my remote connections dropped like bad calls.
That’s when I discovered the power of setting a static IP.
It’s more than just a network tweak—it’s the foundation of stability for any serious setup.
If you’ve faced unpredictable network behavior, this guide will help you take control.
Ready to fix your network once and for all? Keep reading.
What Is a Static IP and Why Does It Matter?
A static IP address is a fixed network address manually assigned to a device, as opposed to one dynamically given by a DHCP server.
Why does this matter? When running servers or critical services, unpredictable IP changes can break connections, interrupt workflows, or make remote access a nightmare.
Think of a static IP as giving your server a permanent “home address” in your network, so clients, scripts, or other devices always know where to find it — no surprises, no guesswork.
For anyone managing infrastructure on Ubuntu 24LTS, especially in a multi-device environment, a static IP is foundational to stability and reliability.
· · ─ ·𖥸· ─ · ·
Wired vs Wireless Interfaces: What’s the Difference in Setup?
On Ubuntu 24LTS, network interfaces have different names for wired and wireless devices—typically something like:
- Wired:
eth0
, or modern versions useenpXsX
(predictable network interface names) - Wireless:
wlan0
, orwlpXsX
Configuring static IPs differs mainly because wireless interfaces often require additional settings like SSID and security credentials, whereas wired interfaces are simpler plug-and-play.
In your configuration files (usually under /etc/netplan/
), you’ll specify the interface name and tailor settings accordingly.
Understanding which device you’re configuring is key to avoiding misconfigurations that cause network outages or failure to connect.
· · ─ ·𖥸· ─ · ·
How to Set a Static IP on Ubuntu 24LTS Server
Step 1: Identify Your Network Interface
To start, we need to identify the network interface for which we want to set a static IP. Whether you’re working with an Ethernet (wired) connection or a Wi-Fi interface, the first step is to determine the correct network interface name.
Use the following command to list all available network interfaces:
ip a
Look for your interface names. Ethernet interfaces are usually named something like enp0s3
or eth0
, while Wi-Fi interfaces are often labeled as wlp2s0
or wifi0
. If you are uncertain, you can also use iwconfig
for more detailed Wi-Fi interface information.
Step 2: Edit Netplan Configuration File
Ubuntu 24LTS uses Netplan as its default tool to manage network configurations. These configurations are stored in YAML files under the /etc/netplan/
directory. In an already running server, you may find configuration files such as 00-installer-config.yaml
or 01-netcfg.yaml
. To begin, open the appropriate configuration file for editing:
sudo nano /etc/netplan/01-netcfg.yaml
Now, modify the configuration to set a static IP address. Below are example configurations for both wired and wireless interfaces:
- For Wired (Ethernet) Device:
network:
version: 2
renderer: networkd
ethernets:
enp0s3: # Replace with your interface name
dhcp4: no
addresses:
- 192.168.1.100/24 # Replace with your desired static IP address
gateway4: 192.168.1.1 # Replace with your gateway (usually your router's IP)
nameservers:
addresses:
- 8.8.8.8 # DNS servers (Google's DNS servers)
- 8.8.4.4
- For Wireless (Wi-Fi) Device:
network:
version: 2
renderer: networkd
wifis:
wlp2s0: # Replace with your Wi-Fi interface name
dhcp4: no
addresses:
- 192.168.1.100/24 # Replace with your desired static IP address
gateway4: 192.168.1.1 # Replace with your gateway IP
nameservers:
addresses:
- 8.8.8.8 # DNS servers
- 8.8.4.4
access-points:
"your-wifi-ssid":
password: "your-wifi-password" # Replace with your Wi-Fi details
Make sure to adjust the following:
enp0s3
orwlp2s0
: The actual name of your network interface.192.168.1.100/24
: Your preferred static IP and subnet mask.192.168.1.1
: Your router’s IP address as the default gateway."your-wifi-ssid"
: Your Wi-Fi network name (SSID)."your-wifi-password"
: Your Wi-Fi password (for wireless connections).8.8.8.8
and8.8.4.4
: DNS servers (you can use others like1.1.1.1
for Cloudflare’s DNS).
Step 3: Apply the Changes
Once you have edited and saved the configuration file, apply the changes using Netplan:
sudo netplan apply
This will apply the static IP configuration to your system. You can verify that the new static IP is set by running:
ip a
This will display all network interfaces and their assigned IP addresses. Ensure that the interface you configured is showing the correct static IP.
Step 4: Verify Connectivity
After applying the changes, you should verify that your network setup is functioning correctly. You can check the routing information to confirm that your default gateway is properly set:
ip route
To test DNS resolution, you can use dig
or nslookup
:
dig google.com
If everything is configured properly, the system should be able to resolve domain names and maintain a stable connection to the network.
· · ─ ·𖥸· ─ · ·
Troubleshooting Common Static IP Issues
Even with perfect syntax, you might hit snags. Here are a few things to watch for:
- IP conflicts: Ensure your chosen static IP isn’t in use by another device or inside your DHCP range, or you’ll get network collisions.
- Network Manager interference: Sometimes, Network Manager can override manual configs—disable it or adjust its settings if needed.
- Missing DNS servers: Forgetting to specify DNS can leave you connected but unable to reach websites or remote servers.
- Apply changes properly: Always run
sudo netplan apply
after editing config files to activate new settings. - Reboot when stuck: A reboot can sometimes clear hanging network states that prevent new IPs from sticking.
With a bit of patience and these tips, you’ll save yourself hours of hair-pulling.
· · ─ ·𖥸· ─ · ·
Why Setting a Static IP on Ubuntu 24LTS Will Transform Your Workflow
Network stability isn’t optional—it’s essential.
Whether managing wired or wireless devices, a static IP locks your server’s address in place, eliminating sudden drops and saving you hours of troubleshooting.
No more lost connections. No more missed deadlines.
For more practical, open-source solutions to everyday tech challenges, subscribe to my newsletter and get exclusive guides delivered straight to your inbox:
https://www.samgalope.dev/newsletter/
Stability starts with one simple step. Don’t miss out.
Leave a Reply