Project

General

Profile

Actions

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.

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

0%

Estimated time:
Plus Target Version:
Release Notes:

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

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
Actions #1

Updated by Jim Pingle almost 9 years ago

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

Duplicate of #1557

Actions #2

Updated by Jim Pingle almost 9 years ago

  • Tracker changed from Bug to Feature
Actions #3

Updated by Dirk-Willem van Gulik almost 9 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;
      }
Actions #4

Updated by Dirk-Willem van Gulik almost 9 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.

Actions #6

Updated by Gareth Hay over 7 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

Actions

Also available in: Atom PDF