简体   繁体   English

SSH 可以工作,但无法 PING 和访问 Raspberry Pi 3B 的 VNC 查看器

[英]SSH works but cannot PING and access VNC viewer for Raspberry Pi 3B

On my Mac terminal, I can get my Pi ip address using this command line:在我的 Mac 终端上,我可以使用以下命令行获取我的 Pi ip 地址:

arp -n raspberrypi.local arp -n 树莓派.local

it return the IP address of the pi.它返回 pi 的 IP 地址。 and then I can absolutely SSH into the raspberry pi using these command lines:然后我可以绝对 SSH 使用这些命令行进入树莓派:

ssh-keygen -R raspberrypi.local ssh pi@raspberrypi.local ssh-keygen -R raspberrypi.local ssh pi@raspberrypi.local

However if I ping the pi, it return request timeout and I also cannot access the vnc viewer.但是,如果我 ping pi,它会返回请求超时,我也无法访问 vnc 查看器。

PING from Network Utility来自网络实用程序的 PING

Everything worked just fine when I first log in to this raspberry pi but then this happened.当我第一次登录这个树莓派时,一切都很好,但后来发生了这种情况。

A device not responding to ping doesn't mean it has a problem.设备不响应 ping 并不意味着它有问题。 "Ping" packets (https://it.wikipedia.org/wiki/Internet_Control_Message_Protocol ) have to be allowed to reach a destination and the destinations has to be allowed to reply.必须允许“Ping”数据包(https://it.wikipedia.org/wiki/Internet_Control_Message_Protocol )到达目的地,并且必须允许目的地回复。 Usually there's a firewall allowing/denying this kind of traffic.通常有一个防火墙允许/拒绝这种流量。

Assuming the services you're speaking about, are correctly running on the machine (server) you want to connect to:假设您正在谈论的服务在您要连接的机器(服务器)上正确运行:

  • ssh runs on port 22: a firewall policy need top be in place to allow you (the client) to connect to the server on port 22 ssh 在端口 22 上运行:需要设置防火墙策略以允许您(客户端)在端口 22 上连接到服务器
  • vnc runs on port 5900 (and above) according to the configuration: also in this situation, a firewall policy has to be in place to allow you (the client) to connect to the server vnc 根据配置在端口 5900(及以上)上运行:同样在这种情况下,必须设置防火墙策略以允许您(客户端)连接到服务器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM