Networking Forums

Networking Forums > Computer Networking > Linux Networking > No route to localhost

Reply
Thread Tools Display Modes

No route to localhost

 
 
vininche@gmail.com
Guest
Posts: n/a

 
      06-05-2005, 03:06 PM
Hi guys, anyone of you can help me?

I use Mdk 10 with kernel 2.6.3-7, just after a restart I can't get the
route to localhost, even after:

ifconfig lo 127.0.0.1 netmask 255.0.0.0 up

and

route add -net 127.0.0.0 netmask 255.0.0.0 dev lo

the outcome of the command route -n remains:

Destination Gateway Genmask Flags Metric Ref Use
Iface

But what is driving me crazy is that after I add any route to any other
"real" nic card (wlan0, ppp0, eth0,... doesn't matter) all work fine
and the outcome of the command route -n becames:

Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0
wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0
lo

Sometimes this behaviour disturbs the proper start of cups that fails
adding localhost in the routing table, and consequently it is not
possible to print unless I start a "fictitious" nic card before the
cups' start.

 
Reply With Quote
 
 
 
 
Andrew Schulman
Guest
Posts: n/a

 
      06-06-2005, 09:05 AM


> I use Mdk 10 with kernel 2.6.3-7, just after a restart I can't get the
> route to localhost, even after:
>
> ifconfig lo 127.0.0.1 netmask 255.0.0.0 up
>
> and
>
> route add -net 127.0.0.0 netmask 255.0.0.0 dev lo
>
> the outcome of the command route -n remains:
>
> Destination Gateway Genmask Flags Metric Ref Use
> Iface
>
> But what is driving me crazy is that after I add any route to any other
> "real" nic card (wlan0, ppp0, eth0,... doesn't matter) all work fine
> and the outcome of the command route -n becames:
>
> Destination Gateway Genmask Flags Metric Ref Use
> Iface
> 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0
> wlan0
> 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0
> eth0
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0
> lo
>
> Sometimes this behaviour disturbs the proper start of cups that fails
> adding localhost in the routing table, and consequently it is not
> possible to print unless I start a "fictitious" nic card before the
> cups' start.


Hm, this is odd. OTOH my routing table doesn't show localhost at all:

$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
69.140.160.0 0.0.0.0 255.255.248.0 U 0 0 0 wan
192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 lan
0.0.0.0 69.140.160.1 0.0.0.0 UG 0 0 0 wan

And yet I can ping localhost with no trouble. Can you not ping localhost
before a localhost entry shows up in your routing trouble? Can you show us
the exact error message from CUPS?

--
To reply by email, change "deadspam.com" to "alumni.utexas.net"

 
Reply With Quote
 
vininche
Guest
Posts: n/a

 
      06-06-2005, 01:34 PM
The error is in italian but translated sounds like:

WARNING: I can't add loopback device to the routing table, CUPS would
not work properly.

 
Reply With Quote
 
vininche
Guest
Posts: n/a

 
      06-06-2005, 01:35 PM
The error is in italian but translated sounds like:

WARNING: I can't add loopback device to the routing table, CUPS would
not work properly.

 
Reply With Quote
 
Andrew Schulman
Guest
Posts: n/a

 
      06-06-2005, 02:13 PM

> The error is in italian but translated sounds like:
>
> WARNING: I can't add loopback device to the routing table, CUPS would
> not work properly.


So let me see if I understand this correctly:

(1) At boot, one of the boot scripts tries to add a route to localhost,
using lo. The command doesn't fail, but no route is added.

(2) Later, CUPS tries to start, then fails complaining that it doesn't
have a route to localhost.

(3) After that, once you start some other interfaces, you can add a
route to localhost using lo.

(4) Now CUPS will start.

Do I have that right?

Steps (1) and (3) above seem normal to me. I've never tried (3) before,
because I never had to. As I showed in my previous post, there's never
been a route to localhost in my routing table, and yet I've never had
trouble using my loopback interface. But just now I did try it, and
sure enough a route to localhost now appears in the table:

$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
69.140.160.0 0.0.0.0 255.255.248.0 U 0 0 0
wan
192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0
lan
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0
lo
0.0.0.0 69.140.160.1 0.0.0.0 UG 0 0 0
wan

So to me, (2) and (4) seem like the strange ones. It's hard to be sure
what the trouble is, because we haven't seen the exact error message
from CUPS (and even if you posted it, it probably wouldn't help me
because I don't speak Italian).

One possibility that comes to mind is a firewall problem. Could your
firewall be blocking connections to localhost:631 until later in the
boot process?

Whatever the cause, here's a way to find out if connections to
localhost:631 are possible or not, before you add the route to localhost
to your routing table. First, make sure you have the netcat package
installed. Second, reboot or do whatever you need to do to get your
routing table into its initial, empty state. Third, make sure CUPS
isn't running. Now from a root shell, run

nc -v -l -p 631 localhost

This sets up a server listening on localhost:631. Finally from a
different shell (it doesn't have to be root), connect to your server by
running

nc -v localhost 631

Your two copies of nc should now be talking to each other, via
localhost:631. Anything you type into one should be echoed at the
other. If this fails at any step, tell us what happened.

--
To reply by email, replace "deadspam.com" by "alumni.utexas.net"
 
Reply With Quote
 
vininche
Guest
Posts: n/a

 
      06-06-2005, 03:17 PM
I tried the procedure you suggest me using nc and it's working fine...
unless the routing table remains empty.

To be more specific in point (3) after I start a different interfance
there's no need to add the route to localhost, it suddenly appears....

CUPS starts anyway even after the error message, but most of the time
fails on printing on the lpt.

 
Reply With Quote
 
vininche
Guest
Posts: n/a

 
      06-06-2005, 04:49 PM
Now i compiled a new vanilla kernel (2.6.11.8 from kernel.org) and all
seems to works fine!

 
Reply With Quote
 
Tim Kelley
Guest
Posts: n/a

 
      06-08-2005, 08:05 AM
(E-Mail Removed) wrote:

> Hi guys, anyone of you can help me?
>
> I use Mdk 10 with kernel 2.6.3-7, just after a restart I can't get the
> route to localhost, even after:
>
> ifconfig lo 127.0.0.1 netmask 255.0.0.0 up
>
> and
>
> route add -net 127.0.0.0 netmask 255.0.0.0 dev lo


The localhost interface should not have any routes nor need them. It's a
stand alone interface - routes are for communication with different
networks. No traffic should be going to localhost from anywhere but
localhost.
 
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
No route for localhost? jprudent Linux Networking 3 02-23-2011 09:43 AM
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
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