Skip to main content
jmedinaherrer
Staff
Staff
Aug 5, 2019 12:53 PM UTC

Technical Tip: Changing default ports for SNMP

  • Apr 16, 2026 12:44 PM UTC
  • 0 replies
  • 5015 views
  • Translate All

Description
This article describes the default ports used for SNMP traffic on the FortiGate platforms and how to change them.
Further information on SNMP can be found here

 

Scope

 

FortiGate.

Solution


The FortiGate SNMP traffic is by default configured to use ports 161 (for queries) and 162 (for traps). Use the following commands to change these default ports:

 

config system snmp community
    edit <index_number>
        set query-v1-port <port_number>        <---- port that the FortiGate should open for queries
        set trap-v1-lport <port_number>        <---- local port for traps
        set trap-v1-rport <port_number>        <---- remote port for traps
        set query-v2c-port <port_number>
        set trap-v2c-lport <port_number>
        set trap-v2c-rport <port_number>
end

 

The option is also available on the GUI, as shown below:

 

In SNMPv3, local and remote trap ports can be changed as follows:

 

GUI:

 

SNMPv3-1.jpg

 

CLI:

 

FG61F-Home # config system snmp user

FG61F-Home (user) # edit Test
FG61F-Home (Test) # set trap-lport 164

FG61F-Home (Test) # set trap-rport 1045

 

Related article:

Technical Tip: Configuring SNMP when VDOM is enabled

Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024