LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-31-2011, 09:17 PM   #1
th1bill
Member
 
Registered: Dec 2007
Location: SE Texaas
Distribution: Ubuntu, Mint, Fedora
Posts: 168

Rep: Reputation: 24
Ubuntu:No Route To Host


I have a desktop and a laptop running Ubuntu 11.10 and have installed ssh on both but all I return is no route to host. Its my laptop that is trying to connect with the desktop.
 
Old 01-01-2012, 06:47 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
You probably do not have a default route set. 'netstat -r' in a command prompt will tell you.

Quote:
netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
localnet * 255.255.255.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default cisco 0.0.0.0 UG 0 0 0 eth0
This is from my system, the second column, 'cisco' is my router. The 'route add' command will add a default route. See this link for its use. -->http://www.cyberciti.biz/faq/linux-route-add/

What you point it at depends on the network. If you have a router, point it there. If this is a point to point config, or through a hub, create a route in each system pointing at the others IP address.

Then you should be able to ping. No more 'no route to host' message.
 
Old 01-01-2012, 11:26 PM   #3
th1bill
Member
 
Registered: Dec 2007
Location: SE Texaas
Distribution: Ubuntu, Mint, Fedora
Posts: 168

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by camorri View Post
You probably do not have a default route set. 'netstat -r' in a command prompt will tell you.



This is from my system, the second column, 'cisco' is my router. The 'route add' command will add a default route. See this link for its use. -->http://www.cyberciti.biz/faq/linux-route-add/

What you point it at depends on the network. If you have a router, point it there. If this is a point to point config, or through a hub, create a route in each system pointing at the others IP address.

Then you should be able to ping. No more 'no route to host' message.
Here is the return;
Quote:
willis@willis-laptop:~$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 192.168.10.1 0.0.0.0 UG 0 0 0 wlan0
link-local * 255.255.0.0 U 0 0 0 wlan0
192.168.10.0 * 255.255.255.0 U 0 0 0 wlan0
The 192.168.10.1 is my Trend Net wireless switch and is connected to my gateway, 192.168.1.254, by wire. I can connect by ssh to my laptop from the desktop but really need to connect back the other way so I can use the printer there. Thanks for the assist.
 
Old 01-02-2012, 03:14 AM   #4
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Blog Entries: 1

Rep: Reputation: 57
What does netstat -r look like on the desktop?

Try doing a
Code:
hostname -f
on each machine to see if they have the same fqdn.

One more question: are you trying to ssh by name or ip address? Are they both using ipv4 or is one ipv4 and one ipv6?
 
Old 01-02-2012, 08:17 AM   #5
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
When I first answered your post, I had no idea you had a switch with routing capability.

Are the desktop and laptop on the same, or different sub-nets? Is it possible to define a static router between the two?
 
Old 01-03-2012, 12:33 AM   #6
th1bill
Member
 
Registered: Dec 2007
Location: SE Texaas
Distribution: Ubuntu, Mint, Fedora
Posts: 168

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by jamesf View Post
What does netstat -r look like on the desktop?

Try doing a.
Code:
hostname -f
on each machine to see if they have the same fqdn.

One more question: are you trying to ssh by name or ip address? Are they both using ipv4 or is one ipv4 and one ipv6?
I am currently on wire for both and still trying to find an answer. These results are under this config. and from the desktop it reads willis-MS-7309
willis@willis-laptop:~$ hostname -f
willis-laptop
willis@willis-laptop:~$
 
Old 01-03-2012, 12:40 AM   #7
th1bill
Member
 
Registered: Dec 2007
Location: SE Texaas
Distribution: Ubuntu, Mint, Fedora
Posts: 168

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by camorri View Post
When I first answered your post, I had no idea you had a switch with routing capability.

Are the desktop and laptop on the same, or different sub-nets? Is it possible to define a static router between the two?
when they are both on wire they are on the same switch but when I go wireless the wireless switch is plugged into the 8 port wired switch placing another switch into the mix.

sorry for not being clear enough, you would think that after doing computers since the VIC 20 and having become a legal senior citizen I should have learned by now... must be getting feeble minded to match my body.
 
Old 01-03-2012, 04:13 AM   #8
overprotected
LQ Newbie
 
Registered: Jan 2012
Location: Pakistan
Distribution: Ubuntu
Posts: 6

Rep: Reputation: Disabled
Can you netstat -r from desktop and paste the result here?
 
Old 01-03-2012, 11:36 PM   #9
th1bill
Member
 
Registered: Dec 2007
Location: SE Texaas
Distribution: Ubuntu, Mint, Fedora
Posts: 168

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by overprotected View Post
Can you netstat -r from desktop and paste the result here?
Quote:
willis@willis-MS-7309:~$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 192.168.10.1 0.0.0.0 UG 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
willis@willis-MS-7309:~$
I hope this helps
 
Old 01-04-2012, 03:18 AM   #10
overprotected
LQ Newbie
 
Registered: Jan 2012
Location: Pakistan
Distribution: Ubuntu
Posts: 6

Rep: Reputation: Disabled
Quote:
Originally Posted by th1bill View Post
I hope this helps
Can you connect both the laptop and the desktop to a Switch through a wire and then try to ping laptop to desktop and vice versa?

PS: Use IP instead of hostname when you ping.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
telnet: Unable to connect to remote host: No route to host grob115 Linux - Networking 3 07-30-2010 10:18 AM
ssh: connect to host .....No route to host soumyacs Linux - Newbie 5 10-27-2009 10:03 AM
No route to host chuikingman Linux - Networking 5 08-27-2009 08:49 AM
No Route To Host manoj.linux Linux - Enterprise 1 10-25-2007 01:49 PM
No route to host mail4visu Linux - Networking 1 05-18-2006 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration