Back to articles
Configure static IP address on Netplan
How-ToDevOps

Configure static IP address on Netplan

via Dev.to TutorialSergio Peris

I've recently set up a new Ubuntu Server 24.04 and needed to assign it a static IP address. For a server, you don't want the IP to change whenever DHCP leases expire. Finding your network interface Before making any configuration changes, you need to know the name of your network interface. On Ubuntu Server, you'll likely see something like ens33 or enp0s3 . Run this command to see all network interfaces: ip link Look for the interface that has an IP address assigned to it. That's the one you want to configure. In my case, it was enp0s3 . Configuring Netplan Ubuntu Server 24.04 stores network configuration in /etc/netplan/ . There's usually a file there called something like 50-cloud-init.yaml . Let's check what's in that directory: ls /etc/netplan/ Open the configuration file and you will see something like this by default: vi /etc/netplan/50-cloud-init.yaml network : version : 2 renderer : networkd ethernets : enp0s3 : dhcp4 : true Change it to use a static IP instead. Here's what I

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
6 views

Related Articles