LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-01-2009, 09:44 AM   #1
Winanjaya
Member
 
Registered: Sep 2003
Posts: 239

Rep: Reputation: 32
how to uniquely store leased mac address to a file


Dear all,

I am running dhcpd, how to uniquely store leased mac address to a file (list_mac)?
please help

thanks
 
Old 04-01-2009, 10:09 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
a leased mac address?? you don't lease mac addresses, this makes no sense.
 
Old 04-01-2009, 10:20 AM   #3
Winanjaya
Member
 
Registered: Sep 2003
Posts: 239

Original Poster
Rep: Reputation: 32
oops, sorry what I meant is the mac address of leased ip? ..
any idea?

please help

thanks & regards
 
Old 04-01-2009, 12:08 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Can you explain the purpose for doing this? It sounds like this may be a kludge (and a better solution could exist).

You can check your arp cache to see if contains the IP/MAC addresses you need.

If you're looking to monitor IP/MAC pairs, then use arpwatch.
 
Old 04-01-2009, 07:49 PM   #5
Winanjaya
Member
 
Registered: Sep 2003
Posts: 239

Original Poster
Rep: Reputation: 32
Hello,

I am just want to log all mac address of leased ip to a file (list_mac) and after that I would do checking into iptables based on that file (see below)

MAC_LIST=`cat /home/itdept/list_macs`
for i in $MAC_LIST; do
iptables -A INPUT -i eth0 -m mac --mac-source $i -j ACCEPT
done
iptables -A INPUT -i eth0 -j REJECT


any suggestion?

Thanks & Regards
Winanjaya
 
Old 04-02-2009, 02:44 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well on your dhcp server just read the dhcp.leases file.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Single DHCP server ,to provide the ip address to a MAC address in two different subne alix123 Linux - Software 5 05-08-2007 11:16 PM
What file to modify to change a mac address or to save eth0 configuration ikw38 Linux - Networking 2 04-26-2006 04:52 PM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
leased ip address stand Linux - Networking 1 12-11-2002 06:14 AM
couple C++ questions - mac address & last file access time. BrianK Programming 3 07-17-2002 03:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration