Networking Forums

Networking Forums > Computer Networking > Linux Networking > No route for localhost?

Reply
Thread Tools Display Modes

No route for localhost?

 
 
jprudent
Guest
Posts: n/a

 
      02-23-2011, 07:44 AM
Hi!

When I type the following command:
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref
Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 303 0
0 wlan0
0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0
0 wlan0

Why I don't have an entry for localhost? Like:
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

PS: My system works perfectly

Thanks
 
Reply With Quote
 
 
 
 
Pascal Hambourg
Guest
Posts: n/a

 
      02-23-2011, 09:07 AM
Hello,

jprudent a écrit :
>
> $ route -n
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref
> Use Iface
> 192.168.1.0 0.0.0.0 255.255.255.0 U 303 0
> 0 wlan0
> 0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0
> 0 wlan0
>
> Why I don't have an entry for localhost? Like:
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo



"route -n" shows only the "main" routing table, which contain only
routes to external unicast destinations. Routes to local and broadcast
destinations are in the "local" routing table which can be displayed
with the following command (requires the iproute package to be installed) :

$ ip route show table local

Note : The "local" routing table has precedence over all other routing
tables, including "main". So local and broadcast routes cannot be
overriden by adding routes in the "main" routing table.
 
Reply With Quote
 
jprudent
Guest
Posts: n/a

 
      02-23-2011, 09:41 AM
Thanks!

Another question: it seems that the functionalities of 'route' are
contained in 'ip'. Is that true?

On Feb 23, 5:07*pm, Pascal Hambourg <boite-a-s...@plouf.fr.eu.org>
wrote:
> Hello,
>
> jprudent a crit :
>
>
>
> > $ route -n
> > Kernel IP routing table
> > Destination * * Gateway * * * * Genmask * * * * Flags Metric Ref
> > Use Iface
> > 192.168.1.0 * * 0.0.0.0 * * * * 255.255.255.0 * U * *303 * *0
> > 0 wlan0
> > 0.0.0.0 * * * * 192.168.1.1 * * 0.0.0.0 * * * * UG * *303 * *0
> > 0 wlan0

>
> > Why I don't have an entry for localhost? Like:
> > 127.0.0.0 * * 0.0.0.0 * * * * 255.0.0.0 * U * * 0 **0 * * * *0 *lo

>
> "route -n" shows only the "main" routing table, which contain only
> routes to external unicast destinations. Routes to local and broadcast
> destinations are in the "local" routing table which can be displayed
> with the following command (requires the iproute package to be installed):
>
> $ ip route show table local
>
> Note : The "local" routing table has precedence over all other routing
> tables, including "main". So local and broadcast routes cannot be
> overriden by adding routes in the "main" routing table.


 
Reply With Quote
 
pk
Guest
Posts: n/a

 
      02-23-2011, 09:43 AM
jprudent wrote:

> Thanks!
>
> Another question: it seems that the functionalities of 'route' are
> contained in 'ip'. Is that true?


Yes. "ip" can do what "route" does, and much more. You shouldn't be using
"route" (and "ifconfig", for that matter) anymore these days.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Localhost john Windows Networking 3 02-11-2008 01:31 PM
disable short route via localhost on dual network interface Andreas Wassatsch Linux Networking 2 11-26-2007 05:27 AM
VPN client adds wrong route to local route table snowdog_2112 Windows Networking 7 11-01-2005 02:05 PM
No route to localhost vininche@gmail.com Linux Networking 7 06-08-2005 08:05 AM
route and static route to a gateway Sting Linux Networking 2 02-21-2004 03:35 AM



1 2 3 4 5 6 7 8 9 10 11