大网数据广告活动
服务器运维问答

Linux - opened port, but still fail to connect to it using telnet

· 52CE 我爱测

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 …

问题原文

原帖链接 · marshallslee · CC BY-SA 3.0

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.

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

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

已采纳解答

原帖链接 · DoruH · CC BY-SA 3.0

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

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

http://net-snmp.sourceforge.net/tutorial/tutorial-5/commands/snmpget.html

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-08-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。