To configure the snmpd
daemon to listen on a specific IP address, you can use the agentAddress
option in the snmpd
configuration file (usually /etc/snmp/snmpd.conf
).
The agentAddress
option specifies the IP addresses or interfaces that the snmpd
daemon should bind to and listen on.
To bind the snmpd
daemon to a specific IP address, you can add the following line to the snmpd
configuration file:
agentAddress udp:192.0.2.1:161
This will configure the snmpd
daemon to listen on the IP address 192.0.2.1
, using the UDP protocol and port 161.
You can also use the agentAddress
option to bind the snmpd
daemon to multiple IP addresses or interfaces.
For example, to bind the snmpd
daemon to the IP addresses 192.0.2.1
and 192.0.2.2
, you can use the following line:
agentAddress udp:192.0.2.1:161, udp:192.0.2.2:161
To bind the snmpd
daemon to all available interfaces, you can use the any
keyword, like this:
agentAddress udp:any:161
Keep in mind that the snmpd
daemon must be restarted or reloaded for the changes to take effect. You can use the systemctl
command to restart or reload the snmpd
daemon, like this: