[systemd-devel] networkd: how to match the only interface?

Roman Odaisky roma at qwertty.com
Tue Jun 16 01:04:16 UTC 2020


Hi,

I would like to assign a static IP address to a server in a way that survives 
hardware replacement. Basically I want the configuration to say: “Find the only 
physical interface present and assign this static IP address to it. In the 
unexpected case of finding multiple interfaces, assign the address to some 
interface”.

The problem I’m trying to avoid is that if the hardware of a headless server 
fails, then moving its drive(s) to another server may cause it to become 
inaccessible if the name of the link becomes different.

Similarly, if I prepare a USB drive to troubleshoot headless server issues, I 
need to have it assign an address to at least one interface without knowing in 
advance what its name is.

What would be appropriate .link/.network entries that achieve this and avoid 
assigning the same address to more than one interface or interfering with 
virtual interfaces?

-- 
TIA
Roman.




More information about the systemd-devel mailing list