How to open communication between RHEL server & snmp (udp port 161)
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to open communication between RHEL server & snmp (udp port 161)
Hey Gurus, I'm implementing Solarwinds (snmp udp port 161) as my monitoring tool. I take the following steps:
1- # iptables -A INPUT -p udp --dport 161 -j ACCEPT
# /sbin/service iptables save
2- I edit /etc/hosts.allow and add the IP for the Solarwinds server as follows: snmpd: 129.105.106.0
These two steps usually does the trick, but in some cases it does not. Other than these two steps, what other files need to be edited for this communication to start.
You'd have to start snmpd on the server so it is LISTENing on port 161.
Running "lsof -i :161" would show you if any ports are LISTENing (or otherwise active) on that port.
Running "service snmpd status" on RHEL6 and below would show you whether the snmpd init script has been started. On RHEL7 you'd run "systemctl status snmpd". Substitute "start" for "status" to run the daemons.
Note: Some things might require other services. e.g. on Dell servers we install Dell's Open Manage and our monitoring interrogates MIBs that provides.
I just realized you wrote:
iptables -A INPUT -p udp --dport 161 -j ACCEPT
The "-A" adds to end of chain.
On RHEL5 and RHEL6 the end of the input chain is usually:
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
That causes it to ignore any other rules in the chain after that line. Typically the best way to do this is to use "-I" for insert instead. You also have to specify the line number with -I.
If you run "iptables -nL --line-numbers" you should see all the rules with the line numbers. Use "-D" to delete any rules in INPUT chain beneath the above REJECT line then use the "-I" with appropriate line number to insert the rule somehwere above the REJECT line.
By the way you can restrict the rule to a specific IP (e.g. that of your Solar Winds server) to prevent others from accessing the SNMP on this RHEL server.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.