LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 02-10-2009, 05:22 PM   #1
atomic.rabbit
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Rep: Reputation: 0
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
 
Old 02-10-2009, 05:51 PM   #2
j-osh
Member
 
Registered: Nov 2008
Location: Madison, WI
Posts: 34

Rep: Reputation: 16
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.
 
Old 02-10-2009, 06:00 PM   #3
atomic.rabbit
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Original Poster
Rep: Reputation: 0
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?
 
Old 02-10-2009, 06:43 PM   #4
j-osh
Member
 
Registered: Nov 2008
Location: Madison, WI
Posts: 34

Rep: Reputation: 16
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.
 
Old 02-10-2009, 07:13 PM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
arpwatch might be what your looking for.
 
Old 02-11-2009, 08:36 AM   #6
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
you could force the arping by doing a scan of the network with nmap....

arpwatch looks like a great suggestion..
 
Old 02-11-2009, 12:12 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, FreeBSD
Posts: 3,925
Blog Entries: 5

Rep: Reputation: Disabled
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.
 
Old 02-12-2009, 02:40 AM   #8
atomic.rabbit
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Original Poster
Rep: Reputation: 0
arpwatch is a great solution. i used it and already collecting data. thank you for your help!
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make DHCP answer only to select mac address? mangueJOE Linux - Networking 3 10-15-2008 12:37 AM
will tinyproxy or Dansguardian log mac address gfem Linux - Software 2 02-26-2007 06:55 PM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
mac address log lyte Linux - Security 2 12-10-2004 09:14 PM
How would i log the source MAC address w/ iptables? phek Linux - Security 12 12-14-2001 12:18 PM


All times are GMT -5. The time now is 05:05 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration