0

Does netplan have a field to define an alias (which is generally used for interface descriptions)?

  • 2
    What's your use case here? Do you simply want to 'rename' the interfaces to be more descriptive of what the interface is for? Or are you trying to just have an interface alias to name a specific IP config on the link or such as specifically for something else? (It's unclear what you mean by 'alias' here) – Thomas Ward Feb 6 at 14:20
  • No interfaces to remain the same, but want to provide a description for the port so you know what it is for when doing "ip addr show". Similar to IOS description on interface. This is extremely handy when troubleshooting. Examples: ip link set alias "L2 connection to Google peer" dev enp94s0f0 enp94s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 3c:fd:fe:ba:72:90 brd ff:ff:ff:ff:ff:ff alias L2 connection to Google peer – Tim Epkes Feb 6 at 18:31
  • 1
    Welcome to Ask Ubuntu! The best way to add additional information to your question is by editing it, with the edit button. It is better visible that way, and comments are mainly for secondary, temporary purposes. Comments are removed under a variety of circumstances. Anything important to your question should be in the question itself. – guntbert Feb 7 at 21:54
0

As per https://netplan.io/reference

match (mapping)

  • This selects a subset of available physical devices by various hardware properties. The following configuration will then apply to all matching devices, as soon as they appear. All specified properties must match.

macaddress (scalar)

  • Device’s MAC address in the form “XX:XX:XX:XX:XX:XX”. Globs are not allowed.

set-name (scalar)

  • When matching on unique properties such as path or MAC, or with additional assumptions such as “there will only ever be one wifi device”, match rules can be written so that they only match one device. Then this property can be used to give that device a more specific/desirable/nicer name than the default from udev’s ifnames. Any additional device that satisfies the match rules will then fail to get renamed and keep the original kernel name (and dmesg will show an error).
  • But I am not looking to rename the interface, but give it a description. I still want eno0 to be eno0, but then through Alias (which has been used for a while for this purpose) put a description for that interface (like Connection to firewall) – Tim Epkes Feb 7 at 16:24
  • @TimEpkes You might try this just to see how it names things, as per your spec. Also check the link that I gave for more info. Report back, if you like. Curious minds want to know :-) – heynnema Feb 7 at 16:48
  • network: ethernets: mainif: match: name: "3c:fd:fe:ba:80:e0" set-name: test0 And when I apply (which is successful) it doesn't change the name of the interface or supply it as an alias. – Tim Epkes Feb 7 at 19:07
  • @TimEpkes It didn't change name because you didn't use the correct syntax, name should be macaddress:, so it never matched. See netplan.io/examples – heynnema Feb 7 at 22:27
  • @TimEpkes Status please... – heynnema Feb 16 at 13:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.