SNMP GET and SET Operation

I am new to SNMP technology. I was trying to set the value for MOSCALAR OID.

I tried to use command line tool to update the value of OID. Below is the command
SnmpSet.exe -r: -p:161 -v:2c -o:. -val:ShabodiPhase2 -tp:Str -c:public

I see the message as OK. But when I try to get the same OID value it is not showing Updated value.

From the logs I see the message my Agent received is not coming from but it was showing some random port number like / Can I know the reason for this random port? Is there a way to modify the Agent to receive from Port number 161 instead of random Port

I think you have to ask the vendor of SnmpSet.exe about the ports, but keep in mind, that you are using UDP. UDP is connection less. Thus, source port and target port are not connected.

The above is not related to the source port. It might be caused by mixing up target ports for the GET and SET operations though.

1 Like

I have tried to use DefaultTcpTransportMapping for each SNMP request. But still I see the local port and target port are different. Can I modify to use same local port for each SNMP GET and SET request.