Rename Interface



  • I saw an old thread on this from 2011 I believe but did not see an answer. Is there a way to rename the interfaces? WAN = em0 ; Can I change the em0 to WAN so that when I'm doing SNMP it shows me the interface. This is only because we have roughly 1,500 PfSense servers and each one is configured a little differently.

    So can it be done? Or should it be something I program in the monitoring service? Which is Zabbix btw.

    Thanks for the help in advance


  • Rebel Alliance Global Moderator

    So your not talking about rename of the optX interface you create that is say on em0 or em3, etc.. You want a snmp query to get answered with wan or lan, or whatever you call em1, 2 or 3, etc..

    Hmmm?  Off the top I would think you want to pull ifAlias vs ifName from snmp.. But not sure what the mibs for pfsense use for the ifAlias, I would guess it should be whatever label you put on the interface when rename them in the gui..

    Sorry never a need to look into this much.. But I would think it possible to do for sure if not in the gui directly, or if snmp not pulling already for ifAlias to map that in the snmp conf on the pfsense box directly…. I would have to do a snmpwalk to see what comes back for ifAlias on my pfsense box, etc.



  • @johnpoz:

    So your not talking about rename of the optX interface you create that is say on em0 or em3, etc.. You want a snmp query to get answered with wan or lan, or whatever you call em1, 2 or 3, etc..

    Hmmm?  Off the top I would think you want to pull ifAlias vs ifName from snmp.. But not sure what the mibs for pfsense use for the ifAlias, I would guess it should be whatever label you put on the interface when rename them in the gui..

    Sorry never a need to look into this much.. But I would think it possible to do for sure if not in the gui directly, or if snmp not pulling already for ifAlias to map that in the snmp conf on the pfsense box directly…. I would have to do a snmpwalk to see what comes back for ifAlias on my pfsense box, etc.

    Okay, I'll look more into the MIBs. The MIB's to me are always confusing sense I have never messed with monitoring any systems. I know what they are for, but my confusion is where to put/apply/upload etc the MIB's to.. If that makes sense.

    But that works, I know what you mean so I'll continue the small search to learn more about MIB's.

    I'll leave the thread here until tonight to see if anyone else replies.

    Much thanks!!


  • Rebel Alliance Global Moderator

    what OID is your system grabbing.. if its coming back ifname ie em0, eth1, igb3, etc.. Then its most likely ifName and not IfAlias or IfDescr



  • @johnpoz:

    what OID is your system grabbing.. if its coming back ifname ie em0, eth1, igb3, etc.. Then its most likely ifName and not IfAlias or IfDescr

    Network interface discovery: Outgoing network traffic on em3 net.if.out[em3] 1m 7d 365d Zabbix agent Network interfaces Enabled
    Network interface discovery: Outgoing network traffic on em2 net.if.out[em2] 1m 7d 365d Zabbix agent Network interfaces Enabled
    Network interface discovery: Outgoing network traffic on em1 net.if.out[em1] 1m 7d 365d Zabbix agent Network interfaces Enabled
    Network interface discovery: Outgoing network traffic on em0 net.if.out[em0] 1m 7d 365d Zabbix agent Network interfaces Enabled
    Network interface discovery: Outgoing network traffic on igb0 net.if.out[igb0] 1m 7d 365d Zabbix agent Network interfaces Enabled

    Does this show what you were asking? I do apologize.

    Edit:
    Template OS FreeBSD: Incoming network traffic on {#IFNAME} net.if.in[{#IFNAME}] 1m 7d 365d Zabbix agent Network interfaces Yes
    Template OS FreeBSD: Outgoing network traffic on {#IFNAME} net.if.out[{#IFNAME}] 1m 7d 365d Zabbix agent Network interfaces Yes


  • Rebel Alliance Global Moderator

    I am not seeing ifAlias anywhere.. All I can seem to find is

    user@ubuntu:~$ snmpwalk -v 2c -c public 192.168.9.6 iso.3.6.1.2.1.2.2.1.2
    iso.3.6.1.2.1.2.2.1.2.1 = STRING: "em0"
    iso.3.6.1.2.1.2.2.1.2.2 = STRING: "em1"
    iso.3.6.1.2.1.2.2.1.2.3 = STRING: "em2"
    iso.3.6.1.2.1.2.2.1.2.4 = STRING: "em3"
    iso.3.6.1.2.1.2.2.1.2.5 = STRING: "lo0"
    iso.3.6.1.2.1.2.2.1.2.6 = STRING: "enc0"
    iso.3.6.1.2.1.2.2.1.2.7 = STRING: "pflog0"
    iso.3.6.1.2.1.2.2.1.2.8 = STRING: "pfsync0"
    iso.3.6.1.2.1.2.2.1.2.9 = STRING: "em2.200"
    iso.3.6.1.2.1.2.2.1.2.10 = STRING: "em2.100"
    iso.3.6.1.2.1.2.2.1.2.11 = STRING: "em2.300"
    iso.3.6.1.2.1.2.2.1.2.12 = STRING: "em2.500"
    iso.3.6.1.2.1.2.2.1.2.13 = STRING: "em2.600"
    iso.3.6.1.2.1.2.2.1.2.14 = STRING: "gif0"

    It should be 1.3.6.1.2.1.31.1.1.1.18

    But just come back blanks..

    user@ubuntu:~$ snmpwalk -v 2c -c public 192.168.9.6 1.3.6.1.2.1.31.1.1.1.18
    iso.3.6.1.2.1.31.1.1.1.18.1 = ""
    iso.3.6.1.2.1.31.1.1.1.18.2 = ""
    iso.3.6.1.2.1.31.1.1.1.18.3 = ""
    iso.3.6.1.2.1.31.1.1.1.18.4 = ""
    iso.3.6.1.2.1.31.1.1.1.18.5 = ""
    iso.3.6.1.2.1.31.1.1.1.18.6 = ""
    iso.3.6.1.2.1.31.1.1.1.18.7 = ""
    iso.3.6.1.2.1.31.1.1.1.18.8 = ""
    iso.3.6.1.2.1.31.1.1.1.18.9 = ""
    iso.3.6.1.2.1.31.1.1.1.18.10 = ""
    iso.3.6.1.2.1.31.1.1.1.18.11 = ""
    iso.3.6.1.2.1.31.1.1.1.18.12 = ""
    iso.3.6.1.2.1.31.1.1.1.18.13 = ""
    iso.3.6.1.2.1.31.1.1.1.18.14 = ""

    But there should be a way to add it.. Been a long time since done anything with snmp… Maybe someone will stop by that does this sort of thing all the time..

    You might have some good luck here?
    https://redmine.pfsense.org/issues/5822



  • I realise its old but a lot of people seem to be landing here and viewing. I manged to solve this by using the earlyshellcmd and adding it to the pfsense config file eg (you might be able to do multiple earlyshellcmds of run a script but i wanted it simple, and wasnt going to assume the path was setup)

    [2.4.4-RELEASE][kraduk@pfSense.localdomain]/home/cscott: head -6 /cf/conf/config.xml
    <?xml version="1.0"?>
    <pfsense>
            <version>18.8</version>
            <lastchange></lastchange>
            <system>
                    <earlyshellcmd>/sbin/ifconfig em3 name WAN;/sbin/ifconfig em2 name LAN; /sbin/ifconfig em1 name DMZ2;/sbin/ifconfig em0 name DMZ1; </earlyshellcmd>