First of all we check how our ip address "situation" is with one of these two commands:
As showed above in the screenshoot, I only have the network interface called enp0s4 without an IP address. So I am going to assign an IP static to this network interface.
Before we go on with this procedure I will recommend you to backtup your file "netplan" (is where the configurations are written in yml format in Ubuntu).
(This commands are valid for Ubuntu 20.4)
sudo nano /etc/netplan/01-netcfg.yaml
Did you notice any error below?
Ctrl+C and then Ctrl+X (Y and Enter)
Now we confirm the new configuration on the netplan with this command:
sudo netplan apply
After that we can analyze how all the operations went regarding the new configuration of the netplan with this command:
sudo netplan --debug apply
In case the interface is down you can use also the below command to correct that.
ip link set up (name of the interface)