You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using pysnmp library to listen traps sent to my server from FQDN address on port 162. Below is the code for FQDN address. It is taken from official documentation, I also set IP to FQDN. My IP localhost to fqdn.dns.com. Instead of IP address
It makes no sense to bind to your public IP address (usually what you mapped to a domain name), as your machine does not own that IP address.
You are trying to run a trap listener app at port 162, and handle external UDP/SNMP traffic with it. Thus, it should bind to one of the network adapters of this machine, or all of them. For IPv4 scenarios, that means either the private IP address assigned to the adapter (like 192.168.0.x or simply 0.0.0.0).
Hi,
I am using pysnmp library to listen traps sent to my server from FQDN address on port 162. Below is the code for FQDN address. It is taken from official documentation, I also set IP to FQDN. My IP localhost to fqdn.dns.com. Instead of IP address
snmp_engine = engine.SnmpEngine()
config.addTransport(snmp_engine,
udp.domainName,
udp.UdpSocketTransport().openServerMode(('fqdn.dns.com', 162)))
I am getting below error when I run my script
File "/usr/lib/python3/dist-packages/pysnmp/carrier/asyncore/dgram/base.py", line 48, in openServerMode
self.socket.bind(iface)
OSError: [Errno 99] Cannot assign requested address
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./lib/snmp.py", line 316, in listen_for_traps
udp.UdpSocketTransport().openServerMode(('fqdn.dns.com', 162)))
File "/usr/lib/python3/dist-packages/pysnmp/carrier/asyncore/dgram/base.py", line 50, in openServerMode
raise error.CarrierError('bind() for %s failed: %s' % (iface, sys.exc_info()[1],))
pysnmp.carrier.error.CarrierError: bind() for ('fqdn.dns.com', 162) failed: [Errno 99] Cannot assign requested address
The text was updated successfully, but these errors were encountered: