How To Configure a Static IP Address in Ubuntu Effortlessly
If your Ubuntu machine keeps obtainin’ a different IP every time you restart or reconnect — yeah, it’s annoying, especially if you’re hosting stuff or need reliable remote access— this guide should help. Setting a static IP isn’t complicated, but Ubuntu’s network settings can be a little quirky. This fix is mostly for desktops running GNOME, like Ubuntu 22.04 or newer. It’s pretty straightforward but might take a few tries, especially if your network setup isn’t vanilla. Once set, your machine will always use the same IP, which is good for servers or just making your life easier when managing devices.
How to Fix Static IP Issues on Ubuntu — Step-by-Step
Accessing the Network Settings
First, find the Network settings in Ubuntu. It’s usually easy — hover over the top right corner where the network icon lives, click Settings or Wi-Fi/Network. From there:
- Click on Settings
- In the sidebar, select Network
On some setups, you might need to go through the Settings menu from the main system tray, then find Network there.
Locating and Editing Your Connection
Depending on whether you’re wired or Wi-Fi, find your network and click the gear icon to edit:
- For wired, look under Wired
- For Wi-Fi, go to Wi-Fi
It’s kinda weird, but on some systems, you have to select the current network, then click the gear icon to get into the settings.
Switching to Manual IPv4 Settings
In the connection settings, head over to the IPv4 tab. This is usually tucked away — you’ll see the method is probably set to Automatic (DHCP). Change it to Manual. This essentially tells Ubuntu: “Hey, I wanna specify an address myself.”
Inputting Your Static IP Details
Next, fill out the fields with your network info. This is where things can get tricky if you don’t know your network’s IP range or gateway. Here’s what you need:
- Address: Your desired static IP — like
192.168.1.100
- Netmask: Usually
255.255.255.0
- Gateway: Your router’s IP, e.g.,
192.168.1.1
- DNS: Google’s DNS is fine —
8.8.8.8
Tip: On some setups, you might also see IPv4 Addresses and IPv4 Gateway. Just make sure they match what your network uses.
Applying the Changes and Validating
Once all info looks good, hit Apply (top right). Then, toggle the connection off and back on — sometimes it’s needed to kick into effect. After that, open a terminal (Ctrl+Alt+T) and type:
ip a
Look for your network interface (like enp3s0 or wlp2s0) and verify it has the new IP you set. If it’s there, congrats — your static IP is working. If not, go back and double-check your inputs. Maybe rebooting helps if things get weird, but that’s usually not necessary.
Extra Tips & Troubleshooting
Sometimes, setting a static IP doesn’t work right away. Could be your router’s DHCP conflicted or the network settings aren’t quite right. Make sure your static IP doesn’t clash with other devices. Also, verify the Gateway/DNS addresses are correct. If you’re on a network with different subnet settings or VLANs, things get more complicated.
And yeah, on some laptops or machines, NetworkManager can behave weirdly, so don’t be surprised if you need to restart the system or even reset network configs if problems persist.
Summary
- Sort out your network connection from the Settings
- Switch from DHCP to Manual IP configuration in IPv4
- Enter your static IP info carefully
- Apply, toggle the connection, verify with
ip a
Wrap-up
Honestly, once you get the hang of it, setting a static IP on Ubuntu isn’t a big deal. It’s kind of a pain if your network is complex or if Ubuntu’s network manager throws a fit — which it sometimes does — but mostly, if you follow the steps, it sticks. Sure, there might be some trial and error involved, especially with your network info, but this approach has worked on multiple setups. Fingers crossed, this helps someone avoid random IP conflicts or pesky renewals in the future.