View previous topic :: View next topic |
Author |
Message |
mooerito Apprentice
Joined: 16 Dec 2003 Posts: 187 Location: Zurich/Switzerland
|
Posted: Fri Apr 23, 2004 9:34 am Post subject: automated mac address discovery |
|
|
hi everyone!
i want to build a tool to automatically add new hosts to our network configuration. to make sure noone who isnt authorized can access our net, we check on the mac address of hosts (i know this address can be spoofed, but i like to think our users are to dumb for that). so i need some tool to run on the server which tells me the mac address of a given ip. i suppose this can be done with arp or rarp in some way, but since im not too familiar with those tools and man pages left me clueless how to do this i thought ill ask here for advice.
is there a way of automatically discovering the mac adress of a given ip? commandlinebased would be very convenient, so i can easy incorporate it in our system scripts.
thanks for your help
moo |
|
Back to top |
|
|
Angrybob Guru
Joined: 19 Apr 2003 Posts: 575
|
Posted: Fri Apr 23, 2004 10:34 am Post subject: |
|
|
arp is what you want, just do this:-
and it lists all known mac addresses with their coresponding IP addresses, it shouldn't be too hard to parse it with a simple shell script |
|
Back to top |
|
|
mooerito Apprentice
Joined: 16 Dec 2003 Posts: 187 Location: Zurich/Switzerland
|
Posted: Fri Apr 23, 2004 10:39 am Post subject: |
|
|
looks exactly the thing i was looking for. i tried arp, but obviousely i had done something wrong before. thanks for the help.
moo |
|
Back to top |
|
|
scout Veteran
Joined: 08 Mar 2003 Posts: 1991 Location: France, Paris en Semaine / Metz le W-E
|
Posted: Fri Apr 23, 2004 10:45 am Post subject: |
|
|
Angrybob wrote: | and it lists all known mac addresses with their coresponding IP addresses, it shouldn't be too hard to parse it with a simple shell script |
I think in fact it just reads the arp table that's in the kernel, if you want to make arp requests at a determined interval, you might need arping _________________ http://petition.eurolinux.org/ - Petition against ePatents
L'essence de la finesse |
|
Back to top |
|
|
Angrybob Guru
Joined: 19 Apr 2003 Posts: 575
|
Posted: Fri Apr 23, 2004 11:39 am Post subject: |
|
|
scout wrote: | Angrybob wrote: | and it lists all known mac addresses with their coresponding IP addresses, it shouldn't be too hard to parse it with a simple shell script |
I think in fact it just reads the arp table that's in the kernel, if you want to make arp requests at a determined interval, you might need arping |
yeah thats probably better |
|
Back to top |
|
|
mooerito Apprentice
Joined: 16 Dec 2003 Posts: 187 Location: Zurich/Switzerland
|
Posted: Fri Apr 23, 2004 11:47 am Post subject: |
|
|
i dont need lookups in intervals. i just need a webpage where one can connect to and that shows his mac adress, so he can tell me, or it might get saved automatically to our allow hosts file at a later stage. do you think arp is not good for that? |
|
Back to top |
|
|
scout Veteran
Joined: 08 Mar 2003 Posts: 1991 Location: France, Paris en Semaine / Metz le W-E
|
|
Back to top |
|
|
mooerito Apprentice
Joined: 16 Dec 2003 Posts: 187 Location: Zurich/Switzerland
|
Posted: Fri Apr 23, 2004 11:57 am Post subject: |
|
|
scout wrote: |
Indeed, I read too fast, I tought you needed |
well i think i didnt indicate if io need those or not. and now at least i know a little more about arp. thanks anyway! |
|
Back to top |
|
|
|