LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to uniquely store leased mac address to a file (https://www.linuxquestions.org/questions/linux-server-73/how-to-uniquely-store-leased-mac-address-to-a-file-716061/)

Winanjaya 04-01-2009 09:44 AM

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

acid_kewpie 04-01-2009 10:09 AM

a leased mac address?? you don't lease mac addresses, this makes no sense.

Winanjaya 04-01-2009 10:20 AM

oops, sorry what I meant is the mac address of leased ip? ..
any idea?

please help

thanks & regards

anomie 04-01-2009 12:08 PM

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.

Winanjaya 04-01-2009 07:49 PM

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

acid_kewpie 04-02-2009 02:44 AM

well on your dhcp server just read the dhcp.leases file.


All times are GMT -5. The time now is 06:26 AM.