LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-06-2013, 04:35 PM   #1
stateless
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 166
Blog Entries: 1

Rep: Reputation: 4
ethernet troubleshooting: can I communicate with other hardware?


I'm no networking specialist, but I have a question about ethernet network troubleshooting: From a Gnu/Linux PC on an ethernet network, is it possible to "see" other nodes/hardware on the network, even if the IP layer hasn't been properly set up (i.e., we all have ip addresses on the same subnet). In other words, is there a command for seeing if there are other MAC addresses on the network other than just yours? (The idea being, to help differentiate whether a communication problem is caused by network topology issues, or by a driver/configuration failure in your own NIC.)

The other day I was setting up my cable Internet (direct PC to modem Ethernet), and I could not get a DHCP address from the modem. The dhcpcd program just timed out every time and gave me a default (IPV4_LL) address. At the time, I couldn't (or didn't know how) to tell if the problem was with the modem (i.e., it simply was not providing DHCP addresses) or if there was something wrong with my Ethernet card and I wasn't able to communicate with it. I played around with various linux commands (ping, arp, netstat, etc.) installed by default on the system, but I couldn't learn any more.

Finally I called the cable guys and found out the modem was not configured correctly. But nevertheless I am still wondering about the troubleshooting aspect of the situation.
 
Old 08-06-2013, 05:01 PM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by stateless View Post
I'm no networking specialist, but I have a question about ethernet network troubleshooting: From a Gnu/Linux PC on an ethernet network, is it possible to "see" other nodes/hardware on the network, even if the IP layer hasn't been properly set up (i.e., we all have ip addresses on the same subnet). In other words, is there a command for seeing if there are other MAC addresses on the network other than just yours?
if we're really talking about the same network - yes, there is a way. Just type 'arp -n' in a console, and you should see a list of all currently available network devices and their MAC and IP addresses. However, since ARP is below IP in the protocol stack, the IP address is displayed only if it's in the same network.

[X] Doc CPU
 
Old 08-06-2013, 05:16 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143
Quote:
Originally Posted by Doc CPU View Post
Hi there,



if we're really talking about the same network - yes, there is a way. Just type 'arp -n' in a console, and you should see a list of all currently available network devices and their MAC and IP addresses. However, since ARP is below IP in the protocol stack, the IP address is displayed only if it's in the same network.

[X] Doc CPU
Curious since I've never used arp before - what would cause a machine on the network to not be displayed via "arp -n"? I tried it out on my machine, and while there are currently somewhere around 19 active machines on the network, plus wifi devices (phones, tablets, etc), only 5 machines are displayed in "arp -n". And it just happens to be the 5 that I've connected to most recently. As a test I SSH'd into one of the machines not listed in "arp -n", then re-ran "arp -n" and there were now 6 machines listed, the 5 previous and the one that I had just SSH'd into.
 
Old 08-06-2013, 05:30 PM   #4
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by suicidaleggroll View Post
Curious since I've never used arp before - what would cause a machine on the network to not be displayed via "arp -n"?
it depends on activity of those machines. An ethernet adapter/driver maintains a list of its neighbors' MAC addresses, but it can only detect them when they're communicating. And typically, machines that do not attract attention vanish from the ARP tables after some time.

Quote:
Originally Posted by suicidaleggroll View Post
I tried it out on my machine, and while there are currently somewhere around 19 active machines on the network, plus wifi devices (phones, tablets, etc), only 5 machines are displayed in "arp -n". And it just happens to be the 5 that I've connected to most recently. As a test I SSH'd into one of the machines not listed in "arp -n", then re-ran "arp -n" and there were now 6 machines listed, the 5 previous and the one that I had just SSH'd into.
What I said. ;-)
It doesn't matter, by the way, whether you try to establish communication to these machines, or if they try to communicate to some other machine. The only thing that matters is that there's a telegram on the network that has their MAC address as the sender. That proves they exist.

It's the same here: When I run arp, it displays the local PC, the internet router and the local multi-purpose server. There's also a printer connected to the network, but since nobody talked to it during the last few days, it doesn't show up in the ARP list.

[X] Doc CPU

Last edited by Doc CPU; 08-06-2013 at 05:31 PM.
 
Old 08-06-2013, 05:41 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143
Quote:
Originally Posted by Doc CPU View Post
It doesn't matter, by the way, whether you try to establish communication to these machines, or if they try to communicate to some other machine.
It does for me. "arp -n" seems to only print out the machines that I have communicated with recently on my box. If they communicate with each other it doesn't show up on "arp -n" on my machine (but it does show up if I run "arp -n" on them).
 
