The Linux Administration group is for the discussion of technical issues technical issues that arise during the administration of Linux systems, including maintaining the operating system and supporting end-user applications.

Create Two Networks with Different dhcps

I want to create two different networks in my office: eth0 and eth1. In eth0 I want to provide 10 ips which is given by HCL (static ip's Ip's=196.12.81.131 to 196.12.81.141,Gateway=196.12.81.129, subnet mask=255.255.255.240) I want to assign these IPs as a DHCP on eth0. I want to create 192.168.12.1 DHCP series on eth1.
Can you tell me the steps for creating two dhcp's on eth0 as well as eth1?

Popular White Paper On This Topic

I want to create two different networks in my office: eth0 and eth1. In eth0 I want to provide 10 ips which is given by HCL (static ip's Ip's=196.12.81.131 to 196.12.81.141,Gateway=196.12.81.129, subnet mask=255.255.255.240) I want to assign these IPs as a DHCP on eth0. I want to create 192.168.12.1 DHCP series on eth1.
Can you tell me the steps for creating two dhcp's on eth0 as well as eth1?

Hi
I think we can assign the dhcp to accept one server either it may be eth0 or eth1. The other network should be a static network address. This is my views and let us see what the members add solutions for the same.

You want to have two networks using the same DHCP server but with two network cards, each serving a different network?

I don't think this is possible with the same DHCP server, Why? The
service can only give out IP addresses to one network and the service is
not tied to a network card but to the machine. Meaning You cannot have
two network cards doing dhcp serving to different networks.
I would thence think of sub networks

A single DHCP server cannot run on more than one network card due to DHCP broadcast considerations.
When a PC boots and asks for a DHCP address, it does so by sending a broadcast to 255.255.255.555. Since your DHCP server has two NICs you must create a route for 255.255.255.255 traffic or it will be send to the gateway. Since your DHCP server with 2 NICs can only have one route for 255.255.255.255 you will only be able to server IPs to one of your NICs.

Create two zones in your DNS and name them for the IP's you wish to provide. Put the IP range in your DHCP for handing out.
Use these zone names to place a MAC address in your DHCP tables and restrict the DHCP to only allow the MAC addresses listed to have the IP addresses for that zone.

IE - zone1 is listed in DNS for 192.168.12.X network
zone2 is listed in DNS for 192.168.82.X network.

DHCP listing has two text files zone1.clients and zone2.clients where mac addresses for zone1 are allowed to have 12.X network addresses and 82.X is for zone2

This is only a sketch of how it could be done. You would also have to allow for routing tables and routes assigned to the network cards.

What you are asking about seems to be configuring a Superscope. This has been available since windows server 2000. Dynamic DHCP does not put undue stress on an adequately configured server. It is recommended that a dual NIC or two separate NIC cards be used.

The request is forwarded through the BOOTP Relay to the DHCP
Server. The DHCP Server checks the giaddr field in the
DHCPRequest or Discover message to see what network ID the
request is coming from. The DHCP Server compares this information
with the network ID assigned to its local interface. If the
network ID in the request and the network ID of the DHCP Server's
interface is the same, the DHCP Server will check to see if it
has a scope that can service the request. If it does have a
scope, it continues the DHCP negotiation.
However, if the request from a network ID that is different from
that of the DHCP Server, the DHCP Server will see if it has a
superscope that includes an address pool that can service that
network ID. If it does not have such a superscope, then it will
send a NACK packet, and the DHCP client must start all over
again.
How about adding multiple IP addresses to the DHCP Server's
Interface? In this way, the DHCP Server would be able to compare
the source network ID with the addresses on its interface, and
see that the source was on the name network ID as the DHCP
Server. Now it wouldn't need to look for a superscope.
This will not work! It will not work because when you bind
multiple IP address to a single adapter on the DHCP Server, the
DHCP Server service will only use the primary IP address to make
its assessments. It will not use any of the secondary IP
addresses bound to the adapter.
A solution to this problem could be to include a second NIC on
the DHCP Server and assign it a primary address on the
192.168.2.0/24 network ID. However, using a superscope is a lot
easier and a lot cheaper than adding new hardware.

On my home networks I use Ipfire with 4 nic cards. It handles all DHCP duties and keeps my networks separate. I have one NIC outside the firewall and use it for VOIP, one is inside the firewall and is for guest wireless, TV, Roku, etc..., and the third is for wired and internal wireless where I have personal data I want to keep separate from the other networks.

As a last resource, you could plan installing virtualbox or your preferred
hypervisor, and create two VM, each attached to a NIC, the VMs
does not need to have too much resources if you are planning to use
them only for dhcp servers, no GUI needed, hence, a lot less memory
would be used.

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.