Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

What happens when I plug in a Ethernet cable?

I want to be able to see what's happening on the Level 2/3 (I believe the protocols I'm trying to watch is Ethernet, IP (v4 and v6) and DHCP for IP connections).

So, when I plug a cable and the connection is refused, can I try again seeing/debugging what really happen?

share|improve this question
1  
Could you clarify what you're looking for—while I'm pretty sure you don't want to know about the low-level electrical stuff, are you interested in what happens in the kernel? Or in userspace? Or is your network not working, and you want help troubleshooting it? –  derobert Jan 30 '13 at 15:29
1  
@derobert I just edit the question. Thanks for your interest. –  RSFalcon7 Jan 30 '13 at 15:55
add comment

2 Answers

up vote 4 down vote accepted

Bonsi Scott mentioned wireshark, which will allow you to observe ethernet packets, and all the protocol headers going up. It has a nice GUI interface too (the console version is 'tshark'). Wireshark is build on libpcap, which is fairly well documented and easy to use if you are into programming. Libpcap is also the basis of tcpdump which is similiar in purpose to wireshark.

share|improve this answer
    
Just make sure you start capturing packages before plugging the cable in, and stop once you've got the network OK icon (or whatever). Then you can look at the traffic collected. –  vonbrand Jan 30 '13 at 21:31
add comment

I think it depends on your configuration.

  • You can watch logs of your linux-distribution with less +F logfilename, for example less +F /var/log/messages
  • You can use dmesg to look for infos (for example watch -n 1 "dmesg | tail -n 50" is help there as well.)

And you could use a progralm like Wireshark to monitor the packets on the network cable.

share|improve this answer
    
There won't be much to observe in the system logs WRT ethernet packets, except perhaps ones that are rejected by a firewall such as iptables. –  TAFKA 'goldilocks' Jan 30 '13 at 16:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.