Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-06-2013, 04:35 PM
|
#1
|
Member
Registered: Jan 2013
Distribution: Debian
Posts: 166
Rep:
|
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.
|
|
|
08-06-2013, 05:01 PM
|
#2
|
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099
|
Hi there,
Quote:
Originally Posted by stateless
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
|
|
|
08-06-2013, 05:16 PM
|
#3
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Quote:
Originally Posted by Doc CPU
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.
|
|
|
08-06-2013, 05:30 PM
|
#4
|
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099
|
Hi there,
Quote:
Originally Posted by suicidaleggroll
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
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.
|
|
|
08-06-2013, 05:41 PM
|
#5
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Quote:
Originally Posted by Doc CPU
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).
|
|
|
08-06-2013, 05:59 PM
|
#6
|
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099
|
Hi there,
Quote:
Originally Posted by suicidaleggroll
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
|
|
|
08-06-2013, 06:25 PM
|
#7
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Quote:
Originally Posted by Doc CPU
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... 
|
|
|
08-06-2013, 07:07 PM
|
#8
|
Member
Registered: Jan 2013
Distribution: Debian
Posts: 166
Original Poster
Rep:
|
Quote:
Originally Posted by Doc CPU
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...
|
|
|
08-07-2013, 04:14 AM
|
#9
|
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099
|
Hi there,
Quote:
Originally Posted by stateless
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
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.
|
|
|
08-07-2013, 12:06 PM
|
#10
|
Member
Registered: Jan 2013
Distribution: Debian
Posts: 166
Original Poster
Rep:
|
Quote:
Originally Posted by Doc CPU
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?
|
|
|
All times are GMT -5. The time now is 02:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|