Networking Forums

Networking Forums > Computer Networking > Linux Networking > Can't ping itself, but other machines on the network can

Reply
Thread Tools Display Modes

Can't ping itself, but other machines on the network can

 
 
vasanta
Guest
Posts: n/a

 
      09-20-2004, 01:34 PM
Try to ping the same machine, ping gives below error, but I can ping
all other machines on the network. Any idea?. Thanks in advance.

connect: Invalid argument
 
Reply With Quote
 
 
 
 
P Gentry
Guest
Posts: n/a

 
      09-20-2004, 06:46 PM
(E-Mail Removed) (vasanta) wrote in message news:<(E-Mail Removed). com>...
> Try to ping the same machine, ping gives below error, but I can ping
> all other machines on the network. Any idea?. Thanks in advance.
>
> connect: Invalid argument


[me@pbrain]$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.107 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.069 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.060 ms

--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% loss, time 1998ms
rtt min/avg/max/mdev = 0.060/0.078/0.107/0.022 ms

[me@pbrain]$ netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
X.X.24.0 0.0.0.0 255.255.248.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 X.X.24.1 0.0.0.0 UG 0 0 0 eth0

Note that 127.0.0.0 is in the route table and uses the lo interface.

[me@pbrain]$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:400:04:06:AC
inet addr:X.X.25.127 Bcast:255.255.255.255 Mask:255.255.248.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:98390 errors:0 dropped:0 overruns:0 frame:0
TX packets:7493 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:10971597 (10.4 Mb) TX bytes:1051776 (1.0 Mb)
Interrupt:11 Base address:0xe000

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:76 errors:0 dropped:0 overruns:0 frame:0
TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5443 (5.3 Kb) TX bytes:5443 (5.3 Kb)

And note that the local loopback has been configured on the interface.

Should be all you need.

hth,
prg
eamil above disabled
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      09-20-2004, 11:56 PM
In article <(E-Mail Removed) >, vasanta wrote:
>Try to ping the same machine, ping gives below error, but I can ping
>all other machines on the network. Any idea?. Thanks in advance.
>
>connect: Invalid argument


What was the exact command used? What is the network address and netmask?

Old guy

 
Reply With Quote
 
vasanta
Guest
Posts: n/a

 
      09-21-2004, 01:31 AM
Thanks for mail, my problem is, my ip addr is 172.16.37.59, If I ping
to that IP addr, I am getting that error ( I mentioned in my post), if
I try to ping 172.16.37.60 or any other IP addr in that subnet, it
work sfine, I can't ping to the cards own Ip addr. Please klet me know
what was the reason. Thanks in advance,
 
Reply With Quote
 
Floyd L. Davidson
Guest
Posts: n/a

 
      09-21-2004, 02:44 AM
(E-Mail Removed) (vasanta) wrote:
>Thanks for mail, my problem is, my ip addr is 172.16.37.59, If I ping
>to that IP addr, I am getting that error ( I mentioned in my post), if
>I try to ping 172.16.37.60 or any other IP addr in that subnet, it
>work sfine, I can't ping to the cards own Ip addr. Please klet me know
>what was the reason. Thanks in advance,


The reason can indeed be determined from the information given
to you about the loopback interface, /lo/, which should be
configured for address 127.0.0.1 (see the commands previously
mentioned, _ifconfig_ and _netstat_).

That may seem to be unrelated, but the kernel pulls a little
trick on you that isn't obvious. If you send a packet to *any*
IP address that is configured for a device on your host (e.g.,
the 172.16.37.59 address if that is configured for an ethernet
interface), it won't go to that interface but to the loopback
device instead.

Hence there is no difference between doing "ping 172.16.37.59"
and "ping 127.0.0.1". Indeed, if you run _ifconfig_ and make
note of the tx and rx packet counts, and then successfully ping
either of those two IP addresses, you'll see that *only* the
packet counts for the /lo/ device are incremented.

Of course, in your case it appears the /lo/ device is not
configured, so you probably won't get results from either
address, right?

--
FloydL. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
vasanta
Guest
Posts: n/a

 
      09-21-2004, 01:03 PM
I have this command. First I set my IP addr and then I ping my ip
addr.

#ifconfig eth0 172.16.37.78 netmask 255.255.255.0

#ping 172.16.37.78
Connect: Invalid arguement

If I ping other IP addr, for example, I have another machine with
172.16.37.79, then I can pimg that machine from here.

Thanks.
 
Reply With Quote
 
P Gentry
Guest
Posts: n/a

 
      09-22-2004, 05:37 PM
(E-Mail Removed) (vasanta) wrote in message news:<(E-Mail Removed). com>...
> I have this command. First I set my IP addr and then I ping my ip
> addr.
>
> #ifconfig eth0 172.16.37.78 netmask 255.255.255.0
>
> #ping 172.16.37.78
> Connect: Invalid arguement
>
> If I ping other IP addr, for example, I have another machine with
> 172.16.37.79, then I can pimg that machine from here.
>
> Thanks.


Show the output of these two commands (from consol/x-term):
[wizard@oz]$ /sbin/ifconfig -a
[wizard@oz]$ netstat -nr

BTW - if you don't know what the command does just type "man
[command]" for an explanation (and education).

We need to confirm whether the loopback interface is configured on
eth0. Output should similar to my previous post.

If it's not configured you will have to:
[wizard@oz]$ su-
Enter root password ...
[root@oz]# ifconfig down
[root@oz]# ifconfig lo 127.0.0.1
[root@oz]# route add -host 127.0.0.1 lo
[root@oz]# ifconfig up
[root@oz]# exit
[wizard@oz]$ ping -c4 127.0.0.1
output here ...
[wizard@oz]$ ping -c4 172.16.37.78
output here ...
Whoopee!

Now you have to get this initialization into your startup scripts. It
should have been there already -- have no idea why it's not. We need
to know your distro to help with this part (without futzing it).

If you have a graphical tool for this, I suggest you use it to make
sure _all_ file(s) and entries are properly updated. If the nic was
present at install it should have been done then "automagically", but
if you added it afterwards you'll do it by hand.

hth,
prg
email above disabled
 
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
LAN with DHCP in a Linksys router, can't ping local machines Al Schapira Linux Networking 2 07-30-2007 07:40 AM
Cannot ping machines behind a wireless AP Brad Pears Wireless Networks 2 07-15-2005 06:27 PM
Cannot ping machines behind a wireless AP... Brad Pears Wireless Networks 0 07-15-2005 02:17 PM
Peer to peer network with two machines, ping doesn't work linuxquestion@yahoo.com Linux Networking 11 02-02-2004 05:51 AM
Obtain IP but can't ping other machines or gateway Don Smith Windows Networking 1 12-14-2003 01:00 AM



1 2 3 4 5 6 7 8 9 10 11