HSRP With DHCP
In this scenario below what we have configured is Hot Standby Routing Protocol ( HSRP) with DHCP
HSRP is configured for redundancy so if one link goes down we have a transparent recovery and that pretty is much immediate.
When we use a default gateway it will be the gateway of 192.168.1.1 ( This is the virtual IP address of both routers and the gateway for all end users.
In this configuration we use a router for a "host" simulation and place the port on R6 to initiate a dhcp request.
Configuration :
DHCP POOL CONFIGURED ON BOTH R1 and R2
ip dhcp excluded-address 192.168.1.1 192.168.1.5 ( Exclude the IP's that we do not want allocated out )
ip dhcp pool DATA
network 192.168.1.0 255.255.255.0 (Define the network scope we want to give out )
default-router 192.168.1.1 ( The default router is the virtual IP that we setup for HSRP )
HSRP is configured for redundancy so if one link goes down we have a transparent recovery and that pretty is much immediate.
When we use a default gateway it will be the gateway of 192.168.1.1 ( This is the virtual IP address of both routers and the gateway for all end users.
In this configuration we use a router for a "host" simulation and place the port on R6 to initiate a dhcp request.
Configuration :
DHCP POOL CONFIGURED ON BOTH R1 and R2
ip dhcp excluded-address 192.168.1.1 192.168.1.5 ( Exclude the IP's that we do not want allocated out )
ip dhcp pool DATA
network 192.168.1.0 255.255.255.0 (Define the network scope we want to give out )
default-router 192.168.1.1 ( The default router is the virtual IP that we setup for HSRP )
R1:
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
standby 1 ip 192.168.1.1 ( Basic HSRP to allow the virtual IP for both routers to be 192.168.1.1)
R2:
interface FastEthernet0/1
ip address 192.168.1.3 255.255.255.0
duplex auto
speed auto
standby 1 ip 192.168.1.1 (Basic HSRP that allows both R1 and R2 to utilize the virtual IP for both routers)
After configuring HSRP and placing the switch issue the command " show standby" on R1.
We will see either "standby" or whatever state it may be in...."speak", "listen" , etc.....
In this case we are the standby router and the active router is R2 ( 192.168.1.3 ). The HSRP group we are a part of is group 1. The group is defined in setting the standby ip.
"standby <groupnumber> ip <ipaddress>"
standby 1 ip 192.168.1.1
In the above configuration the group number is "1".
R3
Now we are going to configure R3 to technically be a "host" that would request a dhcp address. In this example you will see that R3 actually pulls DHCP from 192.168.1.1. So we will see what we are looking for which is good !
*********BEFORE WE CONFIGURE THE INTERFACE DO A DEBUG***********
debug command:
debug dhcp detail ( when the dhcp requests occur we will see some packet information about the requests come up )
interface FastEthernet0/0
ip address dhcp ( enables an interface to request a DHCP address)
duplex auto
speed auto
no shutdown
Now that we have R3 FastEthernet 0/0 configured to request DHCP and the debug is occurring we should see a debug output like the following:
In the debug we can see that the default gateway is 192.168.1.1 ( HSRP Virtual Address) and the router requested the ip address of 192.168.1.6. Awesome!
I just stumbled across this post and set this up - exactly what I was looking for!
ReplyDeleteThe thing I've come across in testing though is that the active router will issue the ip from the dhcp pool. The routers don't share pools. So what I had to do in this case was split the pools between the two routers, something like this:
r1:
ip dhcp excluded-address 192.168.1.1 192.168.1.10
ip dhcp excluded-address 192.168.1.11 192.168.1.125
r2:
ip dhcp excluded-address 192.168.1.1 192.168.1.10
ip dhcp excluded-address 192.168.1.126 192.168.1.254
So if active router r1 goes down r2 will issue non-overlapping IPs.
Nope, dhcp conflict is in charge of avoiding IP address ducplicity for every pool. So yes, routers can share pools.
Delete