Sunday, August 14, 2011

HSRP with GNS3

Actually, I have to post HSRP first. But, before I post, I fond out that I have configured only with one HSRP group. As HSRP is available for load-balancing, I have amended my post with two HSRP groups.

Download GNS3 lab file from https://docs.google.com/leaf?id=0B889ogd4ltI2YmY3YTFmOGQtYmI1OC00ZTVmLTk4YTktMzU3NDBjNzg4MzZh&hl

OK, below is lab topology diagram.



Here are lab objectives;
  • R1 and R2 will be running as HSRP using two VIPs (192.168.1.10 and 192.168.1.20)
  • PC1 will be using R2 (with default gateway 192.168.1.10) to reach 4.4.4.4 (R4's loopback).
  • PC2 will be using R1 (with default gateway 192.168.1.20) to reach 4.4.4.4
  • Both of the links 172.16.1.0/24 and 172.16.2.0/24 will be using by two PCs at the same time without wasting another link's bandwidth.
  • Finally, create one loopback interface in R1 (1.1.1.1) to track interface up /down which will lower the priority of R1 and R2 will take over as standby router. In that case, both R2 will be used by two PCs.


OK, let's create R1 as follow. Set decrements value to 102 to release R1's active status when loopbackup interface down.

interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 192.168.1.10
 standby 1 priority 200
 standby 1 preempt
 standby 1 track Loopback0 102
 standby 2 ip 192.168.1.20
 standby 2 preempt

interface Loopback0
 ip address 1.1.1.1 255.255.255.255

interface FastEthernet0/1
 ip address 172.16.1.1 255.255.255.0
 duplex auto
 speed auto
!
router eigrp 1
 network 0.0.0.0
 no auto-summary
--------------------------------------------------
In R2, configure as follow using default priorities 100 for group 1 and 150 for group 2 as R2 will be active for second group.

interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 192.168.1.10
 standby 1 preempt
 standby 2 ip 192.168.1.20
 standby 2 priority 150
 standby 2 preempt

interface FastEthernet0/1
 ip address 172.16.2.2 255.255.255.0
 duplex auto
 speed auto
!
router eigrp 1
 network 0.0.0.0
 no auto-summary

---------------------------
Check HSRP status in R1 and R2 as follow.

R1#sh standby brief

Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa0/0       1    200 P Active  local           192.168.1.1     192.168.1.10
Fa0/0       2    100 P Standby 192.168.1.1     local           192.168.1.20
----------------------
R2#sh standby brief

Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa0/0       1    100 P Standby 192.168.1.2     local           192.168.1.10
Fa0/0       2    150 P Active  local           192.168.1.2     192.168.1.20

As you can see that, group 1's active router is R1 (due to high priority 200 while R2 is default 100) and group 2's active router is R2 (due to R2's priority is 150 while R1 is setting default 100).

As EIGRP routing is running in R1, R2 and R4, try to run traceroute 4.4.4.4 from PC1 and PC2.

Set PC1's default gateway to 192.168.1.10 (HSRP Group 1's VIP) and PC2 to 192.168.1.20 (HSRP Group 2's VIP)

Here is the traceroute output from PC1 to 4.4.4.4. It's using R2 to reach 4.4.4.4

PC1#traceroute 4.4.4.4

Type escape sequence to abort.
Tracing the route to 4.4.4.4

  1 192.168.1.2 48 msec 88 msec 24 msec
  2 172.16.1.4 16 msec 84 msec *

From PC2, as expected, it's using R1 to reach to 4.4.4.4

PC2#traceroute 4.4.4.4

Type escape sequence to abort.
Tracing the route to 4.4.4.4

  1 192.168.1.1 60 msec 72 msec 8 msec
  2 172.16.2.4 52 msec *  72 msec


Because of this both links are load balanced to reach to another end 4.4.4.4 by setting different gateway IPs in each PC.

Try shutting down loopback 0 interface from R1 manually. Both of the PC will use R2 as default gateway as R2 will be active routers for both HSRP groups.


R1#sh standby brief


Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa0/0       1    98  P Standby 192.168.1.1     local           192.168.1.10
Fa0/0       2    100 P Standby 192.168.1.1     local           192.168.1.20
-----------------



R2#sh standby brief


Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa0/0       1    100 P Active  local           192.168.1.2     192.168.1.10
Fa0/0       2    150 P Active  local           192.168.1.2     192.168.1.20

PC1 will be used R2  as shown below as R2 is the active router.

PC1#traceroute 4.4.4.4

Type escape sequence to abort.
Tracing the route to 4.4.4.4

  1 192.168.1.1 44 msec 68 msec 44 msec
  2 172.16.2.4 48 msec 96 msec *

1 comment: