Linux - NetworkingThis 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.
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.
I have a machine acting as a router. How can I make a log of each ip and it's respective mac address that accesses the router? I need to compile a list over several days, so to be sure that I have logged almost every mac.
I have outputted to a text file the result of "arp -n" but at any given moment I only see a fraction of the total macs in the lan, so this is not enough.
What if you collect a trace using wireshark/tshark and once you feel you collected enough packets write yourself a script using libpcap to parse through the trace and collect out the mac addresses? Might be more work than you want to do but would get the job done.
That would not be suitable to my situation. I have around 400 clients accessing that router, and they generate around 200mbs of traffic at any given moment. A capture with wireshark would generate an enormous amount of data.
Would it be possible to arping the entire ip class at given intervals, and as it gets responses to log them in a file?
You can always truncate the trace to only collect headers. I also just took a look at arping and see no reason why that wouldn't work as long as you know the IP's/dns_names of your clients. Collecting traces is usually the passive data collection approach when you are not able to actively collect the information but if you are able to send ARP request to each client then that is the way to go since ARP was made for that. It's just that usually if you are sitting at a router and want to probe every possible client that can send traffic through you (such as an ISP) the is no bound to the number of ARP requests you would have to send.
Right, I also use arpwatch for this purpose. No need to reinvent the wheel.
arpwatch keeps a (plaintext) MAC address / IP address / hostname db, and it even reports significant events on the network - e.g. duplicate IP addresses, MAC to IP mapping changes, etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.