Skip to main content
riteshpv
Staff
Staff
December 16, 2024

Technical Tip: Configuration to validate regarding SNMP trap on FortiSwitch

  • December 16, 2024
  • 0 replies
  • 841 views
Description This article describes an understanding of the requirements for enabling SNMP traps (v1/v2) on a FortiSwitch.
Scope FortiSwitch all models on v7.2, v7.4, v7.6.
Solution

To enable SNMP traps, follow the steps below:

 

  • Allow SNMP Access on the FortiSwitch Interface:

Ensure that SNMP access is enabled on the FortiSwitch interface that will respond to SNMP queries. For example:

 

config system interface
    edit "internal"
        config secondaryip
            edit 1
                set ip 192.168.1.99 255.255.255.0
                set allowaccess ping https ssh snmp
            next
        end
    next
end

 

For SNMP v1/ v2:

  • Enable SNMP on the FortiSwitch:


Activate SNMP on the system using the following configuration:

 

config system snmp sysinfo
    set status enable
end

 

  • Configure SNMP Community Settings:


Use the following steps to configure SNMP community settings:

  • Specify the events that require SNMP traps. The list of available events can be found under the config system snmp community.
  • Configure the FortiSwitch interface that will send traps to the SNMP server. In this example, the 'internal' interface is used.
  • Provide a community name (for example: 'public'). Ensure that the SNMP server uses the same community string or update it accordingly.
  • Importantly need to set the server IP to which the trap is to be sent.
  • Enable traps for SNMP v1 or SNMP v2, as needed. For each protocol:
    Set the local port (trap-v1-lport or trap-v2c-lport) and a remote port (trap-v1-rport or trap-v2c-rport) for communication. The default port is 162.

 

Example Configuration:

 

config system snmp community
    edit 1
    set events cpu-high mem-low log-full intf-ip ent-conf-change llv sensor-fault sensor-alarm fan-detect psu-status ip-conflict tkmem-hb-oo-sync
        config hosts
            edit 1
                set interface "internal"
                set ip 192.168.1.101 255.255.255.255
                set source-ip 0.0.0.0
            next
        end
            set name "public"
            set trap-v1-lport 162
            set trap-v1-rport 162
            set trap-v1-status enable
            set trap-v2c-lport 162
            set trap-v2c-rport 162
            set trap-v2c-status enable
    next
end

 

A similar config can be pushed from FortiGate managing FortiSwitch.

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!