Setting a Static IP on Ubuntu Server

Follow this guide to set a static IP on your Ubuntu Server, ensuring reliable networking for your HomeLab.

Backup the Current Netplan Configuration

sudo cp /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml.bk

Open the Netplan Configuration File

sudo nano /etc/netplan/00-installer-config.yaml

Modify the Configuration

network:
      ethernets:
        ens160:
          dhcp4: no
          addresses: [10.10.10.5/24]
          gateway4: 10.10.10.1
          nameservers:
            addresses: [8.8.8.8, 8.8.4.4]
      version: 2

Save and Close the File

Save your changes and exit the text editor.

Apply the New Network Settings

sudo netplan apply

Verify the Changes

ip a show ens160