Feature #5822
closed
add an interface 'description' that contains the 'friendly' name 'descr' field
Added by Dirk-Willem van Gulik almost 9 years ago.
Updated over 7 years ago.
Description
/etc/rc.banner and related show the 'descr' field of the interface; with ample options to edit and manage.
Would be very nice if these where also propagated to an '/sbin/ifconfig <iface> description "<desc>"' command to configure the interface.
As these values are picked up by (the most recent) version of (b)snmp in the ifAlias SNMP oid; which is picked up by management consoles.
Files
- Tracker changed from Feature to Bug
- Status changed from New to Duplicate
- Tracker changed from Bug to Feature
Below patch will do the dirty deed. https://github.com//dirkx/Freebsd-src contains a tiny diff that back ports the required intra to 10.2 (as it is not yet all MFCed).
*** interfaces.inc.orig Thu Jan 28 14:48:13 2016
--- interfaces.inc Thu Jan 28 15:16:26 2016
***************
*** 1040,1046 ****
}
foreach ($iflist as $if => $ifname) {
! $realif = $config['interfaces'][$if]['if'];
if (strstr($realif, "bridge")) {
$bridge_list[$if] = $ifname;
} else if (strstr($realif, "gre")) {
--- 1040,1057 ----
}
foreach ($iflist as $if => $ifname) {
! $ifcfg = $config['interfaces'][$if];
! $realif = $ifcfg['if'];
!
! # We need to do this both here -and- in interface_configure; as
! # some interfaces do not need interface_configure; yet changes
! # bypass interfaces_configure.
! #
! if (isset($ifcfg['descr'])) {
! log_error("Wand change");
! mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " description ".escapeshellarg($ifcfg['descr']));
! };
!
if (strstr($realif, "bridge")) {
$bridge_list[$if] = $ifname;
} else if (strstr($realif, "gre")) {
***************
*** 1065,1070 ****
--- 1076,1082 ----
echo gettext("done.") . "\n";
}
}
+
}
/*
***************
*** 3158,3163 ****
--- 3170,3179 ----
$wancfg = $config['interfaces'][$interface];
+ if (isset($wancfg['descr'])) {
+ mwexec("/sbin/ifconfig " . escapeshellarg($wancfg['if']) . " description ".escapeshellarg($wancfg['descr']));
+ };
+
if (!isset($wancfg['enable'])) {
return;
}
Dirk-Willem van Gulik wrote:
Below patch will do the dirty deed. https://github.com//dirkx/Freebsd-src contains a tiny diff that back ports the required intra to 10.2 (as it is not yet all MFCed).
[...]
Note - the infra is ONLY needed to support bsnmpd and similar kernel functions; above patch will work on any recent freebsd release; and update the description field correctly.
Was about to setup a feature request for this.
Can this get into a release as it would be helpful.
Thanks, to Dirk-Willem.
Gareth
Also available in: Atom
PDF