Project

General

Profile

Feature #5822

add an interface 'description' that contains the 'friendly' name 'descr' field

Added by Dirk-Willem van Gulik over 3 years ago. Updated about 2 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Interfaces
Target version:
-
Start date:
01/27/2016
Due date:
% Done:

0%

Estimated time:

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.

ifconfig--descr-pfsense.diff (1.54 KB) ifconfig--descr-pfsense.diff patch to pfsense (HEAD) for ifconfig description functionality Dirk-Willem van Gulik, 01/28/2016 10:04 AM
bsnmpd-descr-ifAlias.diff (134 KB) bsnmpd-descr-ifAlias.diff patch to freebsd 10.2; back porting ifAlias to also(optionally) making bsnmpd to pick it up. Dirk-Willem van Gulik, 01/28/2016 10:04 AM

History

#1 Updated by Jim Pingle over 3 years ago

  • Tracker changed from Feature to Bug
  • Status changed from New to Duplicate

Duplicate of #1557

#2 Updated by Jim Pingle over 3 years ago

  • Tracker changed from Bug to Feature

#3 Updated by Dirk-Willem van Gulik over 3 years ago

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;
      }

#4 Updated by Dirk-Willem van Gulik over 3 years ago

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.

#6 Updated by Gareth Hay about 2 years ago

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