Set Up a Static IP Address
January 8, 2025
Written by Sean David Reed
OS/Distro: Ubuntu 24.04.1 LTS
Using the GUI
-
Open settings and navigate to Wi-Fi.
-
Locate your connection and click the gear icon.
-
Select the IPv4 tab and set IPv4 Method to Manual.
-
Populate the Address, Netmask, Gateway, and DNS fields with the following values:
- Address: 192.168.x.x - It's often easiest to find the current dynamic IP address and simply make that one static. Run
$ hostname -I. Otherwise, you can select one from the IP range: Find Router IP Range - Netmask: 255.255.255.0
- Gateway: 192.168.x.x - Find this IP by running
$ route -n - DNS: 208.67.222.222, 208.67.220.220 - OpenDNS Nameservers
- Address: 192.168.x.x - It's often easiest to find the current dynamic IP address and simply make that one static. Run
-
You're Done!
Using the Command Line
-
sudo apt install network-manager -
nmcli -dto identify network interface -> wlp1s0 -
Open netplan config file,
sudo vim /etc/netplan/50-cloud-init.yaml, and make sure it says the following:network: wifis: wlp1s0: optional: true access-points: "<SSID>": password: "<password>" dhcp4: false addresses: - <static-ip-of-your-choice>/24 routes: - to: default via: <router-private-ip> nameservers: addresses: [208.67.222.222, 208.67.220.220] -
sudo netplan apply. This command may log you out. To log back in,ssh username@static-ip-you-chose. -
Done!





