If you don't set static IP in Ubuntu Server's installer he trying receive IP by DHCP protocol.
Ethernet interfaces are identified by the system using predictable network interface names. These names can appear as eno1 or enp0s25. However, in some cases an interface may still use the kernel eth# style of naming. Documentation.
# Detecting interfaces
Use "ip address" or "ip a" command for finding your network interfaces:
Open /etc/netplan/00-installer-config.yaml file for show your default settings:
# Setting static IP
Since Ubuntu Server 22.04 deprecated "gateway4" parameter and structure of /etc/netplan/00-installer-config.yaml file changed. New network configuration file's structure:
For Ubuntu Server before 22.04 /etc/netplan/00-installer-config.yaml file's stucture should be like this:
WARNING: if you set old configurations in Ubuntu Server 22.04 or higher you get this error:
# Reload Netplan
The network configuration abstraction renderer. Netplan is a utility for easily configuring networking on a linux system. You simply create a YAML description of the required network interfaces and what each should be configured to do. From this description Netplan will generate all the necessary configuration for your chosen renderer tool. Official site.
Netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators, installers, cloud image instantiations, or other OS deployments. During early boot, Netplan generates backend specific configuration files in /run to hand off control of devices to a particular networking daemon.
Netplan currently works with these supported renderers:
- NetworkManager
- Systemd-networkd
Now apply new configurations: