Posted on • Originally published atsertxu.dev
Netplan: Bring interface up even if link is down
Netplan is a utility for easily configuring networking on a linux system.
We can specify a static configuration for an interface, for exampleeth0
.
Here is a basic configuration of a static network interface:
network:version:2renderer:networkdethernets:eth0:addresses:-192.168.50.1/24
Every time the system boot will assing the fixed IP192.168.50.1
to theeth0
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 booleanignore-carrier
property in our Netplan configuration file.
network:version:2renderer:networkdethernets:eth0:ignore-carrier:trueaddresses:-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.
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse