Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
16
rated 0 times [  16] [ 0]  / answers: 1 / hits: 80880  / 2 Years ago, sun, june 19, 2022, 9:27:47

I have configured SNMP Agent in my system with ip address 192.168.1.1 I have configured SNMP Agent in it using the following tutorial



I have modified the lines as follows



In the file /etc/snmp/snmpd.conf



 rocommunity public 127.0.0.1
rocommunity public 192.168.1.0/24
rocommunity public 192.168.2.0/24


In the file /etc/default/snmpd



SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'


When I try to use the snmpwalk command from the system with ip address 192.168.1.1 it works fine.



Ex: A chunk of the commands output:



iso.3.6.1.2.1.1.1.0 = STRING: "Linux devenv 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10
iso.3.6.1.2.1.1.3.0 = Timeticks: (74328) 0:12:23.28
iso.3.6.1.2.1.1.4.0 = STRING: "Me <[email protected]>"
iso.3.6.1.2.1.1.5.0 = STRING: "devenv"
iso.3.6.1.2.1.1.6.0 = STRING: "Sitting on the Dock of the Bay"
iso.3.6.1.2.1.1.7.0 = INTEGER: 72


But when I try to use snmpwalk through a different system with ip 192.168.2.1 it gives No response from 192.168.1.1. Please Help.



snmpwalk -c public -v1 192.168.1.1 | less


PS I have configured the same steps on the machine with ip address 192.168.2.1. Or is there any other program that will be used.



EDIT 1.



Did netstat here is a screenshot



Snmpd netstat


More From » 12.04

 Answers
3

Edit the file /etc/snmp/snmpd.conf. Change the line:



agentAddress  udp:127.0.0.1:161


to:



agentAddress  udp:161


Then restart snmpd:



sudo service snmpd restart


It should listen to all interfaces now:



$ sudo netstat -ulnp | grep 161
udp 0 0 0.0.0.0:161 0.0.0.0:* 8517/snmpd

[#29415] Monday, June 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ofunn

Total Points: 164
Total Questions: 116
Total Answers: 116

Location: Liberia
Member since Fri, Oct 22, 2021
3 Years ago
ofunn questions
;