Linux dhcp and dhcp forwarding

I have a question concerning the configuration of dhcp in a situation where there will need to be multiple subnets and dhcp forwarders.

Lets say I have a network 10.0.0.0.  I place a linux based dhcp server at IP 10.0.0.1.  It needs to be set up to deliver ip addresses in the 10.0.2.0 255.255.255.0 range.  The clients will all be part of the same class a domain, but this is just an example.  

However an additional situation applies.  Another device, which acts as a dhcp forwarder is sitting on the 10.0.0.0 network at 10.0.0.2.  Currently lets say that device is forwarding its dhcp packets to the gateway router which is acting as a dhcp server.  I want to change it so that the device forwards the 10.0.0.1 linux dhcp server.  (I know you cant run two dhcp servers at the same time... so the gateway router dhcp service will be shut off before the Linux DHCP service is started.) Changing the forwarding device's settings  is simple.  The problem (at least for me) is that the devices behind the dhcp forwarder need their ips assigned in a specific stretch of the class b 172.16.0.0 range.  

It may be simple but how would I configure the dhcp server to meet this situation... I've seen situations where the linux dhcp is acting as the router for both subnets, but this is not the case, and its not actually sending the dhcp info to a subnet in the second case, its sending the dhcp info to the single ip address.

Thanks
Ian


RebelnorthAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gabriel OrozcoSolution ArchitectCommented:
Ian

I haven't found in that situation yet. but let me try to help

linux dhcpd (BIND is it's name) can only send ip addresses for ranges where the NIC has an ip address. So if you need to be DNS for network 10.0.2.0/24 while yor linux has only 10.0.0.0/24, it will not work. will not work neither for 172.16.0.0/12 range.

So, what to do?
The simplest method is to connect these devices to a different NIC so named will recognize requests from each nick and respond with the range of ip's it has for the ip on that nic.

say eth1 has 10.0.2.x ip address. any broadcast asking for a dhcp server on such interfase will be served with an ip address in the same address space.

so if eth2 has 172.16.0.x ip address, you can connect the device for that network on it and every dhcp broadcast will be served correctly. you can then enable routing for your linux box and packets will be trasversing your linux to/from both networks.

Of course you will need to define three zones inside dhcpd.conf, but that's the only configuration you need.

----------------------------------------------------------

If you cannot do this, then config is more trikier since you will need to know all MAC addresses and assign an ip for them in the dhcpd.conf file. What to do in this case? well:
ad ip aliases to your LAN card (maybe it is eth0?) this is the "by hand" method:

ifconfig eth0:1 10.0.2.1 netmask 255.255.255.0 up
ifconfig eth0:2 172.16.0.1 netmask 255.255.0.0 up  (or whatever your mask is)

and then your named will be able to answer with ip's in such ranges also.

now, for dhcpd to know what ip address to serve, you will need to respond with a fixed ip to each mac address from these networks. this is an extra overhead since you need to collect these addresses first, but it still can work fine.

hope this helps
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RebelnorthAuthor Commented:
this is no longer required thanks for the help.
Ian
:)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.