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 06-14-2006, 12:23 PM   #1
dan0r
LQ Newbie
 
Registered: Sep 2004
Posts: 16

Rep: Reputation: 0
Can not ping 127.0.0.1


Hey,

Im having problems with the loopback interface.

I cant get a ping reply from it.

My ifconfig returns:


lo Link encap:Local Loopback
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


Seems not to be configured correctly?

Any help fixing?

Many thanks.
 
Old 06-14-2006, 12:46 PM   #2
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 638
Blog Entries: 1

Rep: Reputation: 52
What does your /etc/hosts file look like?
 
Old 06-14-2006, 12:53 PM   #3
dan0r
LQ Newbie
 
Registered: Sep 2004
Posts: 16

Original Poster
Rep: Reputation: 0
im doing ping 127.0.0.1

But my file:

127.0.0.1 localhost.localdomain localhost
 
Old 06-14-2006, 01:19 PM   #4
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
can you copy paste the exact command ran and the output? can you ping other IP address?
 
Old 06-14-2006, 01:29 PM   #5
dan0r
LQ Newbie
 
Registered: Sep 2004
Posts: 16

Original Poster
Rep: Reputation: 0
I can ping external addresses and the internet address assigned in ifconfig.

The exact command im using is:

ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.

--- 127.0.0.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms


It just hangs after this, so i control + c.
 
Old 06-14-2006, 01:42 PM   #6
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
whast the output of 'iptables -L'
 
Old 06-14-2006, 01:47 PM   #7
dan0r
LQ Newbie
 
Registered: Sep 2004
Posts: 16

Original Poster
Rep: Reputation: 0
Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
 
Old 06-14-2006, 04:05 PM   #8
Israfel2000
Member
 
Registered: May 2004
Location: Underground base in the mountains
Distribution: FreeBSD, Fedora, Ubuntu
Posts: 87
Blog Entries: 2

Rep: Reputation: 18
Check the host.allow, host.deny files. Maybe the problem is there.
 
Old 06-14-2006, 04:18 PM   #9
dan0r
LQ Newbie
 
Registered: Sep 2004
Posts: 16

Original Poster
Rep: Reputation: 0
Both are empty.
 
Old 06-15-2006, 03:13 PM   #10
gizza23
Member
 
Registered: Jun 2005
Location: Chicago, IL, USA
Distribution: Fedora Core, CentOS
Posts: 188

Rep: Reputation: 31
Very interesting. Have you tried looking at your configuration scripts for the NIC card? Try looking into the script for the "localloopback" in the network scripts folder of your OS, if there is one. Since you didn't list your distribution this may not help you much but if you are using Red Hat/Fedora, try this folder:

"/etc/sysconfig/network-scripts/"

Edit the file that resembles the loopback interface accordingly. If you don't have this folder or file, manually enter the information for the lo interface as root and see if that works. If it does, you can make a script of that command and have it run on startup.

"ipconfig lo 127.0.0.1 netmask 255.0.0.0"
 
Old 06-15-2006, 03:27 PM   #11
dan0r
LQ Newbie
 
Registered: Sep 2004
Posts: 16

Original Poster
Rep: Reputation: 0
Thumbs up

Hi, thanks for the reply.

Im using Fedora Core 3.

In the directory you said i have:

ifcfg-lo ifdown-ipv6 ifup-aliases ifup-isdn ifup-sl
ifdown ifdown-isdn ifup-bnep ifup-plip ifup-wireless
ifdown-aliases ifdown-post ifup-eth ifup-plusb init.ipv6-global
ifdown-bnep ifdown-ppp ifup-ippp ifup-post network-functions
ifdown-eth ifdown-sit ifup-ipsec ifup-ppp network-functions-ipv6
ifdown-ippp ifdown-sl ifup-ipv6 ifup-routes
ifdown-ipsec ifup ifup-ipx ifup-sit


I cant see any called "loopback" (i have tried ls -al).

I have just ran:

""ifconfig lo 127.0.0.1 netmask 255.0.0.0"

And i can now ping 127.0.0.1.

I think my origional post does not show a subnet mask for the lo interface...

Could you just go over how i can fix this permenantly.

Many thanks for the help.

*EDIT

i have just looked in ifcfg-lo, it seems correct:

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

Last edited by dan0r; 06-15-2006 at 03:30 PM.
 
Old 06-15-2006, 03:53 PM   #12
gizza23
Member
 
Registered: Jun 2005
Location: Chicago, IL, USA
Distribution: Fedora Core, CentOS
Posts: 188

Rep: Reputation: 31
Ok this is where my true newbie colors show. I haven't played with startup scripts in a while so it may help id you back this up with a little more research.

It would be best to isolate this problem but a patch can work until you have time .

Here is what I have for the script:

Code:
#!/bin/bash
#
#description: 	lo startup script
#name: 		/etc/rc.d/init.d/lo

#run ifconfig command

ifconfig lo 127.0.0.1 netmask 255.0.0.0
Make this file in the /etc/rc.d/init.d/ folder under the name of lo.

If it doesn't work, post saying so. I'm not at home at the moment and can't try it out but I can later on when I get off.

I do hope that this works though.

Good luck!

Last edited by gizza23; 06-15-2006 at 04:09 PM.
 
Old 06-15-2006, 04:08 PM   #13
dan0r
LQ Newbie
 
Registered: Sep 2004
Posts: 16

Original Poster
Rep: Reputation: 0
Yea thanks, least i know what the problem was now.

Cheers!

This was driving me mad and stopping things from working.
 
  


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
FC4 won't ping 127.0.0.1 or the internet, but will ping local computers jalsk Linux - Networking 4 11-22-2005 05:59 PM
Eth0 present; Cannot ping 127.0.0.1; next step for driver installation? ergogirl Debian 9 10-18-2005 01:27 AM
DSN: Data format error & relay=[127.0.0.1] [127.0.0.1] calmbomb Linux - Software 0 11-07-2004 03:24 PM
No ping replies on 127.0.0.1 zzero Linux - Networking 14 03-15-2004 10:17 AM
No ping 127.0.0.1 Spi Linux - Networking 11 07-18-2003 11:16 PM

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

All times are GMT -5. The time now is 04:49 AM.

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