-->
🏠 🔍
SHAREOLITE

Change SNMP Trap port in Linux [SOLVED]

By default SNMP services uses two UDP ports. 


Port 161 - Manager sends request to the client on this port
Port 162 - Manager receives the traps from client on this port

Sometimes it may be required , you will need to change the destination SNMP port while sending the traps to the SNMP Manager . Below method may be used for this requirement.

To change the SNMP traps destination port  ,

Step 1 : Edit the snmpd.conf file  -  For example - /usr/local/share/snmpd.conf

Step 2 : Locate for the SNMP manager trap configuration

It should be something like below
trap2sink ManagerIP CommunityName
Example - trap2sink 10.1.1.2 public

Step 3 : Edit the trap2sink parameter and suffix the required port to the Manager IP seperated by a delimiter colon (:) 

For example , trap2sink 10.1.1.2:5566 public  

This causes SNMP traps to be sent to port 5566 to the SNMP manager 10.1.1.2 instead of port 162.

Step4 : Save the file . Restart SNMPD services . Command service network restart would do.

Hope this tip helps to some geeks.
Comments

–>