Showing posts with label HSRP. Show all posts
Showing posts with label HSRP. Show all posts

Tuesday, October 18, 2011

HSRP with VLAN interfaces

I'm looking for GNS3 file to simulate HSRP with two VLAN interfaces but failed to get the information. Finally, I managed to get through and I'll share soon.

Below is the topology diagram that I have simulated with GNS3.

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





Here is brief description of lab topology.
  • R1 and R2 are HSRP active and standby routers for VLAN 100 and VLAN 200.
  • R3 is the layer 2 switch and enabled trunk in fa1/1 and fa1/2 to allow traffic from R4 (VLAN-100 PC) and R6 (VLAN-200 PC)
  • R1, R2 and R5 are in EIGRP 1 network and ip routing is enabling all routes including loopback of R5 (5.5.5.5). 
  • Simple testing can be done by ping from VLAN 100 PC (R4) to R5's loopback ip 5.5.5.5
  • To simulate HSRP, try to track loopback of R1's interface status. When it's down, R1 will release it's active role to R2 for VLAN 100.
  • With same method, for VLAN 200, configure R2 as active role in VLAN 200. Track loopback 0 of R2's interface status. When it down, R2 will release it's active state for VLAN 200 to R1.
  • By doing so, both VLAN 100 and VLAN 200 will be online all the time even though any of either R1 or R2 down for redundancy.
Detail of configuration steps are as follows;

R1(config)#int fa1/1
R1(config-if)#int vlan 100
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#int fa1/1
R1(config-if)#switchport trunk encapsulation dot1q
R1(config-if)#switchport mode trunk
R1(config-if)#
*Mar  1 00:02:05.887: %DTP-5-TRUNKPORTON: Port Fa1/1 has become dot1q trunk
R1(config-if)#exit
R1(config)#exit
R1#vlan
*Mar  1 00:02:17.683: %SYS-5-CONFIG_I: Configured from console by console
R1#vlan database
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

R1(vlan)#vlan 100
VLAN 100 added:
    Name: VLAN0100
R1(vlan)#exit
APPLY completed.
Exiting....
-----------------------------------------
R1#sh int status

Port    Name               Status       Vlan       Duplex Speed Type
Fa1/0                      notconnect   1            auto    auto 10/100BaseTX
Fa1/1                      connected    trunk      a-full   a-100 10/100BaseTX
Fa1/2                      notconnect   1            auto    auto 10/100BaseTX
Fa1/3                      notconnect   1            auto    auto 10/100BaseTX
Fa1/4                      notconnect   1            auto    auto 10/100BaseTX
Fa1/5                      notconnect   1            auto    auto 10/100BaseTX
Fa1/6                      notconnect   1            auto    auto 10/100BaseTX
Fa1/7                      notconnect   1            auto    auto 10/100BaseTX
Fa1/8                      notconnect   1            auto    auto 10/100BaseTX
Fa1/9                      notconnect   1            auto    auto 10/100BaseTX
Fa1/10                     notconnect   1            auto    auto 10/100BaseTX
Fa1/11                     notconnect   1            auto    auto 10/100BaseTX
Fa1/12                     notconnect   1            auto    auto 10/100BaseTX
Fa1/13                     notconnect   1            auto    auto 10/100BaseTX
Fa1/14                     notconnect   1            auto    auto 10/100BaseTX
Fa1/15                     notconnect   1            auto    auto 10/100BaseTX
-------------------------------------------------
R1#sh int vlan 100
Vlan100 is up, line protocol is up
  Hardware is EtherSVI, address is c200.067c.0000 (bia c200.067c.0000)
  Internet address is 192.168.1.1/24
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     1 packets output, 60 bytes, 0 underruns
     0 output errors, 1 interface resets
     0 output buffer failures, 0 output buffers swapped out
-------------------------------------
R1#sh int trunk

Port      Mode         Encapsulation  Status        Native vlan
Fa1/1     on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa1/1     1-4094

Port      Vlans allowed and active in management domain
Fa1/1     1,100

Port      Vlans in spanning tree forwarding state and not pruned
Fa1/1     1,100
++++++++++++++++++++++++++++++++++++++++++++++++++++

switch(config)#int fa1/3
switch(config-if)#switchport mode access
switch(config-if)#switchport access vlan 100
----------------------------------------
Ping test as follow to R1 and R2 from R4 (VLAN100-PC)

PC#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/236/1044 ms
PC#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/40/84 ms
--------------------------------------------

R2#sh int trunk

Port      Mode         Encapsulation  Status        Native vlan
Fa1/2     on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa1/2     1-4094

Port      Vlans allowed and active in management domain
Fa1/2     1,100,200

Port      Vlans in spanning tree forwarding state and not pruned
Fa1/2     1,100,200
---------------------------------------------
Activate HSRP for VLAN 100 in R1 as follow.

R1(config)#int vlan 100
R1(config-if)#stan
R1(config-if)#standby 1 ip ?
  A.B.C.D  Virtual IP address
  <cr>

R1(config-if)#standby 1 ip 192.168.1.10
R1(config-if)#standby 1 preempt
R1(config-if)#standby 1 priority 110
R1(config-if)#^Z
R1#
*Mar  1 00:21:29.123: %SYS-5-CONFIG_I: Configured from console by console
R1#
*Mar  1 00:21:41.831: %HSRP-5-STATECHANGE: Vlan100 Grp 1 state Standby -> Active
--------------------------------------
R2 HSRP for VLAN 100 as follow;

R2#config t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int vlan 100
R2(config-if)#stan
R2(config-if)#standby 1 ip 192.168.1.10
R2(config-if)#standby 1 preempt
R2(config-if)#^Z
--------------------------------------
Check HSRP status as below.

R1#sh standby
Vlan100 - Group 1
  State is Active
    2 state changes, last state change 00:01:57
  Virtual IP address is 192.168.1.10
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.048 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.1.2, priority 100 (expires in 8.496 sec)
  Priority 110 (configured 110)
  Group name is "hsrp-Vl100-1" (default)
-----------------------------------------------------------------
Activate for VLAN 200 as follow.

R1(config)#int vlan 200
R1(config-if)#standby 2 ip 192.168.2.10
R1(config-if)#standby 2 preempt
R1(config-if)#standby 2 priority 120
R1(config-if)#^Z
R1#
*Mar  1 00:24:35.923: %SYS-5-CONFIG_I: Configured from console by console
R1#
*Mar  1 00:24:46.487: %HSRP-5-STATECHANGE: Vlan200 Grp 2 state Standby -> Active
R1#
*Mar  1 00:25:13.551: %HSRP-5-STATECHANGE: Vlan200 Grp 2 state Active -> Speak
R1#
*Mar  1 00:25:23.551: %HSRP-5-STATECHANGE: Vlan200 Grp 2 state Speak -> Standby
------------------------------------------
VLAN 200 for R2 is as follow.

R2(config)#int vlan 200
R2(config-if)#standby 2 ip 192.168.2.10
R2(config-if)#standby 2 priority 250
R2(config-if)#standby 2 preempt
R2(config-if)#^Z
R2#
*Mar  1 00:25:13.143: %HSRP-5-STATECHANGE: Vlan200 Grp 2 state Speak -> Active
*Mar  1 00:25:13.699: %SYS-5-CONFIG_I: Configured from console by console
---------------------------------------------------
Final HSRP status for VLAN 100 and 200 are as follow in R1.

R1#sh standby
Vlan100 - Group 1
  State is Active
    2 state changes, last state change 00:04:50
  Virtual IP address is 192.168.1.10
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.892 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.1.2, priority 100 (expires in 7.316 sec)
  Priority 110 (configured 110)
  Group name is "hsrp-Vl100-1" (default)
Vlan200 - Group 2
  State is Standby
    4 state changes, last state change 00:01:08
  Virtual IP address is 192.168.2.10
  Active virtual MAC address is 0000.0c07.ac02
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.600 secs
  Preemption enabled
  Active router is 192.168.2.2, priority 250 (expires in 9.548 sec)
  Standby router is local
  Priority 120 (configured 120)
  Group name is "hsrp-Vl200-2" (default)
+++++++++++++++++++++++++++++++++++++++++++++++++++++
In R2,

R2#sh standby
Vlan100 - Group 1
  State is Standby
    1 state change, last state change 00:31:57
  Virtual IP address is 192.168.1.10
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.672 secs
  Preemption enabled
  Active router is 192.168.1.1, priority 110 (expires in 9.040 sec)
  Standby router is local
  Priority 100 (default 100)
  Group name is "hsrp-Vl100-1" (default)
Vlan200 - Group 2
  State is Active
    1 state change, last state change 00:29:27
  Virtual IP address is 192.168.2.10
  Active virtual MAC address is 0000.0c07.ac02
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.660 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.2.1, priority 120 (expires in 9.452 sec)
  Priority 250 (configured 250)
    Track object 20 state Up decrement 140
  Group name is "hsrp-Vl200-2" (default)
++++++++++++++++++++++++++++++++++++++++++++++++++++
Shutdown loopback interface of R2' as below and monitor HSRP changes 

R2(config)#int lo0
R2(config-if)#shut
R2(config-if)#
*Mar  1 00:54:51.655: %TRACKING-5-STATE: 20 interface Lo0 line-protocol Up->Down
R2(config-if)#
*Mar  1 00:54:53.651: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down
*Mar  1 00:54:53.735: %HSRP-5-STATECHANGE: Vlan200 Grp 2 state Active -> Speak
*Mar  1 00:54:54.651: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down
R2(config-if)#
*Mar  1 00:55:03.735: %HSRP-5-STATECHANGE: Vlan200 Grp 2 state Speak -> Standby
R2(config-if)#
---------------------------------------------------------------------------

R2#sh standby
Vlan100 - Group 1
  State is Standby
    1 state change, last state change 00:33:43
  Virtual IP address is 192.168.1.10
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.104 secs
  Preemption enabled
  Active router is 192.168.1.1, priority 110 (expires in 7.564 sec)
  Standby router is local
  Priority 100 (default 100)
  Group name is "hsrp-Vl100-1" (default)
Vlan200 - Group 2
  State is Standby
    3 state changes, last state change 00:01:23
  Virtual IP address is 192.168.2.10
  Active virtual MAC address is 0000.0c07.ac02
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.220 secs
  Preemption enabled
  Active router is 192.168.2.1, priority 120 (expires in 9.316 sec)
  Standby router is local
  Priority 110 (configured 250)
    Track object 20 state Down decrement 140
  Group name is "hsrp-Vl200-2" (default)
-------------------------------------------------
Initial HSRP active, standby state, normal traffic flow path is as shown below.

PC-VLAN100#traceroute 5.5.5.5

Type escape sequence to abort.
Tracing the route to 5.5.5.5

  1 192.168.1.1 72 msec 28 msec 24 msec
  2 172.16.1.5 76 msec *  88 msec
---------------------

PC-VLAN200#traceroute 5.5.5.5

Type escape sequence to abort.
Tracing the route to 5.5.5.5

  1 192.168.2.2 36 msec 48 msec 28 msec
  2 172.16.2.5 32 msec *  40 msec
+++++++++++++++++++++++++++++++++++++++++++++++

After shutdow lo0 from R2, check router path as below.

PC-VLAN200#traceroute 5.5.5.5

Type escape sequence to abort.
Tracing the route to 5.5.5.5

  1 192.168.2.1 28 msec 60 msec 32 msec
  2 172.16.1.5 28 msec *  32 msec
=============================

PC-VLAN100#traceroute 5.5.5.5

Type escape sequence to abort.
Tracing the route to 5.5.5.5

  1 192.168.1.1 48 msec 28 msec 32 msec
  2 172.16.1.5 64 msec *  88 msec
===================

Check the HSRP status of routers as follow;

R2#sh standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Vl100       1    100 P Standby 192.168.1.1     local           192.168.1.10
Vl200       2    250 P Active  local           192.168.2.1     192.168.2.10
---------------------------------

R1#sh standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Vl100       1    110 P Active  local           192.168.1.2     192.168.1.10
Vl200       2    120 P Standby 192.168.2.2     local           192.168.2.10

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 *