LinuxQuestions.org
Review your favorite Linux distribution.
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 09-06-2013, 03:57 PM   #1
rclocher3
LQ Newbie
 
Registered: Sep 2013
Posts: 3

Rep: Reputation: Disabled
Question can't ping Linux computer by IP address unless it pings the other computer first


Hi all, I've got a real doozy of a question. I'm trying to troubleshoot a Samba problem on my computer running Ubuntu 13.04 (Raring Ringtail), and I discovered that pinging it by IP address from another computer times out, unless the Ubuntu computer has pinged the other computer first. Pinging by hostname doesn't work either.

The Ubuntu computer is connected to a DSL router via WiFi. The other two computers in the network run Windows XP; one uses WiFi and the other uses ethernet. The computers are all in the usual 192.168.0.x subnet, and all have 255.255.255.0 subnet masks. The Ubuntu computer's firewall ufw is inactive. I did "iptables -L" and there doesn't seem to be any other firewalling happening. The Windows computers ping each other without any problem.

I tried running tcpdump:
rob@teeny:~$ sudo tcpdump -ni eth1
13:08:46.754758 ARP, Request who-has 192.168.0.105 tell 192.168.0.1, length 28
13:08:46.754817 ARP, Reply 192.168.0.105 is-at 00:26:82:af:a1:f6, length 28

The computer receives an ARP request from the gateway and responds to it, but it never sees the ping!

The strange thing is that if I ping the Windows computer first, then as long as the Windows computer is listed in the ARP cache as shown by "arp -a", then the Ubuntu computer will respond to ping requests, but the response times vary tremendously, from 1 ms to timing out:

Code:
C:\>ping -t teeny
 
Pinging teeny.PK5001Z [192.168.0.105] with 32 bytes of data:
 
Reply from 192.168.0.105: bytes=32 time=1024ms TTL=64
Reply from 192.168.0.105: bytes=32 time=1ms TTL=64
Reply from 192.168.0.105: bytes=32 time=330ms TTL=64
(skipping a bit...)
 
Ping statistics for 192.168.0.105:
    Packets: Sent = 10, Received = 9, Lost = 1 (10% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1659ms, Average = 461ms
I'm really stuck. I need Samba, and I think this problem is related to my Samba problem. Does anyone have any ideas?
 
Old 09-07-2013, 11:44 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I gather the linux box has the issue. Has it a dhcp license from the router?
 
1 members found this post helpful.
Old 09-07-2013, 04:07 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
" I discovered that pinging it by IP address from another computer times out, unless the Ubuntu computer has pinged the other computer first."

I'd guess an arp issue.

Pinging by hostname doesn't work either

nslookup or dig or just add in name to hosts file.

Ping is not a great choice to use for tests anymore.
 
1 members found this post helpful.
Old 09-10-2013, 01:46 PM   #4
rclocher3
LQ Newbie
 
Registered: Sep 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi business_kid and jefro, and thanks for looking into my problem. Yes, the wireless router/DSL modem is running DHCP, and web browsing works great, but there's a problem with Samba and with ping. I think the Samba and ping problems are related. If I can't ping by IP address then adding names to /etc/hosts won't help. I'm not really worried about ping, but ping is simple, so if I can troubleshoot that then maybe I'll know why Samba is broken.

So I put windump (Windows port of tcpdump) on the XP machine and fired it up, and then I tried to ping the Ubuntu computer from a different window on the same XP computer:

C:\>windump -i 2 -n
windump: listening on \Device\NPF_{CC5BAD95-9B3C-4353-B5E8-D31F3523D825}
[In another window I entered the command "ping 192.168.0.105" after starting windump.]
21:06:51.300570 arp who-has 192.168.0.105 tell 192.168.0.211
21:06:56.283240 arp who-has 192.168.0.105 tell 192.168.0.211
21:07:01.780075 arp who-has 192.168.0.105 tell 192.168.0.211
21:07:07.251531 arp who-has 192.168.0.105 tell 192.168.0.211

The XP machine .211 is asking who has .105, but the Ubuntu computer .105 isn't responding. The XP computer never sent the ICMP echo request packets because it didn't even know the MAC address to ping. You were right that it's an ARP problem, good call jefro! I was running tcpdump on the Ubuntu computer, and it never saw any packets at all. For the sake of comparison I rebooted the Ubuntu computer into the seldom-used Windows 7 side and fired up Wireshark on it, and ran windump on the XP computer again, and tried the ping experiment again between the two Windows computers. Here's the windump results from .211:

C:\>windump -i 2 -n
windump: listening on \Device\NPF_{CC5BAD95-9B3C-4353-B5E8-D31F3523D825}
[In another window I entered the command "ping 192.168.0.105" after starting windump.]
00:18:51.052338 arp who-has 192.168.0.105 tell 192.168.0.211
00:18:51.055252 arp reply 192.168.0.105 is-at 00:26:82:af:a1:f6
00:18:51.055259 IP 192.168.0.211 > 192.168.0.105: ICMP echo request
00:18:51.057750 arp who-has 192.168.0.211 tell 192.168.0.105
00:18:51.057757 arp reply 192.168.0.211 is-at 00:12:17:64:ed:f1
00:18:51.059691 IP 192.168.0.105 > 192.168.0.211: ICMP echo reply
00:18:52.040531 IP 192.168.0.211 > 192.168.0.105: ICMP echo request
00:18:52.042355 IP 192.168.0.105 > 192.168.0.211: ICMP echo reply

Everything is normal there. (The Wireshark log from .105 was identical.) So in the first experiment, when the Ubuntu computer running tcpdump never saw the ARP requests, I think there actually were ARP requests that it could see, because when I ran Winshark on Windows 7 (on the same computer even) then there were the ARP requests. I think that the Ubuntu kernel was ignoring the ARP requests so that even tcpdump couldn't see them. If the Ubuntu machine is ignoring ARP requests, then I'm not surprised Samba isn't working.

If anyone can shed some light on why the Ubuntu machine is ignoring ARP requests, that would be great. In the meantime I can Google "Linux not responding to ARP" or something. If I know what to Google then my problem is half-solved already
 
Old 09-10-2013, 02:49 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Wonder if the nic driver is faulty? Kind of doubt the kernel.

Arp may also be some router caused issue if you have a smart router.


Set a static arp entry in ubuntu and see.


Not sure if it is possible to block arp alone.


Try a different live cd and see if it works.

Last edited by jefro; 09-11-2013 at 02:37 PM.
 
1 members found this post helpful.
Old 09-10-2013, 05:11 PM   #6
rclocher3
LQ Newbie
 
Registered: Sep 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Okay, Google pointed me to this bug: https://bugs.launchpad.net/ubuntu/+s...wl/+bug/414724 , which explains my problem. Finally! The bug is in the drivers for the Broadcom BCM4313 wifi chipset, which are contained in the bcmwl-kernel-source Ubuntu package. (There is a different driver in the broadcom-sta package; I'm not sure if switching drivers would solve my problem or not.)

So the work-around is to insert a static entry in the ARP cache for all the other computers in the network that need to interact with the affected computer. For a Windows computer, "arp -h" gives an example of how to do that; for a Linux machine, "man arp" should tell you what you need to know. Also the affected computer needs to always have the same IP address, either a static IP address or a DHCP reservation, so that the static ARP entries are guaranteed to be correct. For me there aren't many other computers on my home network, so the work-around isn't much of a hardship. I did the work-around, and now both ping and Samba seem to work, hooray!

Good call again jefro predicting that the problem was a driver! Thanks, it meant a lot to me that someone cared enough to look into my problem.
 
Old 09-11-2013, 02:34 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Awwwhh shucks. Wern't nuttin.



" lot to me that someone cared enough to look into my problem"

There are quite a lot of good folks on LQ. As with all issues it is sometimes hard to guess what is going on 1000 miles away. Glad you got it going and mostly solved it and posted the solution. That may help others.
 
  


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
how to find ip address of other computer in LAN network from my own Computer sanjay786 Linux - Networking 4 08-27-2011 12:48 AM
Ping my computer and the ISP IP address Shows up krisbee Linux - Networking 4 04-05-2009 02:32 PM
Cannot Ping Linux From Other Computer riseinarms Linux - Networking 4 11-22-2007 10:01 PM
Why Scourge (2nd computer) isn't getting ip address from Misery (1st computer) dhcp? pslave Linux - Networking 2 04-09-2006 05:58 AM
my computer(FC4 linux) can't ping other computer? oimm Linux - Networking 1 03-24-2006 08:20 AM

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

All times are GMT -5. The time now is 11:02 PM.

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