I'm currently working on CentOS 7.3.

In order to activate SNMP, I installed it, configured it and successfully started the service using the firewall-cmd command.

Now, I realized that I need to open the port 161 to make the SNMP start communicating. therefore I ran the following commands below.

$sudo firewall-cmd --permanent --add-port=161/udp --zone-public Success $sudo firewall-cmd --reload Success

After that I checked if the new options are successfully added, and everything turned out to be fine.

But, while trying to check if I had no problem connecting to the port 161 using telnet, I got the following error message.

telnet: connect to address Connection refused
Trying ::1...
telnet: connect to address ::1: No route to host

Is there any part I'm missing in this step?


You cannot telnet snmp port because its not TCP, is UDP;

Try to test it with snmpget command from the net-snmp package :



To provide more understanding please find this post from @tkedwards on linuxquestions.org to understand the result of using telnet to check connectivity on UDP port :

"UDP is a connectionless protocol which means it basically just sends packets out to the specified destination. TCP is connection-oriented which means it establishes a connection to the other end using the '3-way handshake'.

So it makes sense to apply the 'telnet' paradigm to TCP - you make connection to a specific host and port, you still remain connected (for a period of time) even if you aren't sending any data and you can send and receive data continuously without having to reconnect in between.

UDP on the other hand doesn't really fit the telnet model - its more of a fire-and-forget system where you fire-off a series of packets towards the destination. You then go on with something else (or just wait doing nothing) until (or if) the remote process sends some packets back."

So in resume UDP its not something you can really check unless it will give you information back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.