scp ssh: connect to host 10.0.0.109 port 22: No route to host lost connection
8,711
What I need to disable eth0
, after that, it works fine!
Related videos on Youtube
Author by
GoingMyWay
Updated on September 18, 2022Comments
-
GoingMyWay over 1 year
I use
SCP
command on Debian Linux to transfer a file to my colleague via LAN. But I encounter the problem:$ scp filename.file [email protected]:/tmp ssh: connect to host 10.0.0.109 port 22: No route to host lost connection
But when I use the same command to transfer the file to a WAN machine, it works well. And when I use
ping
toping
WAN website, it works well, but when I ping a LAN ip address, it does not work.$ ping 10.0.0.1 PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data. From 10.0.0.108 icmp_seq=1 Destination Host Unreachable From 10.0.0.108 icmp_seq=2 Destination Host Unreachable From 10.0.0.108 icmp_seq=3 Destination Host Unreachable From 10.0.0.108 icmp_seq=4 Destination Host Unreachable From 10.0.0.108 icmp_seq=5 Destination Host Unreachable From 10.0.0.108 icmp_seq=6 Destination Host Unreachable From 10.0.0.108 icmp_seq=7 Destination Host Unreachable From 10.0.0.108 icmp_seq=8 Destination Host Unreachable From 10.0.0.108 icmp_seq=9 Destination Host Unreachable
Routing table:
$ ip route default via 10.0.0.1 dev wlan0 proto static 10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.108 10.0.0.0/24 dev wlan0 proto kernel scope link src 10.0.0.108 169.254.0.0/16 dev eth0 scope link metric 1000
arp -an
root@debian:# arp -an ? (10.0.0.1) at c4:04:15:17:bd:66 [ether] on wlan0
iptables -L
root@debian:# 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
I can explore the Internet via Firefox. It just can't connect the LAN machie.
And my ip address is static ip in my company's LAN.
The port 22 is open, and there seems nothing wrong with iptables and SSH works well too.
How can I fix it?
-
neuron almost 9 yearsSo you are saying, from that same machine where you are trying to do
scp
, you can dossh [email protected]
& it works? -
Арсений Черенков almost 9 yearsThere is a difference between LAN and WAN, if your colleague host is "behind" a routeur, there are step to be done (namely forwarding port) before you can access hosts. You will be using his WAN IP of course. Can you give more details about network topology ?
-
GoingMyWay almost 9 yearsHi, I have update the problem in detail.
-
GoingMyWay almost 9 years
$ssh [email protected]
ssh: connect to host 10.0.0.109 port 22: No route to host
I mean, if I scp and ssh a mahine that out of the LAN where my machine in, it works well. -
dr_ almost 9 yearsTry to ping your colleague's machine from yours, and viceversa. Post the results.
-
GoingMyWay almost 9 yearsThanks, I have solved this problem. I disbled eth0 and
SCP
can transfer file to my colleague via LAN.
-