Netplan: Bring interface up even if link is down

Published at 19 Feb 2025

Netplan is a utility for easily configuring networking on a linux system.

We can specify a static configuration for an interface, for example eth0.

Here is a basic configuration of a static network interface:

network:
	version: 2
	renderer: networkd
	ethernets:
		eth0:
			addresses:
				- 192.168.50.1/24

Every time the system boot will assing the fixed IP 192.168.50.1 to the eth0 network interface if it's up.

But what happens if the cable is not connected or the link is down, aka there's no carrier? Well, the system will try to get up the interface and will fail due to timeout, so the fixed IP address will never be configured to the interface.

If we have services that bind to that interface, those will also fail.

So, if we want the interface to be up even if there's no connection, we have to set the boolean ignore-carrier property in our Netplan configuration file.

network:
	version: 2
	renderer: networkd
	ethernets:
		eth0:
			ignore-carrier: true
			addresses:
				- 192.168.50.1/24

With this property, even if the cable is not connected, the interface will be up and all the services binded will be running.

This is useful if you're configuring a DHCP server, so the interface is always up waiting for a cable to be connected to start providing DHCP leases.