confd: allow interface description as ifAlias

This patch adds support for setting the free form description string as
the interface alias.  This can be read from /sys/class/net/*/ifalias, or
using the 'ip link show' command.  The ifalias is reported by SNMP and
LLDP by default, and now also in the operational datastore.

Linux supports 250 characters in ifalias, but the IF-MIB is restricted
to 64 characters, so we add a local deviation to limit the type.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-10-28 11:04:49 +01:00
parent 710616f8c4
commit 0284e2ca58
6 changed files with 26 additions and 5 deletions
+3
View File
@@ -645,6 +645,9 @@ def add_ip_link(ifname, iface_in, iface_out):
if 'ifindex' in iface_in:
iface_out['if-index'] = iface_in['ifindex']
if 'ifalias' in iface_in:
iface_out['description'] = iface_in['ifalias']
if 'address' in iface_in:
iface_out['phys-address'] = iface_in['address']