Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Netplan: Bring interface up even if link is down
Sergio Peris
Sergio Peris

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
Enter fullscreen modeExit fullscreen mode

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
Enter fullscreen modeExit fullscreen mode

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)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I'm Sergio Peris, aka Sertxu Developer, I'm a DevOps engineer and a network administrator
  • Location
    Spain
  • Joined

More fromSergio Peris

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp