[英]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.