Discussion:
Network interfaces rename
(too old to reply)
Andreas Haralambopoulos
2015-11-04 07:39:14 UTC
Permalink
Is it possible to change the network interfaces names ( or to create ‘aliases’) ?

for example

snmpwalk -v2c -c password 127.0.0.1


replacing these names

IF-MIB::ifDescr.6 = STRING: vlan10
IF-MIB::ifDescr.7 = STRING: vlan172
IF-MIB::ifDescr.8 = STRING: vlan11
IF-MIB::ifDescr.9 = STRING: vlan12

to

IF-MIB::ifDescr.6 = STRING: Internet
IF-MIB::ifDescr.7 = STRING: dmz
IF-MIB::ifDescr.8 = STRING: guest_lan
IF-MIB::ifDescr.9 = STRING: wifi


thanks

andreas


------------------------------------------------------------------------------
Jurkiewicz Jean-Marc
2015-11-04 08:01:32 UTC
Permalink
If you "aliased" the Interface ( set a description to the interface), you will find MIBs variable (ifAlias = 1.3.6.1.2.1.31.1.1.1.18) that will allow you to display these aliases

[***@nocu07 ~]$ snmpwalk -c MyCS MyRouter 1.3.6.1.2.1.2.2.1.2
.1.3.6.1.2.1.2.2.1.2.1 = STRING: Vlan1
.1.3.6.1.2.1.2.2.1.2.300 = STRING: Vlan300
.1.3.6.1.2.1.2.2.1.2.303 = STRING: Vlan303
.1.3.6.1.2.1.2.2.1.2.304 = STRING: Vlan304
.1.3.6.1.2.1.2.2.1.2.308 = STRING: Vlan308
.1.3.6.1.2.1.2.2.1.2.309 = STRING: Vlan309

[***@nocu07 ~]$ snmpwalk -c MyCS MyRouter 1.3.6.1.2.1.31.1.1.1.18
.1.3.6.1.2.1.31.1.1.1.18.1 = STRING:
.1.3.6.1.2.1.31.1.1.1.18.300 = STRING: Management
.1.3.6.1.2.1.31.1.1.1.18.303 = STRING: FW Services
.1.3.6.1.2.1.31.1.1.1.18.304 = STRING: WAN Access Transfert
.1.3.6.1.2.1.31.1.1.1.18.308 = STRING: Data
.1.3.6.1.2.1.31.1.1.1.18.309 = STRING: IPT

Best regards
JM

-----Message d'origine-----
De : Andreas Haralambopoulos [mailto:***@gmail.com]
Envoyé : mercredi, 4. novembre 2015 08:39
À : net-snmp-***@lists.sourceforge.net
Objet : Network interfaces rename

Is it possible to change the network interfaces names ( or to create ‘aliases’) ?

for example

snmpwalk -v2c -c password 127.0.0.1


replacing these names

IF-MIB::ifDescr.6 = STRING: vlan10
IF-MIB::ifDescr.7 = STRING: vlan172
IF-MIB::ifDescr.8 = STRING: vlan11
IF-MIB::ifDescr.9 = STRING: vlan12

to

IF-MIB::ifDescr.6 = STRING: Internet
IF-MIB::ifDescr.7 = STRING: dmz
IF-MIB::ifDescr.8 = STRING: guest_lan
IF-MIB::ifDescr.9 = STRING: wifi


thanks

andreas


------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-***@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
------------------------------------------------------------------------------
Ulrich Windl
2015-11-04 08:10:41 UTC
Permalink
08:39
Post by Andreas Haralambopoulos
Is it possible to change the network interfaces names ( or to create
‘aliases’) ?
for example
snmpwalk -v2c -c password 127.0.0.1
replacing these names
IF-MIB::ifDescr.6 = STRING: vlan10
IF-MIB::ifDescr.7 = STRING: vlan172
IF-MIB::ifDescr.8 = STRING: vlan11
IF-MIB::ifDescr.9 = STRING: vlan12
to
IF-MIB::ifDescr.6 = STRING: Internet
IF-MIB::ifDescr.7 = STRING: dmz
IF-MIB::ifDescr.8 = STRING: guest_lan
IF-MIB::ifDescr.9 = STRING: wifi
I guess if you do it in the OS, SNMP will see then change.
Post by Andreas Haralambopoulos
thanks
andreas
----------------------------------------------------------------------------
Post by Andreas Haralambopoulos
--
_______________________________________________
Net-snmp-users mailing list
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
------------------------------------------------------------------------------
Jurkiewicz Jean-Marc
2015-11-04 08:56:03 UTC
Permalink
Post by Andreas Haralambopoulos
Is it possible to change the network interfaces names
No : ifDescr (1.3.6.1.2.1.2.2.1.2) is Read-Only ( unless you are the fabricant of the device on which you read it (127.0.0.1) )
Post by Andreas Haralambopoulos
( or to create ‘aliases’) ?
Yes if the device on which you read it (127.0.0.1) support it

Best regards
JM

-----Message d'origine-----
De : Ulrich Windl [mailto:***@rz.uni-regensburg.de]
Envoyé : mercredi, 4. novembre 2015 09:11
À : ***@gmail.com; net-snmp-***@lists.sourceforge.net
Objet : Antw: Network interfaces rename
08:39
Post by Andreas Haralambopoulos
Is it possible to change the network interfaces names ( or to create
‘aliases’) ?
for example
snmpwalk -v2c -c password 127.0.0.1
replacing these names
IF-MIB::ifDescr.6 = STRING: vlan10
IF-MIB::ifDescr.7 = STRING: vlan172
IF-MIB::ifDescr.8 = STRING: vlan11
IF-MIB::ifDescr.9 = STRING: vlan12
to
IF-MIB::ifDescr.6 = STRING: Internet
IF-MIB::ifDescr.7 = STRING: dmz
IF-MIB::ifDescr.8 = STRING: guest_lan
IF-MIB::ifDescr.9 = STRING: wifi
I guess if you do it in the OS, SNMP will see then change.
Post by Andreas Haralambopoulos
thanks
andreas
----------------------------------------------------------------------------
Post by Andreas Haralambopoulos
--
_______________________________________________
Net-snmp-users mailing list
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-***@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
------------------------------------------------------------------------------
David Hauck
2015-11-04 16:42:12 UTC
Permalink
Hi Andreas,
Post by Andreas Haralambopoulos
Is it possible to change the network interfaces names ( or to create
‘aliases’) ?
for example
snmpwalk -v2c -c password 127.0.0.1
replacing these names
IF-MIB::ifDescr.6 = STRING: vlan10
IF-MIB::ifDescr.7 = STRING: vlan172
IF-MIB::ifDescr.8 = STRING: vlan11
IF-MIB::ifDescr.9 = STRING: vlan12
to
IF-MIB::ifDescr.6 = STRING: Internet
IF-MIB::ifDescr.7 = STRING: dmz
IF-MIB::ifDescr.8 = STRING: guest_lan
IF-MIB::ifDescr.9 = STRING: wifi
Not exactly what you're suggesting above but I use the agent's "override" configuration capability to override the entry's ifAlias value. See this thread for details/caveats: https://sourceforge.net/p/net-snmp/mailman/net-snmp-users/?viewmonth=201504&viewday=14.

The equivalent in your situation would be something like:
override IF-MIB::ifAlias.6 octet_str "Internet"
override IF-MIB::ifAlias.7 octet_str "dmz"
override IF-MIB::ifAlias.8 octet_str "guest_lan"
override IF-MIB::ifAlias.9 octet_str "wifi"

I find this a nice alternative because it leaves the read-only values as-is (ifDescr and ifName) while also allowing you specify a user-defined alias for the interface. See also this post for a good summary of the inter-relationship between ifDescr, ifName, and ifAlias:
http://www.irobert.info/display/IRINFO/Understanding+ifDescr,+ifName+and+ifAlias.

Regards,
-David
------------------------------------------------------------------------------
Loading...