LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No route to host ?? What am I missing here ?! (https://www.linuxquestions.org/questions/linux-newbie-8/no-route-to-host-what-am-i-missing-here-757758/)

jonaskellens 09-25-2009 12:36 PM

No route to host ?? What am I missing here ?!
 
Code:

[jonas@jonas ~]$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1B:24:A4:B6:06 
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21b:24ff:fea4:b606/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5523 (5.3 KiB)  TX bytes:2929 (2.8 KiB)
          Interrupt:17

Code:

[jonas@jonas ~]$ ping -c 4 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.100 icmp_seq=1 Destination Host Unreachable
From 192.168.1.100 icmp_seq=2 Destination Host Unreachable
From 192.168.1.100 icmp_seq=3 Destination Host Unreachable
From 192.168.1.100 icmp_seq=4 Destination Host Unreachable

--- 192.168.1.1 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 6001ms
pipe 3

Code:

[jonas@jonas ~]$ ping -c 4 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.

--- 192.168.1.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 12999ms

Code:

[jonas@jonas ~]$ route
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.1.0    *              255.255.255.0  U    1      0        0 eth0
default        192.168.1.1    0.0.0.0        UG    0      0        0 eth0

Code:

[jonas@jonas ~]$ ssh -l root 192.168.1.1
ssh: connect to host 192.168.1.1 port 22: No route to host

Why can I not reach 192.168.1.1 ?

paulsm4 09-25-2009 12:47 PM

1. The first thing I'd check is to make sure the two hosts are on the same, physical subnet:

a) Are they connected via a multi-port hub, router or switch?
... or ...
b) Are they connected directly (using a crossover cable)?

2. Next, I'd make sure the hosts are actually configured as:

a) 192.168.1.100/subnet mask 255.255.255.0
<= Your "ifconfig" shows this for one host
b) 192.168.1.1/subnet mask 255.255.255.0
<= You also need to verify the other host

3. What happens when you try to ping 192.168.1.100 from 192.168.1.1? Do you get the same "no route to host"?

4. Does either host have two NIC ports? If so, have you tried unplugging/plugging in to the other port?

Q: Do you see activity lights on the NICs? Are the cables good?

That's for starters - I hope it helps ... at least a little bit.

IMHO .. PSM

jonaskellens 09-25-2009 12:53 PM

Quote:

Originally Posted by paulsm4 (Post 3696991)
Q: What happens when you try to ping 192.168.1.100 from 192.168.1.1? Do you get the same "no route to host"?

Q: Does either host have two NIC ports? If so, have you tried unplugging/plugging in to the other port?

Q: Do you see activity lights on the NICs? Are the cables good?

192.168.1.1 is a Linksys WRT610N with dd-wrt. I logged in to the webGUI just minutes ago. I then went wireless to search a manual on the internet and disabled my eth0.

Now I have just disabled my wireless and enabled my eth0 again to be able to talk to my dd-wrt Linksys, who should still be on 192.168.1.1.

But no luck...

(by the way : to post on this forum, I'm back on my wireless (other router))

baig 09-25-2009 01:13 PM

How you logged in to webGUI? from which system you logged in? Code names won't work.. I guess the other is a Router?..

I think a router needs to be configured for ssh sessions... by default it won't accept ssh logins..

Inshort you don't have physical connection to this device.. that means no route !!

linuxlainen 09-25-2009 01:14 PM

Hi,

* Do you have MAC filer enabled on your router?If so, make sure yours is added to the router
* Is your router with the same subnet mask?
* Do yo have DHCP enabled on your router? If so, is your machine IP within the range specified on your router?

jonaskellens 09-25-2009 01:22 PM

It think it's very simple... I just bricked my Linksys with an unstable version of DD-WRT...

The power-button just keeps on flashing...

About the ssh-question : with DD-WRT ssh-access is enabled, I had it enabled. I logged in before just right... End of game I guess.

r3sistance 09-25-2009 01:34 PM

If your using Fedora or CentOS, what does "mii-tool eth0" and "ethtool eth0" produce, do they actually confirm a link.

Also use "ip neigh show" to show ips that are reachable (or routes that are not) within the local area network...

paulsm4 09-25-2009 02:27 PM

Quote:

It think it's very simple... I just bricked my Linksys ...

The power-button just keeps on flashing...
Uh, yeah - that would cause a "no route to host" ;)

