Ubuntu Server Static IP

I want to set up a static IP address on an Ubuntu Server 24.04.2 LTS virtual machine running through QEMU (I am using Virtual Machine Manager). My host system is Ubuntu 24.04.2 LTS.

When I run the hostname -I command on the host, I get: 192.168.15.1 192.168.202.86

The current IP address of my guest (virtual) machine is: 192.168.15.185 (when I chose the dynamic IP)

I tried to configure a static IP during the installation, but when I selected 192.168.15.185, the installer reported that “the internet is offline”

I chosen this:

Subnet: 192.168.15.0/24
Address: 192.168.15.185
Gateway: 192.168.15.254

My questions are:

1-How do I properly set a static IP address on Ubuntu Server?
2-Is the process the same for a physical (real) machine?

Ubuntu uses netplan to configure network device settings, please see the documentation at:

https://netplan.readthedocs.io/en/stable/

3 Likes

Thank you for your help

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.