Set Up a Static IP Address


January 8, 2025
Written by Sean David Reed
OS/Distro: Ubuntu 24.04.1 LTS

Using the GUI

  1. Open settings and navigate to Wi-Fi.

  2. Locate your connection and click the gear icon.

  3. Select the IPv4 tab and set IPv4 Method to Manual.

  4. 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
  5. You're Done!


Using the Command Line

  1. sudo apt install network-manager

  2. nmcli -d to identify network interface -> wlp1s0

  3. 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]
  4. sudo netplan apply. This command may log you out. To log back in, ssh username@static-ip-you-chose.

  5. Done!