how to make a log of each ip and mac address
Hello
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. Thank you! vlad |
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.
|
arpwatch might be what your looking for.
|
you could force the arping by doing a scan of the network with nmap....
arpwatch looks like a great suggestion.. |
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. |
arpwatch is a great solution. i used it and already collecting data. thank you for your help!
|
All times are GMT -5. The time now is 07:55 PM. |