DHCPD and Assigning Subnets to Different Interfaces
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/etc/dhcpd.conf doesn't explicitly reference interfaces (eth0, etc), just subnets. (I am assuming you already have your interfaces configured properly.)
Here is a dhcpd.conf I use with two subnets, each on its own card. (I've obfuscated the exact addresses with Xs.)
you don't need two files, that's really not a great design to follow. the pool that is allocated from is the one upon which the dhcp request is heard, it's all implicit. similarily, if you use a dhcp relay in a router elsewhere in the netwrok that will forward requests to the server including the ip address of it's listening interface so that too knows which network toallocate from.
Last edited by acid_kewpie; 01-21-2008 at 08:04 AM.
relaying can be done by a workstation, server, router, etc.. the relay agent will be located on any subnets that do not have a local dhcp server on them.
I used ONE dhcp server to hand out addressing to 20 subnets and used the ip helper-address command in the cisco routers to forward all dhcp requests to my dhcp server. It worked flawlessly.
you can see a nice debug of a bootp relay packet there, and in there is the IP address of the cisco router which would have the ip helper-address on it, and so when the dhcp server recieves it it has a reference point to use to know what subnet is relevant.
correct? I am a bit confused. thanks (Empahsis added)
Correct. If I understand your situation, you just need one conf file similar to what I posted (adjust as needed) and one instance of dhcpd. dchpd knows the configuration of each of your NICs and will assign addresses from the proper subnet. As best as I can figure out, the rest of this conversation about relaying, etc. while it might be correct, is beyond what I take to be your fairly basic needs.
EDIT: Just to be clear, my single instance of dhcpd is invoked from within my distoro's /etc/init.d/dhcpd script, but no parameters are supplied to dhcpd. So it is looking at all (in my case, two) NICs.
Last edited by blackhole54; 01-25-2008 at 01:48 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.