DHCP : Firewall Setup

One of the best concise resources for this service is Chapter 23, “Setting Up Boot Servers: DHCP and NIS” in the Red Hat Linux Bible: Fedora and Enterprise Edition, by Christopher Negus. See pp. 868 ff. (This book is supplied as part of the Linux Fundamentals course.)

Setting Up Your Firewall for DHCP

It would be nice if you could set up port ranges or multiple ports using the Security Level applet in Fedora. Unfortunately the online consensus is that it doesn’t handle multiple ports or port ranges, so you can’t, for instance, get away with this:

(If this changes, please contact and I’ll update this.)

So, you’re in for a fairly ugly command-line solution. You’ll need to create a new firewall rule. Issue this command as root:

iptables -I INPUT -I eth0 -p udp –sport 67:68 –dport 67:68 -j ACCEPT

This assumes your internal NIC is eth0. Make darn sure you’re not applying this to an externally-facing NIC!

Check the configuration:

iptables -L

You should see your new rule in the listing. Now save the configuration:

iptables-save > /etc/sysconfig/iptables

The next time iptables is restarted, your new rule will be in effect.