简体   繁体   English

从同一网络上的另一台计算机Ping Raspberry Pi

[英]Ping Raspberry Pi from another computer on the same network

I have set up an ad hoc network between two laptops. 我已经在两台笔记本电脑之间建立了一个临时网络。 One of the laptops is connected directly to the Raspberry Pi via Ethernet. 其中一台笔记本电脑通过以太网直接连接到Raspberry Pi。 This laptop can ping and SSH into the Raspberry Pi just fine. 这台笔记本电脑可以ping并通过SSH进入Raspberry Pi。 How do I get the second laptop to be able to ping the Raspberry Pi? 我如何获得第二台能够对Raspberry Pi进行ping操作的笔记本电脑?

The IP of the Raspberry Pi is 192.168.137.99, the Ethernet ipv4 address of the laptop connected to the Pi is 192.168.137.1, and I have set the address of the Wireless LAN adapter Wi-fi on the second laptop as 192.168.137.2. Raspberry Pi的IP为192.168.137.99,连接到Pi的便携式计算机的以太网ipv4地址为192.168.137.1,并且我已将第二台便携式计算机上的无线LAN适配器Wi-fi的地址设置为192.168.137.2。 The second laptop can ping 192.168.137.1, but not 192.168.137.99 (destination host unreachable). 第二台笔记本电脑可以ping 192.168.137.1,但不能ping 192.168.137.99(目标主机不可达)。 The first laptop (192.168.137.1) cannot ping 192.168.137.2, it says destination host unreachable. 第一台笔记本电脑(192.168.137.1)无法ping 192.168.137.2,表示目标主机无法访问。 The subnet masks are all 255.255.255.0. 子网掩码均为255.255.255.0。 I am pretty new to this so any advice is appreciated. 我对此很陌生,因此任何建议都值得赞赏。

Usually people use routers for that. 通常人们为此使用路由器。 Get a home router, ensure it has DHCP server on, connect all 3 devices to the router however you want (with cable or wifi), setup the devices to use automatic IP address, they'll get 3 IP addresses from the router's DHCP server, and you'll be able to ping them however you want. 获取家用路由器,确保其具有DHCP服务器,将所有3台设备连接到路由器(使用电缆或wifi进行连接),将设备设置为使用自动IP地址,它们将从路由器的DHCP服务器中获取3个IP地址,然后您可以按自己的意愿ping它们。

If you don't have a router or don't want to use it, there's another option. 如果您没有路由器或不想使用它,则还有另一种选择。 You can setup the laptop that has Pi connected to act as a network bridge. 您可以设置连接有Pi的笔记本电脑作为网桥。 Here's how. 这是如何做。 This way this laptop will route these IP packets between your 2 network (one Ethernet with the Pi, another one WiFi with your second laptop). 这样,此笔记本电脑将在您的2个网络之间路由这些IP数据包(一个Pi带有一个以太网,另一个笔记本电脑带有一个WiFi)。 Because it will be no DHCP server on your network, you'll have to setup IP addresses manually. 由于它不是网络上的DHCP服务器,因此您必须手动设置IP地址。 Make sure all 3 devices use different IP addresses from the same subnet, 192.168.137.* with mask 255.255.255.0 should work just fine. 确保所有3个设备使用来自同一子网192.168.137。*且掩码为255.255.255.0的不同IP地址都可以正常工作。

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

相关问题 可以 ping,但不能连接到同一网络中另一台机器上托管的端点 - Can ping, but not connect to endpoint hosted on another machine from the same network 从同一网络中的另一台计算机访问本地网站 - Access local website from another computer in the same network 从另一台远程计算机ping远程计算机并获取结果 - Ping remote computer from another remote computer and get result back 无法通过同一网络中的另一台计算机访问通过Eclipse在JBoss EAP中运行的Web应用程序 - A web application running in JBoss EAP through Eclipse cannot be accessed from another computer in the same network 访问同一网络中另一台计算机上的Shiny应用程序 - Access to Shiny app in another computer within the same network 从树莓派到Windows平台 - from raspberry pi to Windows platform 无法从在同一网络上运行的计算机访问本地主机 - Can't access localhost from computer running on same network 在网络上的另一台计算机上启动进程 - Start a process on another computer on the network 连接本地网络中的另一台计算机 - Connect another computer in local network 将数据从树莓派发送到 java 应用程序? - Sending data from a raspberry pi to a java application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM