Solved

LOOPBACK is lost!

Posted on 2002-04-13
20
559 Views
Last Modified: 2008-02-01
What did I do?  (maybe in trying to set up samba and smbclient, maybe in setting up routing?  firewall? - I don't know. A friend did some of it.)

Bottom line is my linux box can ping 2 pcs it's connected to (ethernet), and they can ping him ... but he can't ping himself--not by name, not by ip address and NOT by 127.0.0.1.

Therefore, ping and lpr (and probably more) complain that they "can't find the network"  !!

Not incidentally, I really don't want to "just reinstall", 'cuz I'd lose the perfectly good ppp and firewall settings, and some lesser stuff I could redo myself. Samba has not yet worked, and has most likely been overconfigured.

What do I look for and what should I STRIP OUT to get my ordinary 127.0.0.1 back?

(Oh: one funny side effect of this is that SWAT works from the pcs, but not from the machine it's on!)

The current goal is to be able to PRINT to the Linux box' local printer!

Thanks

Marilyn Justman
0
Comment
Question by:mjustman
  • 12
  • 7
20 Comments
 
LVL 4

Expert Comment

by:kannabis
Comment Utility
You have to make sure that your HOSTS file is defined properly.  

on redhat it should be in /etc/hosts

here is some info how to define your localhost:  http://www.tldp.org/HOWTO/Net-HOWTO/x540.html

and here you can make sure the rest of the name resolving is ok:  http://www.tldp.org/HOWTO/Net-HOWTO/x413.html

0
 

Author Comment

by:mjustman
Comment Utility
kannabis:

/etc/hosts has  all 4 listings:
127.0.0.1 localhost
192.168.1.100  equipoise (the linux box, host)
192.168.1.101 rosalind (the desktop pc)
192.168.1.102 stewball (the laptop pc)

I remember reading somewhere (in Samba setup, maybe?) that the loopback SHOULD NOT be in something...what?

/etc/resolv.conf  ONLY contains the DNS server at my ISP.  That works such that when I'm online, this becomes the DNS server for my entire system. Should it ALSO contain all the other names? Is it used for anything besides DNS lookups?

I was under the impression that loopback was "below" and precedent to this. I'll try the ipconfig command for adding lo mentioned in the pieces you cited: do you have any idea WHICH FILE it writes to?

Thanks.

Marilyn Justman
0
 

Author Comment

by:mjustman
Comment Utility
(later)
Did all those things. Checked all those files.
Everything's in order.
Same results with ping.   On name and ip address, "invalid argument".   On localhost : "Can't find network".

Can I call the "Linux Setup" guys in on this?  Or does everybody read all the postings?

(I didn't see that category 1st time thru).

Thanks.

Marilyn

0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Does 'ifconfig -a' return something like the following for the loopback device?

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4040573 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4040573 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:633452031 (604.1 Mb)  TX bytes:633452031 (604.1 Mb)

0
 

Author Comment

by:mjustman
Comment Utility
While online I get :

link encap Loopback
LOOKBACK MTU:16436 Metric:1
RX packets:0 errors:0 drop:0 overruns:0 frame:0
TX packets:0 errors:0 drop:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

(No "local
Inet address / mask missing... and obviously,  NOT running)

! ! ! ! !  

Thanks!

Marilyn Justman
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Pretty much what I though you'd see...

Okay, check to see if /etc/sysconfig/network-scripts/ifcfg-lo
exists and that it contains:

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

or a resaonable facsimile. The above was taken from a RedHat 7.2 system and if that's not what you are using you might see a minor variation.

Also check dmesg carefully right after a boot and see if the boot process is complaining about anything.
0
 

Author Comment

by:mjustman
Comment Utility
Sorry...no time to do entire...however:

/etc/sysconfig/network-scripts/ifcfg-lo
 - does exist
 - contains ONLY
     BOOTPROTO = none

/var/log/dmesg exists.  IT's fairly long.  When I get back from errands, I'll make a file and copy it in here.  There  DO appear to be some glitches, only one I noted down was
   hm, page 01000000 reserved twice.

As I said, get back to this in a while (2-3 hrs at least)

Thanks.

Marilyn Justman

p.s. yes, it's RedHat 7.2

0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
If you place what my 7.2 box has in ifcfg-lo and reboot I think you'll have your loopback device back.
0
 

Author Comment

by:mjustman
Comment Utility
Sorry...no time to do entire...however:

/etc/sysconfig/network-scripts/ifcfg-lo
 - does exist
 - contains ONLY
     BOOTPROTO = none

/var/log/dmesg exists.  IT's fairly long.  When I get back from errands, I'll make a file and copy it in here.  There  DO appear to be some glitches, only one I noted down was
   hm, page 01000000 reserved twice.

As I said, get back to this in a while (2-3 hrs at least)

Thanks.

Marilyn Justman

p.s. yes, it's RedHat 7.2

0
 

Author Comment

by:mjustman
Comment Utility
jlevie:

I'm running out of hope. Entered your fixes to ifcfg-lo script, NO  difference!

Here's the texts of a) a diff of the new/old ifcfg-lo file in tht order, and b) the ifcf-ppp0 files, which apparently got changed on 4/10 by something I did.  

I WISH I KNEW WHICH FILES GOT CHANGED BY WHICH COMMANDS!

Fishing thru memory, I recall that a) the very last thing I mucked with myself before this fell apart was passwords ... at one point, I had it working (with firewall in place) for both linux and pcs to print toeach other's printers ... but they could not see each other's FILES. Was there I "password" for localhost that I might have deleted? HOW WOULD I get it back?

If I just plain reinstall (OY!), can you guys help me get the network firewall (which somebody else set up for me and I REALLY don't understand) set up again?

Here's the diffs:
a) [extra?: SOME FILES don't allow comment lines. Which? is this one?]
1,8c1
< DEVICE = lo
< IPADDR= 127.0.0.1
< NETMASK=225.0.0.0
< NETWORK=127.0.0.0
< BROADCAST=127.255.255.255
< ONBOOT=yes
< NAME=loopback
< #BOOTPROTO=none
---
> BOOTPROTO=none

b) [this removed a duplicate entry of ISP's DNS server. Don't know what made this happen, or how duplicate got in at all]
10a11
> DNS2=207.229.143.1

Many thanks.

Marilyn
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 40

Expert Comment

by:jlevie
Comment Utility
I'm not sure how you managed to effectively delet the loopback configuration, but muching about with passwords would not have had anything to do with it. The only thing that would affect the configuration of the the lo interface would have been something to do with configuration of networking or possibly ppp.

Normally, /etc/sysconfig/network-scripts/ifcfg-lo is a symlink to /etc/sysconfig/networking/ifcfg-lo, like so:

wilowisp# ls -l network-scripts/ifcfg-lo
lrwxrwxrwx    1 root     root           22 Mar 11 13:16 network-scripts/ifcfg-lo -> ../networking/ifcfg-lo

Make sure that that symlink is still there and and that /etc/sysconfig/networking/ifcfg-lo contains:

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

Then try to manually bring up the interface with 'ifup lo'. If there's some config conflict or problem you ought ot get an error message.
0
 

Author Comment

by:mjustman
Comment Utility
jlevie:

I'm running out of hope. Entered your fixes to ifcfg-lo script, NO  difference!

Here's the texts of a) a diff of the new/old ifcfg-lo file in tht order, and b) the ifcf-ppp0 files, which apparently got changed on 4/10 by something I did.  

I WISH I KNEW WHICH FILES GOT CHANGED BY WHICH COMMANDS!

Fishing thru memory, I recall that a) the very last thing I mucked with myself before this fell apart was passwords ... at one point, I had it working (with firewall in place) for both linux and pcs to print toeach other's printers ... but they could not see each other's FILES. Was there I "password" for localhost that I might have deleted? HOW WOULD I get it back?

If I just plain reinstall (OY!), can you guys help me get the network firewall (which somebody else set up for me and I REALLY don't understand) set up again?

Here's the diffs:
a) [extra?: SOME FILES don't allow comment lines. Which? is this one?]
1,8c1
< DEVICE = lo
< IPADDR= 127.0.0.1
< NETMASK=225.0.0.0
< NETWORK=127.0.0.0
< BROADCAST=127.255.255.255
< ONBOOT=yes
< NAME=loopback
< #BOOTPROTO=none
---
> BOOTPROTO=none

b) [this removed a duplicate entry of ISP's DNS server. Don't know what made this happen, or how duplicate got in at all]
10a11
> DNS2=207.229.143.1

Many thanks.

Marilyn
0
 

Author Comment

by:mjustman
Comment Utility
messages are getting out of sequence.

I tried the 127.255.255.255 fix.

ifup lo does give SEVERAL error msgs - device not found, command not found (2x, incl for 127.0.0.1)

my hunch is it IS there, just hidden by some command to ignore it.  Could firewall be doing this?  or the DNS service?  SHOULD I  "run a DNS service" here?  I can't see any point, and would like to be reassured that that's NOT the way to get these few machines to talk to each other...

Does it make more sense to try to dismantle the system in pieces (uninstall samba for instance?), or just to reinstall?  Any (general) advice on re-install?  My recollection is that if I tell it it's an "upgrade" it won't do a repartition, and I can keep apps like emacs that I installed "later".  Of course, that'll probably leave these "errors" too???????

Marilyn

0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
It would be most illuminating to see what errors are reported when you execute 'ifup lo'. If possible it would be best to cut'n'paste the command and its result into a comment.

I don't think that the loopback device is "just hidden by some command to ignore it". It sounds like something removed the lo interface from your configuration, and what you had in your ifcfg-lo file bears that out.

I'm reasonable certain that the interface can be brought back into the configuration, but I need to know exactly what the system complains about so that I can tell what else needs "adjusting".
0
 

Author Comment

by:mjustman
Comment Utility
Ok. I'll try.  I'm on this machine now.  Wish I had a app that'd COPY from a system screen as my pc telnet and ssh clients do... NO LUCK. Had to hand-copy...


/sbin/ifup: DEVICE: command not found
/sbin/ifup: 127.0.0.1: command not found
up: error fetching interface information: Device not found
/etc/sysconfig/network-scripts/ifup: POST: command not found

Incidentally, what showed up from ifup lo > ifuplo.txt is this:

usage: ifup-aliases <net-device>\n
usage: ifup-routes <net-device>

Does this tell you anything?

Thanks.

Marilyn
0
 
LVL 40

Accepted Solution

by:
jlevie earned 200 total points
Comment Utility
Yes, that tells me lots and now that I know what to look for I can point to the problem.

The contents of ifcfg-lo must appear exactly as below:

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

Notice that there are no spaces around the equal signs. You can leave out the comment lines (those beginning with #) if you want to. Lookig back at your "diff" I can see 'DEVICE = lo" and that's what causes the first error. The second error is caused by the space between = and 127.0.0.1. I'm guessing that the POST error is caused by something in your file that I can't see  from the comment with the diff in it.

Oh yeah, the "DEVICE" line must be the first line in the file and there shouldn't be in blank lines after the "NAME" line, but there does have to be a normal new-line at the end of that line. Also make sure that you use a Linux editor to create the file, like:

# cd /etc/sysconfig/network-scripts
# rm ifcfg-lo
# rm ../networking/ifcfg-lo
# vi ../networking/ifcfg-lo
# ln -s ../networking/ifcfg-lo ifcfg-lo
# ifup lo

Creating or editing files on a windows system usually results in carriage returns being at the end of each line which causes problems for Linux. Also some PC editors will embed control character in the file that you won't normally be able to see but which will also cause all kinds of problems.

Try that and let me know how it goes.
0
 

Author Comment

by:mjustman
Comment Utility
OK. I've succeeded in copying from your text to mine, and, using gedit (instead of my usual emacs) I managed to paste.

I'll have to get off the net to reboot.  Get back to you if it works... well, either way...

Thanks for the lesson on Unix/DOS CRs.  I'm usually considered more than safe on issues like that--what I know I don't know is which linux config files care about extra spaces, which do and which don't allow comments, which do and which don't care about sequence. -- even which pipe (|) and which redirect (>), eg to a printer.  No, none of these is universal.  

Thanks.

Marilyn
0
 

Author Comment

by:mjustman
Comment Utility
Well, I'll be .....!!!
It worked!!
He can ping himself every which way AND he can print to his printer.

I now have tons of work to do, printing out color pages from the net for my granddaughter's 1st grade poster!!!

For what it's worth (before I tackle samba again), any idea WHY on shutdown -r now:
     -system complains that it FAILED to unload NSF statd ... should that be running?
     -last few times, system has simply HUNG instead of rebooting. Does the fact that I'm now running at run level 3 instead of 5 have anything to do with it?

If these have "real" answers, I'll be glad to put them in as new questions.  Just say so.

I appreciate your patience and tenacity with this process -- reinstalling always feels like failure AND you don't learn anything!

Thanks again,

Marilyn Justman
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Right off hand I don't know why it would be complaining about not being able to stop NFS statd (the process is actually rpc.statd). My fully up to date (which is all I have to look at) 7.2 systems don't produce that error and I don't know if it's an artifact of the firewall rule sets or some bug in the as-distributed packages.

The NFS statd is part of the NFS locking utilities (started by nfslock) and that is routinely started on a RedHat system whether you are using NFS for file sharing or not. So it's not a problem for rpc.statd to be running. It could be, in your case, that rpc.statd isn't in fact starting (check by 'ps -ef | grep statd | grep -v statd'), which would result in the error at shutdown.

The rpc services and just about everything else are running at runlevel 3, so that doesn't have anything to do with it. The only practical difference between runlevel 3 and 5 is that prefdm is running in 5 and it manages the GUI login.

At any rate, I'm glad it's fixed now even though I don't have a clue as to how the loopback interface got deleted.
0
 

Author Comment

by:mjustman
Comment Utility
Thanks for all that info.

Other good news (not incidentally) on the loopback fix what that the linux box now also prints to the PC's printer.
(NOT comparable news from the pc side: but that's a password problem...I"ll post separately)

over and out on this one.

Marilyn
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now