How to configure static IP address on Ubuntu 24.04

20 mag 2024 1 min di lettura
How to configure static IP address on Ubuntu 24.04
Indice dei contenuti

Introduction

If you like using the command line or need to set up a server without a GUI, the command line method is simple and effective.

Step 1: Open terminal

You can open Terminal by pressing Ctrl + Alt + T or searching for "Terminal" in the applications menu.

Step 2: Identify your network interface

Type the command ip link to see all network interfaces.

ip link

Find the interface you want to configure, such as eth0 for a wired connection or wlan0 for wireless.

Step 3: Edit your Netplan configuration

Ubuntu 24.04 uses Netplan to manage network settings. Find the Netplan configuration files in /etc/netplan/. Open a file with a text editor, for example type:

sudo nano /etc/netplan/01-netcfg.yaml

Step 4: Configure Static IP

Edit the file to add your static IP details. For example:

network:
 version: 2
 renderer: networkd
 ethernets:
 eth0:
 dhcp4: no
 addresses:
 - 192.168.1.100/24
 gateway4: 192.168.1.1
 nameservers:
 addresses:
 - 8.8.8.8
 - 8.8.4.4

Change eth0 to your network interface and adjust IP settings as needed.

Step 5: Apply your changes

Save the file and update the changes with sudo netplan apply.

sudo netplan apply

Check the new settings with ip addr show or by pinging another device.

Conclusion

Whether you like a graphical interface or the command line, setting a static IP address in Ubuntu 24.04 (Noble Numbat) is easy. This setup can make your network more reliable and easier to access. Always test your settings to make sure your network is working as expected.

Support us with a

Successivamente, completa il checkout per l'accesso completo a Noviello.it.
Bentornato! Accesso eseguito correttamente.
Ti sei abbonato con successo a Noviello.it.
Successo! Il tuo account è completamente attivato, ora hai accesso a tutti i contenuti.
Operazione riuscita. Le tue informazioni di fatturazione sono state aggiornate.
La tua fatturazione non è stata aggiornata.