Cisco Labs – Redundant and Resilient networks (8) – GLBP – Gateway Load Balanced Protocol – object tracking


Introduction

During my university studies I was doing a diploma thesis in field of Redundant and reliable networking. The purpose of itwas to create LAB examples for students, so they can test First Hop Redundancy Protocols (FHRP) , Any Transport over MPLS (AToM) and Border Gateway Protocol (BGP) on Cisco platform. These tasks are created to Virtlab (Virtual lab with physical Cisco routers) however configuration is valid and tested on physical Cisco routers as well.

Each task in the series will have its separate post with brief description of the task and schema. Complete task can be downloaded on My Skydrive

ZIP file contains:

  • *.HTML file – complete step by step guide how to perform the task
  • *.PNG – pictures with topology and others
  • *_preconf.txt – file with basic configuration of topology to be able to focus on task goal (IP addresses, interfaces and so on)
  • *_end.txt – file with complete configuration. Once put to the routers, you will get working task
  • *.dia – Topology in free DIA editor
  • *.XML – topology in XML format

To complete the task:

  • Connect your environment accorrding the topology
  • open the file *_preconf.txt from ZIP file with complete task and configure your environment with basic settings so you can start with the task.



GLBP – Object tracking

Title: GLBP – Object tracking

Goal:

  • Configure Gateway Load Balancing Protocol on 192.168.1.0/24 network segment. One group of hosts resides on network segment.
  • PC1 and PC3 represents group 1, its default gateway address is 192.168.1.1.
  • Load balancing is set to round robin by default. Change load balancing mode to weighted, use object tracking and test functionality .

Required time: 120 minutes

Theoretical background:

Links related to this task:

Topology:

GLBP-objecttracking

Configuration:

 

1) Basic IP settings

OSPF will be used for routing.

PC1

      pc1:~#ifconfig eth0 192.168.1.20 netmask 255.255.255.0; set IP address for PCx
      pc1:~#route add default gw 192.168.1.1; set default gateway to GLBP group 1 virtual address

PC2

      pc2:~#ifconfig eth0 20.0.0.2 netmask 255.0.0.0; set IP address for PCx
      pc2:~#route add default gw 20.0.0.1; set default gateway to IP address of EDGE router

PC3

      pc3:~#ifconfig eth0 192.168.1.120 netmask 255.255.255.0; set IP address for PCx
      pc3:~#route add default gw 192.168.1.1; set default gateway to GLBP group 1 virtual address

Router RLB1

      RLB1(config)#interface #RLB1:RLB1-SW1#; configure physical interface IP address of GLBP enabled interface
      RLB1(config-if)#ip address 192.168.1.251 255.255.255.0; physical IP address of GLBP enabled interface
      RLB1(config-if)#no shutdown
      
      RLB1(config)#interface #RLB1:EDGE-RLB1#; configure interface facing to the external network
      RLB1(config-if)#ip address 172.16.1.1 255.255.0.0
      RLB1(config-if)#no shutdown
      RLB1(config-if)#exit
      
      RLB1(config)#router ospf 1 ; configure routing protocol for internal and external network
      RLB1(config-router)#network 172.16.1.0 0.0.255.255 area 0
      RLB1(config-router)#network 192.168.1.0 0.0.0.255 area 0

Router RLB2

Apply analogical settings for the router RLB2.

      RLB2(config)#interface #RLB2:RLB2-SW1#
      RLB2(config-if)#ip address 192.168.1.252 255.255.255.0
      RLB2(config-if)#no shutdown
      
      RLB2(config)#interface #RLB2:EDGE-RLB2#; configure interface facing to the external network
      RLB2(config-if)#ip address 172.17.1.1 255.255.0.0
      RLB2(config-if)#no shutdown
      RLB2(config-if)#exit
      
      RLB2(config)#router ospf 1
      RLB2(config-router)#network 172.17.1.0 0.0.255.255 area 0
      RLB2(config-router)#network 192.168.1.0 0.0.0.255 area 0

Router EDGE

      EDGE(config)#interface #EDGE:PC2-EDGE# ; this network simulates the Internet
      EDGE(config-if)#ip address 20.0.0.1 255.0.0.0
      EDGE(config-if)#no shutdown
      EDGE(config-if)#exit
      EDGE(config)#interface #EDGE:EDGE-RLB2#
      EDGE(config-if)#ip address 172.17.1.2 255.255.0.0
      EDGE(config-if)#no shutdown
      EDGE(config-if)#exit
      EDGE(config)#interface #EDGE:EDGE-RLB1#
      EDGE(config-if)#ip address 172.16.1.2 255.255.0.0
      EDGE(config-if)#no shutdown
      EDGE(config-if)#exit

2) PC1,PC3 -> PC2 connectivity test

Use the following command to test connectivity.

      pc1:~#ping 20.0.0.2; ping command is unsuccessful - no GW could be found
      pc3:~#ping 20.0.0.2; ping command is unsuccessful - no GW could be found

3) GLBP settings

Router RLB1

      RLB1(config)#interface #RLB1:RLB1-SW1# ; enter physical internal interface configuration mode
      RLB1(config-if)#glbp 1 ip 192.168.1.1 ; set virtual GLBP address for group 1
      RLB1(config-if)#glbp 1 name GROUP1 ; set name for group 1
      RLB1(config-if)#glbp 1 priority 50 ; configure GLBP priority - higher value means higher priority, RLB1 will be active forwarder for group 1 other 
      RLB1(config-if)#glbp 1 forwarder preempt ; allow this router to overthrow lower priority forwarders
      RLB1(config-if)#glbp 1 preempt delay minimum 2 ; set overthrow priority minimum delay for 2 seconds
      RLB1(config-if)#glbp 1 weighting 50; set weighting to approx. 50 - 50% of requests will be handled by this forwarder, because RLB2 weight is 50
      RLB1(config-if)#glbp 1 load-balancing weighted; set load balancing algorithm to weighted

Router RLB2

      RLB2(config)#interface #RLB2:RLB2-SW1#
      RLB2(config-if)#glbp 1 ip 192.168.1.1
      RLB2(config-if)#glbp 1 name GROUP1
      RLB2(config-if)#glbp 1 priority 40
      RLB2(config-if)#glbp 1 forwarder preempt
      RLB2(config-if)#glbp 1 preempt delay minimum 2
      RLB2(config-if)#glbp 1 weighting 50
      RLB2(config-if)#glbp 1 load-balancing weighted

Perform function test, make sure that hosts are distributes between RLB routers 50 to 50 percent.

4) Weighting settings

Status of line protocol will be tracked on loopback interfaces.

Router RLB1

      RLB1(config)#track 1 interface loopback 1 line-protocol; line protocol on interface loopback 1 will be tracked in GLBP 
      RLB1(config)#interface #RLB1:RLB1-SW1#
      RLB1(config-if)#glbp 1 load-balancing weighted; set load balancing to weighted mode
      RLB1(config-if)#glbp 1 weighting track 1; glbp will track object 1 changes
      RLB1(config-if)#glbp 1 weighting 50 lower 10 upper 50; set lower (weighting 50 - 10 = 40)and upper values for GLBP tracking, these values are triggered when tracked object status change.

Router RLB2

      RLB2(config)#track 1 interface loopback 1 line-protocol; line protocol on interface loopback 1 will be tracked in GLBP 
      RLB2(config)#interface #RLB2:RLB2-SW1#
      RLB2(config-if)#glbp 1 load-balancing weighted; set load balancing to weighted mode
      RLB2(config-if)#glbp 1 weighting track 1; glbp will track object 1 changes
      RLB2(config-if)#glbp 1 weighting 50 lower 10 upper 50; set lower (weighting 50 - 10 = 40)and upper values for GLBP tracking, these values are triggered when tracked object status change.

5) Object tracking changes

Shutdown loopback 1 on RLB1 and perform function test step 3).Note differences in host assigning.

Shutdown loopback 1 on RLB2, turn on loopback 1 on RLB1 and perform function test step 3). Note differences in host assigning.

Shutdown loopback 1 on RLB2 and perform function test step 3). Note differences in host assigning.

Function test:

1) test ping from PC1,PC3 to PC2

      pc1:~#ping 20.0.0.2; ping command is successful - GW could be found as virtual address 192.168.1.1
      pc3:~#ping 20.0.0.2; ping command is successful - GW could be found as virtual address 192.168.1.1

2) Display GLBP information

      RLB1# sh glbp; this router is Active Virtual Forwarder
      RLB1# debug glbp; debug will show GLBP communication between nodes
      
      RLB2# sh glbp; see result, this router is conditional forwarder for group 1

3) Generate traffic to test weighting functionality

Repeat following steps several times to generate several new ARP requests.

Weighted load balancing is used when we need to distribute load balancing not equaly between forwarders. We can distribute forwarding in custom percentage.

Test step 1

    
    pc1:~#ifconfig eth0 down; turn the interface off
    pc1:~#ifconfig eth0 hw ether 00:80:48:BA:d1:36; change MAC address
    pc1:~#ifconfig eth0 up; turn the interface on
    pc1:~#ifconfig eth0 |grep HWaddr; apply new MAC address
    pc1:~#route add default gw 192.168.1.1; set default GW
    pc1:~#ping 20.0.0.2 -c 2; test connection to outside host
    pc1:~#tracert 20.0.0.2; trace outside host to gather first hop physical interface IP address that handles virtual GW address

Test step 2

    pc1:~#ifconfig eth0 down
    pc1:~#ifconfig eth0 hw ether 00:80:48:BA:d1:37
    pc1:~#ifconfig eth0 up
    pc1:~#ifconfig eth0 |grep HWaddr
    pc1:~#route add default gw 192.168.1.1
    pc1:~#ping 20.0.0.2 -c 2
    pc1:~#tracert 20.0.0.2; note down the first hop physical interface IP address that handles virtual GW address

Test step 3

    pc1:~#ifconfig eth0 down
    pc1:~#ifconfig eth0 hw ether 00:80:48:BA:d1:38
    pc1:~#ifconfig eth0 up
    pc1:~#ifconfig eth0 |grep HWaddr
    pc1:~#route add default gw 192.168.1.1
    pc1:~#ping 20.0.0.2 -c 2
    pc1:~#tracert 20.0.0.2

Repeat test steps: 1,2,3,3,3,2,2 and note down physical IP addresses again.

You can see that for the same MAC address (different forwarders might be used).

Sample result

    00:80:48:BA:d1:36 - 192.168.1.251
    00:80:48:BA:d1:37 - 192.168.1.251
 
    00:80:48:BA:d1:38 - 192.168.1.251
    00:80:48:BA:d1:36 - 192.168.1.252
    00:80:48:BA:d1:37 - 192.168.1.251
    00:80:48:BA:d1:38 - 192.168.1.251
    00:80:48:BA:d1:38 - 192.168.1.251
    00:80:48:BA:d1:38 - 192.168.1.252
    00:80:48:BA:d1:37 - 192.168.1.251
    00:80:48:BA:d1:37 - 192.168.1.251

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s