LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   dhcp and iptables (https://www.linuxquestions.org/questions/linux-security-4/dhcp-and-iptables-526758/)

toombs 02-08-2007 10:21 AM

dhcp and iptables
 
Is there an iptables rule that would reject all incoming packets from hosts which haven't received their current ip address from a dhcp daemon running on the same server?

acid_kewpie 02-08-2007 11:26 AM

not in itself, but i'm sure you could made a script which watches the leases and adds and removes iptables commands when a lease is taken out. there is no such thing as a dhcp lease being "switched off" or anythign though, so you'd want short lease times i guess, and remove iptables entries when a lease expires.

toombs 02-08-2007 02:35 PM

ok thanks. It would've been nice if I didn't need a script but that's fine. I'll see what I can do.

acid_kewpie 02-08-2007 03:12 PM

well scripts don't have to be complicated. often the work involved to integrate a normal solution can be more than a self made script...

i googled for a relevent subject, and actually ended up back here... http://www.linuxquestions.org/questi...d.php?t=266151 looks useful potentially.

toombs 02-08-2007 04:35 PM

yeah that's exactly what I'm looking for but for a different purpose. I am setting up an nfs server and I only want trusted hosts with known mac addresses to be able to connect. While I was doing this research, though, I thought of a better way. Since the trusted mac's are static, I don't need dhcp to tell iptables which mac addresses are ok. I can just add static rules. It's an interesting concept though, and it would be a very useful feature.

acid_kewpie 02-09-2007 02:58 AM

oh well in that case, yes a static database would be much more preferable. potentially you'd be able to use the dhcpd.conf as that database so as not to have to duplicate the work, but yeah that's right on the money if it's only a local subnet.

toombs 02-09-2007 05:14 PM

I have more experience than you think. The Newbie tag is a little misleading as I just switched nicknames ;)

acid_kewpie 02-10-2007 02:33 AM

erm. ok i'm very happy for you.

acid_kewpie 02-10-2007 02:33 AM

erm. ok i'm very happy for you.


All times are GMT -5. The time now is 09:52 AM.