This project has moved and is read-only. For the latest updates, please go here.

Change default SNMP port

Topics: feature request (I want ...)
Jul 29, 2008 at 4:38 PM
Hi,

Is there a way to change the SNMP port?  As far as I can tell, the default port (0xa1 = 161) is always used and can't be modified. 

Allowing it to be changed (similar to the timeout) could come in handy.


Thx.
-Trev
Jul 30, 2008 at 3:03 AM
Hi Trev.

First, you can always modify #SNMP source code to achieve that :-)

Second, I want to explain on my implementation. Because most network devices outside who support SNMP monitor incoming SNMP packets at port 161, as a manager library, it is rational that #SNMP sends packets to 161 port by default.

Third, the only port number that can be changed in #SNMP is the trap listener port. Normally #SNMP trap listener component monitors port 162 on the local machine. But you can ask it to monitor another port.

BTW, do you have a network device that does require a change from port 161 to another? Which vendor designs such a model? If this vendor proves to be a major one in the market, I can do modifications in #SNMP to officially support the port overriding feature you asked.

Regards,

Lex
Jul 31, 2008 at 7:44 PM
Hi,

No, my devices all use 161 as the default but I'm also able to change it if I wanted. 

Here's my situation:
I have a number of devices behind a router that I want to poll.  I'm currently forwarding port 161 to one of the devices and am able to successfully poll that device.  But, every time I want to poll a different device, I have to change the port forwarding.  What I thought would be handy is to forward a different port for each of the other devices and just change the port number in #SNMP to poll those devices.


-Trev
Aug 1, 2008 at 2:28 AM
Hi, Trev,

I think I can update #SNMP library as you wish. Other people may come across similar issues like your case because I know devices behind routers are hard to manage. However, it will take extra time, so I can only add this feature after UnicornHorn Refresh (1.1).

-Lex
Aug 2, 2008 at 2:55 PM
Trev, latest news! The thing you want is added in Change Set 14851. However, this breaks the existing API since 0.5. Have a look at the Source Code tab above.

-Lex
Marked as answer by lextm on 10/6/2013 at 9:14 PM