Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
automated mac address discovery
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mooerito
Apprentice
Apprentice


Joined: 16 Dec 2003
Posts: 187
Location: Zurich/Switzerland

PostPosted: Fri Apr 23, 2004 9:34 am    Post subject: automated mac address discovery Reply with quote

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
View user's profile Send private message
Angrybob
Guru
Guru


Joined: 19 Apr 2003
Posts: 575

PostPosted: Fri Apr 23, 2004 10:34 am    Post subject: Reply with quote

arp is what you want, just do this:-

Code:
/sbin/arp -n


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
View user's profile Send private message
mooerito
Apprentice
Apprentice


Joined: 16 Dec 2003
Posts: 187
Location: Zurich/Switzerland

PostPosted: Fri Apr 23, 2004 10:39 am    Post subject: Reply with quote

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
View user's profile Send private message
scout
Veteran
Veteran


Joined: 08 Mar 2003
Posts: 1991
Location: France, Paris en Semaine / Metz le W-E

PostPosted: Fri Apr 23, 2004 10:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Angrybob
Guru
Guru


Joined: 19 Apr 2003
Posts: 575

PostPosted: Fri Apr 23, 2004 11:39 am    Post subject: Reply with quote

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
View user's profile Send private message
mooerito
Apprentice
Apprentice


Joined: 16 Dec 2003
Posts: 187
Location: Zurich/Switzerland

PostPosted: Fri Apr 23, 2004 11:47 am    Post subject: Reply with quote

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
View user's profile Send private message
scout
Veteran
Veteran


Joined: 08 Mar 2003
Posts: 1991
Location: France, Paris en Semaine / Metz le W-E

PostPosted: Fri Apr 23, 2004 11:50 am    Post subject: Reply with quote

mooerito wrote:
i dont need lookups in intervals

Indeed, I read too fast, I tought you needed
_________________
http://petition.eurolinux.org/ - Petition against ePatents
L'essence de la finesse
Back to top
View user's profile Send private message
mooerito
Apprentice
Apprentice


Joined: 16 Dec 2003
Posts: 187
Location: Zurich/Switzerland

PostPosted: Fri Apr 23, 2004 11:57 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum