05-13-2011 01:07 AM - edited 03-06-2019 05:02 PM
Hi all,
I have two DHCP servers in Server VLAN, and clients are in different VLAN that is User VLAN. Both the DHCP server will have the same Pool. How can I use them in case of redundancy?
How can I set Relay agent for those DHCP servers? Is it possible using IP SLA? If possible Pls. reply me.
Thank you….
05-13-2011 01:26 AM
Hello!
I would do the following
- on both DHCP server I would configure 2 pools (one for Server Vlan, one for User Vlan)
- place one DHCP server on each vlan (one dhcp server in server vlan, one dhcp server in User Vlan)
- on the SVI (Layer 3 Vlan Interfaces) I would add the dhcp server in the other vlan with command:
"ip helper-address..." (on the Server Vlan SVI: ip helper-address "IP_addr_dhcp_server_in_User_Vlan" and viceversa for User Vlan SVI)
You have to add this command only for DHCP servers that are out of the defined VLAN.
In this way, when the DHCP server in, let's say, Server VLAN crash, the "ip helper-address..." will be used to direct DHCP requests to server in User VLAN and viceversa.
That's why you need to configure both pools (subnet for Server Vlan and User Vlan) on both DHCP server.
I hope this helps you.
Cheers,
Calin
05-13-2011 02:03 AM
Hi Calin,
Actually both the DHCP servers are placed in server VLAN and pools will be created for User VLAN only on both DHCP server . Clients from User VLAN will request for IP address to the DHCP Server. Two DHCP servers are created for redundancy, when one DHCP server goes down the client will request for IP to another DHCP Server.
Is there any mechanism to implement, that Router will till communicate with DHCP server1 it will add ip helper-address
Diagram is attached...
Thank you.....
05-13-2011 02:16 AM
In CLI, under interface configuration
ip helper-address _server1_ip_
ip helper-address _server2_ip_
you can add both servers. The packet will be send to both servers, so your redundancy is assured.
If you want instead to dynamically add the command ip helper-address for one of those DHCP servers based on reachability (of the DHCP server) , you can use a combination of IP SLA and EEM.
Cheers,
Calin
05-13-2011 02:49 AM
Hi Calin,
I've added two helper-address but there is possibility for IP Conflict. Suppose one client request for IP through relay agent, then relay agent sends the request to DHCP Server1, then DHCP Server leases one IP suppose 10.16.0.1. When second client request for IP suppose the at that time relay agent send the request to second DHCP Server, second server does not know about the IP address given by DHCP Server1 and leases same IP address to the client. At this time it may conflict.
05-13-2011 02:25 AM
You can't tell a router/L3 switch to use one ip helper-address and then use another if the first goes down (although you may be able to script something with EEM). So if you have 2 ip helper-addresses they will both be used.
However there is a much easier solution.
1) on the L3 interface for the user vlan add both ip helper-addresses
2) split the user pool of IP addresses between the 2 DHCP servers. 192.168.5.1 is assumed to be the L3 vlan interface IP ie, the default-gateway
pool = 192.168.5.0 255.255.255.0
DHCP server 1
pool = 192.168.5.2 -> 192.168.5.127
subnet mask = 255.255.255.0
default-gateway = 192.168.5.1
excluded IPs = 192.168.128 -> 192.168.5.254
DHCP server 2
pool = 192.168.5.128 -> 192.168.5.254
subnet mask 255.255.255.0
default-gateway 192.168.5.1
excluded IPs = 192.168.5.2 -> 192.168.5.127
Note that the subnet mask and the DG are the same for both pools.
With the above setup you won't get any IP address conflicts because each DHCP server has it's own specific addresses. Either DHCP server can respond to DHCP request for clients and if one goes down the other will still hand out addresses for the 192.168.5.0/24 subnet.
Jon
05-13-2011 02:40 AM
Yes,
it is called 80/20 rule. I cannot implement this because of limitted IP range.
05-13-2011 04:34 AM
ms_sourav wrote:
Yes,
it is called 80/20 rule. I cannot implement this because of limitted IP range.
It's not the 80/20 rules as far as i know. The 80/20 rule is to do with local and remote traffic, nothing to do with DHCP so i think you are getting mixed up.
In your post to Calin you mention DHCP conflicts. That is exactly what the solution i posted is designed to avoid.
I don't know what you mean by limited IP range. If you mean one DHCP server cannot provide enough addresses for all clients in that vlan then simply create another user vlan.
Basically if you use /24 subnets and you want to make sure you always have enough IPs on one DHCP server then only allocate up to 126 clients in any one vlan. Then do as previously suggested and split the pool between the 2 DHCP servers.
Jon
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide