LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to time limit a DHCP lease (https://www.linuxquestions.org/questions/linux-server-73/how-to-time-limit-a-dhcp-lease-879720/)

DarkBeer 05-09-2011 04:36 PM

How to time limit a DHCP lease
 
Thinking my question falls into the grey area that may or may not be proper in the networking forum, so decided to try my luck in the server forum first.

I would like to be able to schedule a limit for an IP connection for my kid's computers/iPods. Since I know the MAC addresses of their various hardware items, is there a way to shut down their connectivity at a particular time via the DHCP server or perhaps a firewall rule?
Running Ubuntu 10.04 and Shorewall is being used for the firewall.
Thanks!

acid_kewpie 05-09-2011 04:48 PM

This wouldn't be a DHCP issue really. It's possible with short leases and such, but I'd probably look at iptables level IP filtering. It's not quite what you sound like you want, but a simple static time slot is fairly easy... http://linuxgazette.net/108/odonovan.html Being cleverer than that (maybe something with the "recent" module could work) could get messy with the general background hum of traffic the phones create what with Steve Jobs spying on their every move.

DarkBeer 05-09-2011 05:12 PM

Would it help if I had the DHCP server always assign the same IP to the devices? Perhaps a drop rule in the firewall could be used at that point based on the IP?

acid_kewpie 05-10-2011 12:41 AM

well dhcp *should* give the same address fairly consistently. I guess a lot of this needs you to erm.. "Know your enemy" in terms of what actions are going to be able to be bypassed or such like.

zhjim 05-10-2011 01:38 AM

To make sure it always assigns the same address use something like this
Code:

host 2626-2 {
hardware ethernet 00:11:85:AA:35:90;
fixe-address 2626-2.example.com;
}



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