[Ubuntu 18.04]
我的连接设置如下:
笔记本电脑(Wifi:192.168.43.181)<--> Jetson 1 [ROS MASTER](Wifi:192.168.43.2)|(以太网:10.42.0.1)<--> Jetson 2(以太网:10.42.0.2)
笔记本电脑和 jetson2 之间没有直接连接(它们位于不同的子网上)。
我可以从我的 Jetson 2 ping 笔记本电脑 (192.168.43.181)。但是我无法从我的笔记本电脑 ping 笔记本电脑 (10.42.0.2)。因此。笔记本电脑-J1 和 J1-J2 之间的 ping 操作是双向的。
ipv4_forwarding 已在 J1 上设置为 1。我还在所有机器上设置了包含主机名和 IP 的“/etc/hosts”文件。
笔记本电脑:
127.0.0.1 localhost
127.0.1.1 laptop
192.168.43.2 jetson1
10.42.0.2 jetson2
jetson1:
127.0.0.1 localhost
127.0.1.1 jetson1
192.168.43.181 laptop
10.42.0.2 jetson2
jetson2:
127.0.0.1 localhost
127.0.1.1 jetson2
10.42.0.1 jetson1
192.168.43.181 laptop
我甚至添加了其他讨论中描述的路线
笔记本电脑:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.43.223 0.0.0.0 UG 600 0 0 wlp1s0
10.42.0.0 192.168.43.2 255.255.255.0 UG 0 0 0 wlp1s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp1s0
192.168.43.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp1s0
jetson1:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.43.223 0.0.0.0 UG 20600 0 0 wlan0
10.42.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
192.168.43.0 0.0.0.0 255.255.255.0 U 600 0 0 wlan0
jetson2:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.42.0.1 0.0.0.0 UG 20100 0 0 eth0
10.42.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.43.0 10.42.0.1 255.255.255.0 UG 0 0 0 eth0
当我尝试从我的笔记本电脑 ping 10.42.0.2(Jetson2)时:
PING 10.42.0.2 (10.42.0.2) 56(84) bytes of data.
From 192.168.43.2 icmp_seq=1 Destination Port Unreachable
From 192.168.43.2 icmp_seq=2 Destination Port Unreachable
From 192.168.43.2 icmp_seq=3 Destination Port Unreachable ...
当我从 Jetson2 ping 192.168.43.181(笔记本电脑)时
PING 192.168.43.181 (192.168.43.181) 56(84) bytes of data.
64 bytes from 192.168.43.181: icmp_seq=1 ttl=63 time=72.4 ms
64 bytes from 192.168.43.181: icmp_seq=2 ttl=63 time=226 ms
64 bytes from 192.168.43.181: icmp_seq=3 ttl=63 time=60.3 ms
64 bytes from 192.168.43.181: icmp_seq=4 ttl=63 time=65.8 ms ...
谢谢您的帮助 :)