본문 바로가기

Ryu's Tech

[CCNP Switch] GLBP [ Gateway Load Balancing Protocol ]



Gateway 를 이중화 시키는 프로토콜 중 대표적인 것이 MHSRP[Multiple Hot Standby Router Protocol] 였습니다.

이중화라기 보다는 HSRP를 두개를 돌려서 이를 같이 돌아가게 해 주는 것이었는데요,


위와 같이 셋팅을 하여서 로드 밸런싱을 하게 해 주었었습니다. 그런데 보시면 한가지 문제가 있습니다.
로드밸런싱이기는 하나 PC의 Gateway를 보시면, 각각의 Gateway를 다르게 주어야 했습니다.
로드 밸런싱을 해 주는 것은 좋지만 효율성이 조금 떨어진다고 볼 수 있군요.

그렇다면 이를 완벽하게 지원해 주는 것이 GLBP입니다.
아래를 한번 보겠습니다.


GLBP는 위와 같이 하나의 Gateway 주소만 가지고 MHSRP처럼 동작하는 프로토콜입니다.
Gateway 이중화의 가장 이상적인 프로토콜이 아닌가 싶습니다.

HSRP와 같이 GLBP역시 Active Router를 선출합니다. 대신 이를 AVG [ Active Virtual Rotuer ] 라고 부릅니다.


그리고 한 용어가 더 추가되었는데, AVF [ Active Virtual Forwarders ] 라는 녀석인데, 이 것은 GLBP가 돌아가는 Virtual Mac Address 를 가진 라우터를 부르는 호칭이라고 생각하시면 됩니다.

GLBP에서 사용하는 Mac Address는 0007.b400.xxxx 입니다.


다른것보다 그냥 바로 실습을 통해 보여드리겠습니다.


대충 이런 토폴로지로 해 보도록하겠습니다.

RouterA(config)#int fa0/0
RouterA(config-if)#
RouterA(config-if)#glbp ?
  <0-1023>  Group number

RouterA(config-if)#glbp 1 ?
  authentication  Authentication method
  forwarder       Forwarder configuration
  ip              Enable group and set virtual IP address
  load-balancing  Load balancing method
  name            Redundancy name
  preempt         Overthrow lower priority designated routers
  priority        Priority level
  timers          Adjust GLBP timers
  weighting       Gateway weighting and tracking

RouterA(config-if)#glbp 1 ip 172.16.1.254
RouterA(config-if)#glbp 1 priority 200
RouterA(config-if)#glbp 1 preempt
RouterA(config-if)#glbp 1 authentication md5 key-string cisco
RouterA(config-if)#glbp 1 timers msec 500 msec 1500
RouterA(config-if)#glbp 1 load-balancing round-robin
RouterA(config-if)#

보시면 hsrp와 거의 비슷한 것을 보실 수 있습니다.

Router B에서도 똑같이 해줍니다. Priority 는 바꿔야겠죠^^;;

설정은 hsrp랑 다른게 없어서 어려울 것이 없습니다.


RouterA#sh glbp
FastEthernet0/0 - Group 1
  State is Active
    2 state changes, last state change 00:03:07
  Virtual IP address is 172.16.1.254
  Hello time 500 msec, hold time 1.500 sec
    Next hello sent in 0.324 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Authentication MD5, key-string "cisco"
  Preemption enabled, min delay 0 sec
  Active is local
  Standby is 172.16.1.253, priority 150 (expires in 1.368 sec)
  Priority 200 (configured)
  Weighting 100 (default 100), thresholds: lower 1, upper 100
  Load balancing: round-robin
  Group members:
    cc01.1fd8.0000 (172.16.1.252) local
    cc02.1fd8.0000 (172.16.1.253) authenticated
  There are 2 forwarders (1 active)
  Forwarder 1
    State is Active
      1 state change, last state change 00:02:57
    MAC address is 0007.b400.0101 (default)
    Owner ID is cc01.1fd8.0000
    Redirection enabled
    Preemption enabled, min delay 30 sec
    Active is local, weighting 100
  Forwarder 2
    State is Listen
    MAC address is 0007.b400.0102 (learnt)
    Owner ID is cc02.1fd8.0000
    Redirection enabled, 599.692 sec remaining (maximum 600 sec)
    Time to live: 14399.692 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 172.16.1.253 (primary), weighting 100 (expires in 1.192 sec)
RouterA#



이렇게 설정을 보시면 됩니다. 많아 보이지만 생각보다 어려운 것도 없고, 보기도 쉬우실 겁니다.

RouterA#show glbp brief
Interface   Grp  Fwd Pri State    Address         Active router   Standby route
Fa0/0       1    -   200 Active   172.16.1.254    local           172.16.1.253 
Fa0/0       1    1   7   Active   0007.b400.0101  local           -
Fa0/0       1    2   7   Listen   0007.b400.0102  172.16.1.253    -
RouterA#


여기서 보시면 맨 위의 것이 AVG, 그리고 나머지는 AVF 입니다.
Fwd 칸이 공백으로 있는 것이 AVG입니다.

자 이제 PC에서 핑을 한번 쳐 보도록하겠습니다.
PC1




PC2



보시면 핑도 잘 나가지만 ARP 테이블을 보시면 서로 다른 PC에서 IP address는 같지만 Mac Address가
0007.B400.0101
0007.B400.0102
이렇게 두가지가 생기는 것을 볼 수 있습니다.

그 외에도 Load balancing이나 weighting같은 몇가지 설정이 더 있지만 이정도까지만 해보도록 하겠습니다.

그리고 GLBP 는 224.0.0.102 의 Multicast IP 를 사용하고 UDP 3222포트를 사용합니다.