lutusp 09-26-2009 01:18 AM

Quote:

Originally Posted by jonaskellens (Post 3697014)
It think it's very simple... I just bricked my Linksys with an unstable version of DD-WRT...

The power-button just keeps on flashing...

About the ssh-question : with DD-WRT ssh-access is enabled, I had it enabled. I logged in before just right... End of game I guess.

Not necessarily, there are ways to recover a bricked router after a bad DD-WRT installation:

Recover from a Bad Flash

I like DD-WRT very much, I've managed to brick a few Linksys routers in my time, and only one was ever totally lost. Good thing they're so cheap.

ilu_nishant 09-26-2009 05:52 AM

Hii

Do check your iptable rules.In linux "service iptables status" command will give you the clear picture .
If client and server are in the same subnet mask they must communicate with each other.
Two way handshake must be be established between them unless not restricted by iptable rules.
Check your iptable rules of both 192.168.1.100 machine & 192.168.1.1 machine.

Cheerzz!!

r3sistance 09-26-2009 05:55 AM

If you read it like I kinda only scanned past before, it appears he borked his router so he naturally wouldn't get a route to host, the router ain't working.

gregorian 09-26-2009 09:52 AM

I had the same problem before. Guess what I did? I added myself as another default gateway and it worked. No one has been able to answer why it worked. See if it works for you and I'll point you to my thread. Here's my routing table:

Quote:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.70.146 * 255.255.255.255 UH 0 0 0 wlan0
loopback * 255.0.0.0 U 0 0 0 lo
default 172.16.1.1 0.0.0.0 UG 0 0 0 wlan0
default 172.16.70.146 0.0.0.0 UG 0 0 0 wlan0
Here's the script I wrote for my wireless. If the above works, you can modify this for your eth0
Quote:

#!/bin/bash

if [ "$1" == "on" ]; then
echo "Turning on wifi device"
/sbin/ifconfig wlan0 up
/sbin/iwlist wlan0 scan
sleep 2
echo "Connecting to network"
/sbin/iwconfig wlan0 essid XXXXX #Enter your essid (Connection name)
sleep 2
echo "Obtaining the address"
/sbin/dhcpcd wlan0

#Obtain IP and store it

/sbin/ifconfig wlan0 #Display configuration

IP=`/sbin/ifconfig wlan0|grep "inet addr"|cut -f2 -d:|cut -f1 -dB`
if [ -n "$IP" ]; then
/sbin/route add default gw $IP
/sbin/route add default gw XX.XX.XX.XX #My gateway
/sbin/route
fi
else
/sbin/ifconfig wlan0 down
killall dhcpcd
fi


paulsm4 09-26-2009 12:30 PM

Hi - In summary:

PROBLEM:
Quote:

Ping ... Destination Host Unreachable
SUGGESTED TROUBLESHOOTING:
Quote:

1. The first thing I'd check is to make sure the two hosts are on the same, physical subnet:

a) Are they connected via a multi-port hub, router or switch?
... or ...
b) Are they connected directly (using a crossover cable)?

2. Next, I'd make sure the hosts are actually configured as:

a) 192.168.1.100/subnet mask 255.255.255.0
<= Your "ifconfig" shows this for one host
b) 192.168.1.1/subnet mask 255.255.255.0
<= You also need to verify the other host

3. What happens when you try to ping 192.168.1.100 from 192.168.1.1? Do you get the same "no route to host"?

4. Does either host have two NIC ports? If so, have you tried unplugging/plugging in to the other port?

Q: Do you see activity lights on the NICs? Are the cables good?
In this case, the OP probably would have failed at 2) (check the Linksys IP and subnet) or 3) (try to ping the Linux host from the Linksys).

'Hope that helps .. PSM

PS:
Yes, the Linksys is almost certainly salvageable.

PPS:
More generally (if you get "no route to host" for an arbitrary IP address):
Quote:

STEP 0. I'd make sure I can "ping" the gateway. I'd make sure my gateway is physically connected, and make sure it has the same IP network #/subnet mask.


All times are GMT -5. The time now is 04:01 PM.