In this lab, I configured two distribution-layer routers to provide redundant inter-VLAN routing, HSRP gateway redundancy, traffic load balancing, and redundant DHCP services.
The network contains two VLANs: VLAN 10 and VLAN 20. Under normal conditions, each VLAN uses a different router as its HSRP active router. Router-1 is the primary router for VLAN 10, while Router-2 is the primary router for VLAN 20. This distributes the traffic between the two routers instead of sending all traffic through a single router.
Both routers also provide DHCP services for the VLANs. The DHCP address ranges are divided between the two routers so that both can lease addresses to clients.
If one router fails, HSRP automatically moves the affected VLAN's default gateway to the remaining router. The remaining router can also continue providing DHCP service. When the failed router comes back online, HSRP preemption restores the original traffic path based on the configured priorities.
Overall, this lab demonstrates distribution-layer routing redundancy, HSRP-based load balancing, and redundant DHCP services.
The objectives of this lab were to:
Configure Router-1 and Router-2 for inter-VLAN routing using router-on-a-stick.
Configure HSRP for redundant default gateways.
Make Router-1 the HSRP active router for VLAN 10.
Make Router-2 the HSRP active router for VLAN 20.
Configure DHCP services on both routers for both VLANs.
Provide separate DHCP address ranges on the two routers.
Verify that traffic continues to flow when either router fails.
Verify that DHCP service remains available through the remaining router.
Verify that HSRP preemption restores the preferred traffic path after a failed router returns.
Provide simulated Internet connectivity through the Edge Router.
In this scenario, VLAN 10 and VLAN 20 represent data networks that require continuous network connectivity. Two routers are used at the distribution layer to provide inter-VLAN routing and access toward the simulated Internet.
To distribute the routing workload, each router is configured as the preferred HSRP gateway for one VLAN:
VLAN 10: Router-1 is the active router, and Router-2 is the standby router.
VLAN 20: Router-2 is the active router, and Router-1 is the standby router.
This configuration provides both redundancy and traffic distribution. Under normal conditions, VLAN 10 traffic uses Router-1, while VLAN 20 traffic uses Router-2.
Both routers also provide DHCP services. The available DHCP addresses are divided between the routers so that either router can continue assigning addresses if the other router becomes unavailable.
If Router-1 fails, HSRP makes Router-2 the active gateway for VLAN 10. VLAN 10 traffic can then reach the Edge Router through Router-2. Similarly, if Router-2 fails, Router-1 takes over VLAN 20 traffic.
When the failed router returns, HSRP preemption allows the router with the higher configured priority to become active again. This returns each VLAN to its preferred routing path.
To simulate Internet connectivity, the Edge Router has a loopback interface configured with the address 8.8.8.8. This address represents an Internet destination and is used to test connectivity and verify the routing path.
The topology contains:
One multilayer switch (MLS) acting as the VTP server.
Two access switches.
Two distribution routers running HSRP.
One Edge Router representing the Internet connection.
End devices connected to VLAN 10 and VLAN 20.
The MLS distributes VLAN information using VTP, while the access switches operate as VTP clients. Router-1 and Router-2 provide redundant inter-VLAN routing and gateway services.
The following addressing plan is used in the lab:
Device / Interface Network IP Address Purpose
VLAN 10 192.168.10.0/24 — Data VLAN 10
VLAN 10 HSRP VIP — 192.168.10.1 Default gateway
Router-1 VLAN 10 — 192.168.10.2 HSRP active
Router-2 VLAN 10 — 192.168.10.3 HSRP standby
VLAN 20 192.168.20.0/24 — Data VLAN 20
VLAN 20 HSRP VIP — 192.168.20.1 Default gateway
Router-1 VLAN 20 — 192.168.20.2 HSRP standby
Router-2 VLAN 20 — 192.168.20.3 HSRP active
Router-1 – Edge Router 172.16.10.0/30 — Transit network
Router-1 — 172.16.10.2 Edge-facing interface
Edge Router — 172.16.10.1 Router-1 next hop
Router-2 – Edge Router 172.16.20.0/30 — Transit network
Router-2 — 172.16.20.2 Edge-facing interface
Edge Router — 172.16.20.1 Router-2 next hop
Edge Router Loopback — 8.8.8.8/32 Simulated Internet destination
DHCP address ranges are divided between the two routers. Router-1 primarily leases addresses from the lower part of each VLAN's range, while Router-2 leases addresses from a different portion of the same subnet.
Below is the configurations I applied on each device.
en
conf t
hostname MLS
vlan 10
vlan 20
exit
vtp mode server
vtp version 2
vtp domain Test
interface range gig1/0/1-4
switchport mode trunk
switchport trunk allowed vlan 10,20
exit
do write
en
conf t
hostname Router-1
interface gig0/0/1
no shutdown
exit
interface gig0/0/1.10
encapsulation dot1q 10
ip address 192.168.10.2 255.255.255.0
standby 10 ip 192.168.10.1
standby version 2
standby 10 priority 110
standby 10 preempt
no shutdown
exit
ip dhcp excluded-address 192.168.10.1 192.168.10.9
ip dhcp excluded-address 192.168.10.100 192.168.10.254
ip dhcp pool VLAN-10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 8.8.8.8
exit
interface gig0/0/1.20
encapsulation dot1q 20
ip address 192.168.20.2 255.255.255.0
standby 20 ip 192.168.20.1
standby version 2
standby 20 priority 100
no shutdown
exit
ip dhcp excluded-address 192.168.20.1 192.168.20.99
ip dhcp exclude 192.168.20.200 192.168.20.254
ip dhcp pool VLAN-20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
dns-server 8.8.8.8
exit
interface gig0/0/0
ip address 172.16.10.2 255.255.255.252
no shutdown
exit
ip route 0.0.0.0 0.0.0.0 172.16.10.1
do write
en
conf t
hostname Router-2
interface gig0/0/1
no shutdown
exit
interface gig0/0/1.10
encapsulation dot1q 10
ip address 192.168.10.3 255.255.255.0
standby version 2
standby 10 ip 192.168.10.1
standby 10 priority 100
no shutdown
exit
ip dhcp excluded-address 192.168.10.1 192.168.10.99
ip dhcp excluded-address 192.168.10.200 192.168.10.254
ip dhcp pool VLAN-10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 8.8.8.8
exit
interface gig0/0/1.20
encapsulation dot1q 20
ip address 192.168.20.3 255.255.255.0
standby version 2
standby 20 ip 192.168.20.1
standby 20 priority 110
standby 20 preempt
no shutdown
exit
ip dhcp excluded-address 192.168.20.1 192.168.20.9
ip dhcp excluded-address 192.168.20.100 192.168.20.254
ip dhcp pool VLAN-20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
dns-server 8.8.8.8
exit
interface gig0/0/0
ip address 172.16.20.2 255.255.255.252
no shutdown
exit
ip route 0.0.0.0 0.0.0.0 172.16.20.1
do write
en
conf t
hostname EdgeRouter
interface loopback 1
ip address 8.8.8.8 255.255.255.255
no shutdown
exit
interface gig0/0/0
ip address 172.16.10.1 255.255.255.252
no shutdown
exit
interface gig0/0/1
ip address 172.16.20.1 255.255.255.252
no shutdown
exit
ip route 192.168.10.0 255.255.255.0 172.16.10.2
ip route 192.168.10.0 255.255.255.0 172.16.20.2 110
ip route 192.168.20.0 255.255.255.0 172.16.10.2
ip route 192.168.20.0 255.255.255.0 172.16.20.2 110
do write
en
conf t
hostname SW-1
interface gig0/1
switchport mode trunk
switchport trunk allowed vlan 10,20
exit
vtp mode client
vtp version 2
vtp domain Test
interface fast0/1
switchport mode access
switchport access vlan 10
exit
interface fast0/2
switchport mode access
switchport access vlan 20
exit
do write
en
conf t
hostname SW-2
interface gig0/1
switchport mode trunk
switchport trunk allowed vlan 10,20
exit
vtp mode client
vtp version 2
vtp domain Test
interface fast0/1
switchport mode access
switchport access vlan 10
exit
interface fast0/2
switchport mode access
switchport access vlan 20
exit
do write
I performed several tests to verify HSRP failover, traffic distribution, DHCP redundancy, and connectivity to the simulated Internet.
With both routers operational, I tested connectivity from a client in VLAN 10 to 8.8.8.8.
ping 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Request timed out.
Reply from 8.8.8.8: bytes=32 time=12ms TTL=254
Reply from 8.8.8.8: bytes=32 time=13ms TTL=254
Reply from 8.8.8.8: bytes=32 time=11ms TTL=254
Ping statistics for 8.8.8.8:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 11ms, Maximum = 13ms, Average = 12ms
I then used traceroute to verify the routing path:
tracert 8.8.8.8
Tracing route to 8.8.8.8 over a maximum of 30 hops:
1 0 ms 0 ms 11 ms 192.168.10.2
2 14 ms 0 ms 11 ms 8.8.8.8
Trace complete.
The first hop was 192.168.10.2, confirming that Router-1 was the active HSRP router for VLAN 10.
I shut down Router-1 to simulate a router failure. HSRP then moved the VLAN 10 gateway to Router-2.
I first checked the client's DHCP information:
ipconfig
FastEthernet0 Connection:(default port)
Connection-specific DNS Suffix..:
Link-local IPv6 Address.........: FE80::201:64FF:FEA9:9194
IPv6 Address....................: ::
IPv4 Address....................: 192.168.10.100
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.10.1
The client received an address from the DHCP range configured on Router-2 while continuing to use the HSRP virtual IP 192.168.10.1 as its default gateway.
I then tested connectivity:
ping 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Request timed out.
Reply from 8.8.8.8: bytes=32 time=10ms TTL=254
Reply from 8.8.8.8: bytes<1ms TTL=254
Reply from 8.8.8.8: bytes<1ms TTL=254
Ping statistics for 8.8.8.8:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 10ms, Average = 3ms
The new routing path was confirmed with traceroute:
tracert 8.8.8.8
Tracing route to 8.8.8.8 over a maximum of 30 hops:
1 0 ms 0 ms 1 ms 192.168.10.3
2 11 ms 11 ms 12 ms 8.8.8.8
Trace complete.
The first hop changed from 192.168.10.2 to 192.168.10.3, confirming that Router-2 had taken over VLAN 10 routing.
I powered Router-1 back on and waited for HSRP to reconverge. Because Router-1 has a higher HSRP priority for VLAN 10 and preemption is enabled, it became the active router again.
A new traceroute confirmed the original routing path:
tracert 8.8.8.8
Tracing route to 8.8.8.8 over a maximum of 30 hops:
1 0 ms 10 ms 11 ms 192.168.10.2
2 * 13 ms 13 ms 8.8.8.8
Trace complete.
This confirmed that VLAN 10 traffic returned to Router-1 as the preferred router.
I repeated the same test from a client in VLAN 20. Under normal conditions, Router-2 is the HSRP active router for VLAN 20.
I shut down Router-2 and verified that:
Router-1 became the active HSRP router for VLAN 20.
The client remained able to use the virtual gateway 192.168.20.1.
DHCP service remained available through Router-1.
Traffic continued to reach 8.8.8.8.
After Router-2 returned, HSRP restored Router-2 as the preferred active router.
The lab successfully was created and tested redundant inter-VLAN routing, HSRP-based traffic distribution, and redundant DHCP services.
Under normal conditions, VLAN 10 uses Router-1 while VLAN 20 uses Router-2, distributing the routing workload between the two routers. When either router fails, HSRP allows the remaining router to take over the affected VLAN's default gateway and continue forwarding traffic.
The DHCP configuration also provides an alternative DHCP source on each VLAN by dividing the available address ranges between the two routers. Testing confirmed that clients could obtain addresses and maintain connectivity when one router was unavailable.
After the failed router returned, HSRP preemption restored the preferred routing path based on the configured priorities.
Overall, the lab achieved the intended goal of providing distribution-layer redundancy while also distributing normal traffic across both routers.
The startup configurations and Cisco Packet Tracer project file are available on my GitHub for reference.