pysnmp
pysnmp copied to clipboard
Binding source port used in nextCmd
I am using nextCmd method in pysnmp.hlapi to fetch information. But I also watch the network and saw that every SNMP request is sent from another port from sender device. I could not find the API to bind the port that is used to sent SNMP from. I got following conversation in my wireshark and I want to reduce the size of it by fixing the source port.
192.168.0.104:49805 <-> 192.168.0.1:161 192.168.0.104:49806 <-> 192.168.0.1:161 192.168.0.104:49808 <-> 192.168.0.1:161 192.168.0.104:49809 <-> 192.168.0.1:161
I got nearly 13k conversation that is sent from different ports if 104 to 1. How to bind the port?
It is determined by your source code. If you use a single SNMP engine (and its transport dispatcher), then a single port is used on the manager side.