您尚未登录。

#1 2021-09-16 23:24:03

tanloong
会员
注册时间: 2021-08-15
帖子: 28

【已解决】两台 Arch Linux 互 ping,显示 “目标主机不可达”

问题:两台 Arch Linux 互 ping 显示 “目标主机不可达”,互相用 scp 连接显示 No route to host。
电脑情况:两台电脑连接在同一个校园网,都使用 NetworkManager 联网,都能 ping 通 baidu.com,都使用动态 IP 地址。
期望结果:两台电脑能用 scp 互相传输文件。

从 A 电脑 ping B 电脑的 IP 地址

tan:~$ ping -c 4 10.117.17.14
PING 10.117.17.14 (10.117.17.14) 56(84) 字节的数据。
来自 10.117.127.238 icmp_seq=1 目标主机不可达
来自 10.117.127.238 icmp_seq=2 目标主机不可达
来自 10.117.127.238 icmp_seq=3 目标主机不可达
来自 10.117.127.238 icmp_seq=4 目标主机不可达

--- 10.117.17.14 ping 统计 ---
已发送 4 个包, 已接收 0 个包, +4 错误, 100% packet loss, time 3033ms
pipe 4

在 B 电脑执行 ifconfig 的结果

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.117.17.14  netmask 255.255.0.0  broadcast 10.117.255.255
        inet6 fe80::3597:2d3a:b08f:bd7e  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::a623:dc65:a033:c9d1  prefixlen 64  scopeid 0x20<link>
        inet6 2001:250:5806:ac1:a442:a3fb:569f:cdef  prefixlen 64  scopeid 0x0<global>
        inet6 2001:250:5806:ac1:55:14e6:f383:da83  prefixlen 64  scopeid 0x0<global>
        ether 60:d8:19:d1:d1:cd  txqueuelen 1000  (Ethernet)
        RX packets 2256037  bytes 3152909564 (2.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1107306  bytes 130433655 (124.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

把 B 电脑的文件复制到 A 电脑的结果

tan:~$ scp 10.117.17.14:/home/tan/temp/* ~/
ssh: connect to host 10.117.17.14 port 22: No route to host

B 电脑的防火墙的情况

tan:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

请问我该怎么办?:-(

最近编辑记录 tanloong (2021-10-11 15:04:59)

离线

#2 2021-09-17 00:09:11

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,942
个人网站

Re: 【已解决】两台 Arch Linux 互 ping,显示 “目标主机不可达”

请在两边分别执行 ip a 及 ip r,然后把结果贴上来。

离线

#3 2021-09-17 00:10:57

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,942
个人网站

Re: 【已解决】两台 Arch Linux 互 ping,显示 “目标主机不可达”

PS: 看到你有 IPv6 地址。你也可以用那个。

离线

#4 2021-09-17 01:06:44

tanloong
会员
注册时间: 2021-08-15
帖子: 28

Re: 【已解决】两台 Arch Linux 互 ping,显示 “目标主机不可达”

A 电脑执行 ip a 和 ip r

tan:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 8c:16:45:80:58:27 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether b0:fc:36:68:af:33 brd ff:ff:ff:ff:ff:ff
    inet 10.117.127.238/16 brd 10.117.255.255 scope global dynamic noprefixroute wlan0
       valid_lft 86247sec preferred_lft 86247sec
    inet6 2001:250:5806:828:d36e:a6bb:b32a:175f/64 scope global dynamic noprefixroute
       valid_lft 259063sec preferred_lft 172663sec
    inet6 fe80::3da8:efd2:f675:c14f/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
tan:~$ ip r
default via 10.117.255.254 dev wlan0 proto dhcp metric 600
10.117.0.0/16 dev wlan0 proto kernel scope link src 10.117.127.238 metric 600

B 电脑执行 ip a 和 ip r

tan:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether f0:de:f1:e0:07:83 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 60:d8:19:d1:d1:cd brd ff:ff:ff:ff:ff:ff
    inet 10.117.17.14/16 brd 10.117.255.255 scope global dynamic noprefixroute wlan0
       valid_lft 86368sec preferred_lft 86368sec
    inet6 2001:250:5806:889:640:b921:b2cd:3f75/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 259169sec preferred_lft 172769sec
    inet6 2001:250:5806:889:e83f:18c1:2013:7e5b/64 scope global dynamic noprefixroute
       valid_lft 259169sec preferred_lft 172769sec
    inet6 fe80::3597:2d3a:b08f:bd7e/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
tan:~$ ip r
default via 10.117.255.254 dev wlan0 proto dhcp src 10.117.17.14 metric 3003
10.117.0.0/16 dev wlan0 proto kernel scope link src 10.117.17.14 metric 600
10.117.0.0/16 dev wlan0 proto dhcp scope link src 10.117.17.14 metric 3003

离线

#5 2021-09-17 01:44:32

tanloong
会员
注册时间: 2021-08-15
帖子: 28

Re: 【已解决】两台 Arch Linux 互 ping,显示 “目标主机不可达”

我用 ipv6 执行 scp 成功了 :-)

tan:~$ scp -6 tan@\[2001:250:5806:828:d36e:a6bb:b32a:175f\]:/home/tan/media/lukesmith/* /home/tan/media/lukesmith/
Arch Linux_ Is it a meme_-1080p.mp4                                   100%  520MB   4.4MB/s   01:58
Artix)-1080p.mp4                                                      100%   65MB   4.6MB/s   00:14
Full Arch Linux Install (SAVAGE Edition!)-720p.mp4                    100%  115MB   4.6MB/s   00:24
LaTeX_ Images, Figures, Wrapping and the Logic Behind Them-720p.mp4   100%   22MB   4.4MB/s   00:04
LaTeX_Easy Custom Formatting in LaTeX with Macro Functions!-720p.mp4  100%   24MB   4.6MB/s   00:05
LaTeX_Learn LaTeX Tutorial (1)_ Basic Compiling, Titles, Sections, Fo 100%   24MB   4.6MB/s   00:05
LaTeX_Learn LaTeX Tutorial (2)_ Labels, References and Lists (ordered 100%   17MB   4.7MB/s   00:03
LaTeX_Learn LaTeX Tutorial (3)_ Making Bibliographies with Biber and  100%   23MB   4.5MB/s   00:05
LaTeX_Making a Pro Presentation with LaTeX's Beamer!-720p.mp4         100%   18MB   4.3MB/s   00:04
LaTeX_Making a Resume with some LaTeX Magic (Part 1)-720p.mp4         100%   32MB   4.5MB/s   00:07
LaTeX_Making a Resume with some LaTeX Magic (Part 2)-720p.mp4         100%   27MB   4.6MB/s   00:05
Minimalist Software Prevents THIS...-1080p.mp4                        100%   55MB   4.5MB/s   00:12
Never say _If_ writing a Bash script! (Exit codes & logical operators 100%   64MB   4.6MB/s   00:14
SCRIPTING_ Virgin USB daemons vs. the Chad 20 line Bash Script-720p.m 100%   45MB   4.5MB/s   00:09
Thinkpad_I love classic ThinkPad Keyboards so much, I got another one 100%  249MB   4.3MB/s   00:58

离线

#6 2021-09-17 02:05:10

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,942
个人网站

Re: 【已解决】两台 Arch Linux 互 ping,显示 “目标主机不可达”

那你就用 v6 吧。你这网可能有点问题,比如不让局域网相互访问啥的。

离线

页脚