Netplan – Set a static IP

From Ubuntu 18+ netplan is the embedded configurator tool for the server edition.

When there is not carrier, even if correctly set from a syntax perspective in yaml netplan config file, the network interface will not show an IP address.

The solution is to add the keyword “ignore-carrier: true” like below that by default is set to false in the yaml file of netplan.

Code:

    ethernets:
        eth0:
            dhcp4: false
            addresses: [192.168.101.1/24]
            nameservers:
                addresses: [8.8.8.8, 8.8.4.4]
            ignore-carrier: true