Old 08-06-2013, 05:59 PM   #6
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by suicidaleggroll View Post
It does for me. "arp -n" seems to only print out the machines that I have communicated with recently on my box. If they communicate with each other it doesn't show up on "arp -n" on my machine (but it does show up if I run "arp -n" on them).
alright, I never bothered to challenge that statement, but at least what you observe is against the theory. Which doesn't mean I don't believe you, of course, but it means I have to reinforce my knowledge about ARP as well.

And that's one of the funny things about this kind of forums: Trying to help others, you just can't help learning yourself.

[X] Doc CPU
 
Old 08-06-2013, 06:25 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143
Quote:
Originally Posted by Doc CPU View Post
Hi there,



alright, I never bothered to challenge that statement, but at least what you observe is against the theory. Which doesn't mean I don't believe you, of course, but it means I have to reinforce my knowledge about ARP as well.

And that's one of the funny things about this kind of forums: Trying to help others, you just can't help learning yourself.

[X] Doc CPU
No worries, I was just curious how it worked.

Perhaps, despite all machines being on the same subnet, the 4-port router and misc switches in my network are isolating my machine from the packets being transmitted between two others, which is why arp is only detecting the machines I'm directly communicating with. Clearly I'm not a networking expert...
 
Old 08-06-2013, 07:07 PM   #8
stateless
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 166

Original Poster
Blog Entries: 1

Rep: Reputation: 4
Quote:
Originally Posted by Doc CPU View Post
Hi there,



it depends on activity of those machines. An ethernet adapter/driver maintains a list of its neighbors' MAC addresses, but it can only detect them when they're communicating. And typically, machines that do not attract attention vanish from the ARP tables after some time.



What I said. ;-)
It doesn't matter, by the way, whether you try to establish communication to these machines, or if they try to communicate to some other machine. The only thing that matters is that there's a telegram on the network that has their MAC address as the sender. That proves they exist.

It's the same here: When I run arp, it displays the local PC, the internet router and the local multi-purpose server. There's also a printer connected to the network, but since nobody talked to it during the last few days, it doesn't show up in the ARP list.

[X] Doc CPU
So, this part of the arp solution confuses me. If I haven't already communicated with the other devices by IP addresses, how will arp list them? Do I need to do some kind of broadcast first?

When I was having the issue I described above, I tried the arp command with various options, and no results were ever returned. The table seemed to be empty. Though, admittedly, I can't explicitly remember using the -n option...
 
Old 08-07-2013, 04:14 AM   #9
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by stateless View Post
So, this part of the arp solution confuses me. If I haven't already communicated with the other devices by IP addresses, how will arp list them? Do I need to do some kind of broadcast first?
yes, ARP works with broadcasts, and you need ARP before you can even talk IP.
It's like you enter a large office room and call into the room: "Who is Mr. Wilkens?" - Hopefully, somebody replies, "That's me", so you can now make a note that the third desk on your left is Mr. Wilkens'. Now you can walk up to his desk and talk to Mr. Wilkens in semi-private (no broadcast). Next time you have to contact him again, you remember where his desk is. That's the ARP cache. ;-)
More seriously: http://en.wikipedia.org/wiki/Address...ution_Protocol

Quote:
Originally Posted by stateless View Post
When I was having the issue I described above, I tried the arp command with various options, and no results were ever returned. The table seemed to be empty. Though, admittedly, I can't explicitly remember using the -n option...
I only used it because otherwise the arp command listed host names instead of IP addresses.

[X] Doc CPU

Last edited by Doc CPU; 08-07-2013 at 04:15 AM.
 
Old 08-07-2013, 12:06 PM   #10
stateless
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 166

Original Poster
Blog Entries: 1

Rep: Reputation: 4
Quote:
Originally Posted by Doc CPU View Post
Hi there,



yes, ARP works with broadcasts, and you need ARP before you can even talk IP.
It's like you enter a large office room and call into the room: "Who is Mr. Wilkens?" - Hopefully, somebody replies, "That's me", so you can now make a note that the third desk on your left is Mr. Wilkens'. Now you can walk up to his desk and talk to Mr. Wilkens in semi-private (no broadcast). Next time you have to contact him again, you remember where his desk is. That's the ARP cache. ;-)
More seriously: http://en.wikipedia.org/wiki/Address...ution_Protocol



I only used it because otherwise the arp command listed host names instead of IP addresses.

[X] Doc CPU
So, what is the exact broadcast command used, then?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Communicate using only MAC address (raw ethernet) purpose Linux - Networking 0 07-14-2011 03:38 PM
Hardware troubleshooting of motherboard on Debian shayno90 Debian 1 05-28-2011 11:54 PM
Troubleshooting with hardware tests Toonses82 Linux - Hardware 5 05-13-2011 07:44 PM
Looking to linux for hardware troubleshooting jstars Linux - Hardware 15 07-19-2007 08:45 AM
program to communicate directly with ethernet sabby Programming 4 12-18-2002 12:37 PM

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

All times are GMT -5. The time now is 02:06 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