'gateway'에 해당되는 글 4건

  1. 2016.08.20 GLBP - Gateway Load Balancing Protocol
  2. 2016.08.16 HSRP - Multiple Group Configuration
  3. 2016.08.16 HSRP - Hot Standby Router Protocol
  4. 2015.04.16 ip default-network

GLBP - Gateway Load Balancing Protocol


Reference.

https://cisconinja.wordpress.com/2009/02/11/glbp-weights-load-balancing-and-redirection/


GLBP를 제대로 이해하는데 자그마치 2일이 걸렸습니다.. weight개념 까지는 쉬웠는데 threshold를 어떻게 쓰는지 이해가 안되서요. 영어만 잘했어도 쉽게 알아들었을 텐데 영어는 언제나 넘사벽이라서.. 예제 하나하나 해보고 뜯어보는데 시간이 많이 걸렸네요. 그래도 덕분에 기억은 오래갈듯 합니다. 이 글을 통해 타이머조정, 인증(인증은 쉬우니까)을 제외한 GLBP의 전부를 마무리 해봅니다.




HSRP, VRRP는 그룹내에서 하나의 라우터만 액티브라우터가 되어 게이트웨이 역할을 수행하므로 다른 라우터들을 유휴상태로 방치하는 비효율의 문제가 있었다.


이러한 문제점을 극복하고자 네트워크 별로 액티브라우터를 다르게 설정하여 트래픽을 분산할 수도 있으나(Multiple-HSRP, Multiple-VRRP), 한 네트워크에 트래픽이 몰리는 경우 마찬가지로 하나의 라우터에만 트래픽이 집중되므로 궁극적인 해결책이 되진 못한다.


이 문제를 해결하기 위한 것이 GLBP이다. 단일 IP로 게이트웨이를 이중화하고, 여러 라우터로 로드밸런싱도 가능하다. 단, 시스코의 독자적인 프로토콜이므로 모든 장비에서 구현할 수 있는것은 아니다.


GLBP는 라우터마다 별개의 가상 MAC주소를 부여하며 이 MAC주소들을 로드밸런싱 규칙에 따라 ARP응답하여 부하를 분산시킨다.


GLBP 그룹별로 하나의 Active Virtual Gateway가 선출된다. AVG선출의 기준은 AVG Priority가 높은 라우터, 동일할경우 높은 IP를 가진 라우터이다. 이 AVG는 그룹내 라우터들에게 최대 4개의 가상 MAC주소를 부여한다. 2번째 우선순위의 라우터는 Stanby AVG가 된다.


AVG로부터 가상 MAC주소를 부여받은 라우터를 Active Virtual Forwarder라고 한다. AVG가 부여할수 있는 가상 MAC주소가 최대 4개이므로, 최대 동작가능한 AVF의 수도 4개가 된다. 그래서 GLBP에는 Forwarder#1, Forwarder#2, Forwarder#3, Forwarder#4의 4개의 AVF그룹이 있고, GLBP그룹에 참여하는 순서대로 Forwarder#1, Forwarder#2, Forwarder#3, Forwarder#4의 owner가 된다.


GLBP에서 weight는 라우터별로 부하분산할 비율을 결정한다. 성능이 좋은 라우터는 weight를 많이, 반대의 경우 적게 설정한다. 또한 인터페이스 트래킹을 통해 weight를 동적으로 조정하거나 아예 AVF가 되지 못하도록 설정할 수 있다. lower threshold값은 AVF가 되지 못하게 할 weight 임계값, upper threshold값은 다시 AVF가 되게 할 임계값이다.


GLBP의 로드밸런싱 규칙은 3가지를 적용할 수 있다.


1. Round Robin - 가장 간단, ARP요청별로 AVF의 MAC주소를 순차로 응답. 모든 AVF트래픽 동일

2. Weighted - AVF마다 설정된 비율로 부하분산 [Ra% = Wa/(Wa+Wb+Wc+Wd)]

3. Host-dependent - 특정 호스트에게 특정 AVF를 거치도록 설정


======================================================================================




R1부터 순차적으로 AVF가 되도록 하기 위해 커맨드 순서를 다음과 같이 입력한다.



R1(config)#int f 0/0

R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#mac 0.0.1
R1(config-if)#no sh
R1(config-if)#
*Mar  1 00:01:26.239: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:01:27.239: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#glbp 1 pre
R1(config-if)#glbp 1 pri 101
R1(config-if)#glbp 1 ip 10.1.1.100
R1(config-if)#ex
R1(config)#
*Mar  1 00:02:05.051: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active
R1이 GLBP 1번 그룹의 AVG가 됨
*Mar  1 00:02:15.051: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Listen -> Active
R1이 GLBP 1번 그룹의 1번 AVF가 됨


R2(config)#int f 0/0
R2(config-if)#ip add 10.1.1.2 255.255.255.0
R2(config-if)#mac 0.0.2
R2(config-if)#no sh
R2(config-if)#
*Mar  1 00:03:27.707: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:03:28.707: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#glbp 1 pre
R2(config-if)#glbp 1 pri 102
R2(config-if)#glbp 1 ip 10.1.1.100
R2(config-if)#ex
R2(config)#
*Mar  1 00:03:51.195: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Active

R2가 GLBP 1번 그룹의 AVG가 됨

*Mar  1 00:04:04.195: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 2 state Listen -> Active

R2가 GLBP 1번 그룹의 2번 AVF가 됨
R1(config)#
*Mar  1 00:07:26.099: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak
R1이 AVG에서 박탈됨


R3(config)#int f 0/0
R3(config-if)#ip add 10.1.1.3 255.255.255.0
R3(config-if)#mac 0.0.3
R3(config-if)#no sh
R3(config-if)#
*Mar  1 00:08:45.367: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:08:46.367: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#glbp 1 pre
R3(config-if)#glbp 1 pri 103
R3(config-if)#glbp 1 ip 10.1.1.100
R3(config-if)#ex
R3(config)#
*Mar  1 00:09:15.107: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Active

R3가 GLBP 1번 그룹의 AVG가 됨
*Mar  1 00:09:28.107: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 3 state Listen -> Active

R3가 GLBP 1번 그룹의 3번 AVF가 됨

R2(config)#

*Mar  1 00:13:15.263: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak

R2 AVG에서 박탈됨


R4(config)#int f 0/0
R4(config-if)#ip add 10.1.1.4 255.255.255.0
R4(config-if)#mac 0.0.4
R4(config-if)#no sh
R4(config-if)#
*Mar  1 00:08:27.647: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:08:28.647: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R4(config-if)#glbp 1 pre
R4(config-if)#glbp 1 pri 104
R4(config-if)#glbp 1 ip 10.1.1.100
R4(config-if)#ex
R4(config)#
*Mar  1 00:08:47.767: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Active

R4가 GLBP 1번 그룹의 AVG가 됨
*Mar  1 00:09:00.767: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 4 state Listen -> Active

R4가 GLBP 1번 그룹의 4번 AVF가 됨

R3(config)#
*Mar  1 00:11:42.179: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak

R3가 AVG에서 박탈됨


R5(config)#int f 0/0
R5(config-if)#ip add 10.1.1.5 255.255.255.0
R5(config-if)#mac 0.0.5
R5(config-if)#no sh
R5(config-if)#
*Mar  1 00:09:14.239: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:09:15.239: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up


여기까지 설정하고 GLBP상태를 확인해보면 R4가 AVG로 선정되었으며 Forwarder1은 R1, Forwarder2는 R2, Forwarder3는 R3, Forwarder4는 R4가 된 것을 알 수 있다.


R4(config)#do show glbp brief
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   104 Active   10.1.1.100      local           10.1.1.3 첫번째줄이 AVG 상태
Fa0/0       1    1   -   Listen   0007.b400.0101  10.1.1.1        -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Active   0007.b400.0104  local           -


R5까지 GLBP그룹에 참여시킨다.


R5(config-if)#glbp 1 pre
R5(config-if)#glbp 1 pri 105
R5(config-if)#glbp 1 ip 10.1.1.100
R5(config-if)#ex
R5(config)#
*Mar  1 00:17:06.191: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active

R5가 GLBP 1번 그룹의 AVG가 됨


다시한번 GLBP상태를 확인해보면


R5(config)#do sh glbp br
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   105 Active   10.1.1.100      local           10.1.1.4
Fa0/0       1    1   -   Listen   0007.b400.0101  10.1.1.1        -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Listen   0007.b400.0104  10.1.1.4        -


R5가 AVG로 선정되었지만 4개의 AVF그룹에 대해 Listen상태임을 알 수 있다. GLBP는 가상 MAC주소를 4개까지 줄 수 있기에 R5에게 새로운 MAC주소를 주지 않으며 따라서 AVF가 될 수 없다.


R5의 weight를 증가시켜도 R5는 새로운 MAC주소를 받을 수 없다.


R5(config-if)#glbp 1 w 200


R5(config)#do sh glbp 
FastEthernet0/0 - Group 1
  State is Active
    2 state changes, last state change 00:04:31
  Virtual IP address is 10.1.1.100
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.012 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Preemption enabled, min delay 0 sec
  Active is local
  Standby is 10.1.1.4, priority 104 (expires in 8.440 sec)
  Priority 105 (configured)
  Weighting 200 (configured 200), thresholds: lower 1, upper 200
  Load balancing: round-robin
  Group members:
    0000.0000.0001 (10.1.1.1)
    0000.0000.0002 (10.1.1.2)
    0000.0000.0003 (10.1.1.3)
    0000.0000.0004 (10.1.1.4)
    0000.0000.0005 (10.1.1.5) local
  There are 4 forwarders (0 active)
  Forwarder 1
    State is Listen
    MAC address is 0007.b400.0101 (learnt)
    Owner ID is 0000.0000.0001
    Redirection enabled, 593.464 sec remaining (maximum 600 sec)
    Time to live: 14393.464 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.1 (primary), weighting 100 (expires in 3.460 sec)
  Forwarder 2
    State is Listen
    MAC address is 0007.b400.0102 (learnt)
    Owner ID is 0000.0000.0002
    Redirection enabled, 595.456 sec remaining (maximum 600 sec)
    Time to live: 14395.452 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.2 (primary), weighting 100 (expires in 5.452 sec)
  Forwarder 3
    State is Listen
    MAC address is 0007.b400.0103 (learnt)
    Owner ID is 0000.0000.0003
    Redirection enabled, 593.208 sec remaining (maximum 600 sec)
    Time to live: 14393.204 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.3 (primary), weighting 100 (expires in 3.204 sec)
  Forwarder 4
    State is Listen
    MAC address is 0007.b400.0104 (learnt)
    Owner ID is 0000.0000.0004
    Redirection enabled, 596.772 sec remaining (maximum 600 sec)
    Time to live: 14396.768 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.4 (primary), weighting 100 (expires in 6.768 sec)


R5의 weight를 기본값인 100에서 200으로 증가시켜도 AVF가 되지 않는다. AVF의 선정은 GLBP그룹에 참여한 순서대로 되기 때문에 기존의 AVF에 변화가 없는한 R5는 AVG임에도 불구하고 게이트웨이로 향하는 트래픽을 전달할 수 없다.


R1에 루프백을 만들고 인터페이스 트래킹을 구현해보자


R1(config)#int l 0
R1(config-if)#
*Mar  1 00:23:53.495: %LINK-3-UPDOWN: Interface Loopback0, changed state to up
*Mar  1 00:23:54.495: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#ex
R1(config)#track 1 int l 0 line-protocol
R1(config-track)#ex
R1(config)#int f 0/0
R1(config-if)#glbp 1 w 100 lower 90 upper 95 weight=100, 90이하일 경우 AVF박탈, 95이상일때 AVF회복
R1(config-if)#glbp 1 w track 1 decrement 20 track 1번이 죽으면 설정한 weight에서 20감소
R1(config-if)#ex
R1(config)#int l 0
R1(config-if)#sh 인터페이스 비활성화
R1(config-if)#
*Mar  1 00:25:44.923: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down
*Mar  1 00:25:45.923: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down
*Mar  1 00:26:18.171: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Active -> Listen

1번 AVF에서 박탈당함
R1(config-if)#do sh glbp | section Forwarder 1
  Forwarder 1
    State is Listen
      2 state changes, last state change 00:00:44
    MAC address is 0007.b400.0101 (default)
    Owner ID is 0000.0000.0001
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.5 (secondary), weighting 200 (expires in 7.076 sec)


루프백 인터페이스를 비활성화하면 weight가 100에서 20을 뺀 80이 된다. 80은 lower threshold값인 90보다 낮으므로 R1은 AVF에서 박탈된다. 따라서 대신 놀고있던 R5가 1번 AVF가 되었다. 다만 유의할 점은 Owner ID가 R1의 MAC주소로 변함이 없다는 점이다.


R1(config)#int l 0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#
*Mar  1 00:42:57.075: %LINK-3-UPDOWN: Interface Loopback0, changed state to up
*Mar  1 00:42:58.075: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
*Mar  1 00:43:35.927: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Listen -> Active

R1이 다시 1번 AVF가 됨


R1의 루프백을 다시 활성화시키니 R1의 weight가 100으로 회복되어 원래대로 1번 AVF가 되었다.


다른 케이스로 R5의 F0/0이 죽어있을 때 R1의 루프백을 죽인다면 1번 AVF는 누가 맡을지 확인한다


R5(config)#int f 0/0
R5(config-if)#sh
R5(config-if)#
*Mar  1 00:43:55.655: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Init
*Mar  1 00:43:57.651: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Mar  1 00:43:58.651: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down


R1(config)#int l 0
R1(config-if)#sh
R1(config-if)#
*Mar  1 00:49:52.439: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down
*Mar  1 00:49:53.439: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down
*Mar  1 00:51:05.359: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Active -> Listen


R4(config)#

*Mar  1 00:41:32.807: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active
*Mar  1 00:42:09.879: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Listen -> Active


R4(config)#do sh glbp br
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   104 Active   10.1.1.100      local           10.1.1.3
Fa0/0       1    1   -   Active   0007.b400.0101  local           -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Active   0007.b400.0104  local           -


위와 같이 R5다음으로 우선순위가 높은 R4가 AVG가 되었고, R3가 Stanby AVG가 되었다. 또한 1번 AVF로 R4가 된 것을 확인할 수 있다. 4번 AVF도 Active 상태로 그대로 있다. 따라서 R4는 1번 AVF, 4번 AVF의 역할을 모두 수행하게 된다.


이 상황에서 R5의 F0/0을 살린다면 1번 AVF를 R4대신 R5가 수행할수 있을지 확인한다.


R5(config)#int f 0/0
R5(config-if)#no sh
R5(config-if)#
*Mar  1 00:54:09.043: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:54:10.043: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Mar  1 00:54:10.463: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Active
R5(config-if)#ex
R5(config)#do show glbp br
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   105 Active   10.1.1.100      local           10.1.1.4
Fa0/0       1    1   -   Listen   0007.b400.0101  10.1.1.4        -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Listen   0007.b400.0104  10.1.1.4        -


R5의 F0/0을 활성화하니 R5가 다시 AVG가 되었고 R4가 Stanby AVG가 되었다. 하지만 1번 AVF는 여전히 R4가 맡고있다.


R1(config)#int l 0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#
*Mar  1 01:02:42.667: %LINK-3-UPDOWN: Interface Loopback0, changed state to up
*Mar  1 01:02:43.667: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
*Mar  1 01:03:14.659: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Listen -> Active

R1(config)#do sh glbp br
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   101 Listen   10.1.1.100      10.1.1.5        10.1.1.4
Fa0/0       1    1   -   Active   0007.b400.0101  local           -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Listen   0007.b400.0104  10.1.1.4        -


R1의 루프백을 살리니 1번 AVF가 R1에게로 넘어갔다.


이번엔 AVF Preemption을 비활성화 한 뒤, R1의 루프백을 죽여보기로 한다.


R2(config)#int f 0/0
R2(config-if)#no glbp 1 forwarder preempt


R3(config)#int f 0/0
R3(config-if)#no glbp 1 forwarder preempt


R4(config)#int f 0/0
R4(config-if)#no glbp 1 forwarder preempt


R5(config)#int f 0/0
R5(config-if)#no glbp 1 forwarder preempt

R1(config)#int l 0
R1(config-if)#shutdown
R1(config-if)#
*Mar  1 01:10:15.787: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down
*Mar  1 01:10:16.787: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down
R1(config-if)#
R1(config-if)#do show glbp
FastEthernet0/0 - Group 1
  State is Listen
    5 state changes, last state change 00:57:13
  Virtual IP address is 10.1.1.100
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 1.592 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Preemption enabled, min delay 0 sec
  Active is 10.1.1.5, priority 105 (expires in 8.156 sec)
  Standby is 10.1.1.4, priority 104 (expires in 9.636 sec)
  Priority 101 (configured)
  Weighting 80, low (configured 100), thresholds: lower 90, upper 95
    Track object 1 state Down decrement 20
  Load balancing: round-robin
  Group members:
    0000.0000.0001 (10.1.1.1) local
    0000.0000.0002 (10.1.1.2)
    0000.0000.0003 (10.1.1.3)
    0000.0000.0004 (10.1.1.4)
    0000.0000.0005 (10.1.1.5)
  There are 4 forwarders (1 active)
  Forwarder 1
    State is Active
      5 state changes, last state change 00:08:14
    MAC address is 0007.b400.0101 (default)
    Owner ID is 0000.0000.0001
    Preemption enabled, min delay 30 sec
    Active is local, weighting 80
  Forwarder 2
    State is Listen
    MAC address is 0007.b400.0102 (learnt)
    Owner ID is 0000.0000.0002
    Time to live: 14399.200 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.2 (primary), weighting 100 (expires in 9.196 sec)
  Forwarder 3
    State is Listen
    MAC address is 0007.b400.0103 (learnt)
    Owner ID is 0000.0000.0003
    Time to live: 14399.192 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.3 (primary), weighting 100 (expires in 9.188 sec)
  Forwarder 4
    State is Listen
    MAC address is 0007.b400.0104 (learnt)
    Owner ID is 0000.0000.0004
    Time to live: 14397.368 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.4 (primary), weighting 100 (expires in 7.364 sec)


weight가 80으로 떨어졌음에도 불구하고 R1이 1번 AVF에서 박탈되지 않는다.


AVF별로 로드밸런싱이 되는것을 확인하려면


Rx(config-if)#glbp 1 client-cache maximum 30

Rx#show glbp detail

Posted by 비형랑#
:

2016/08/16 - HSRP - Hot Standby Router Protocol


이전글에서 제시한 HSRP에는 트래픽이 한곳으로만 집중된다는 문제점이 있다.

게이트웨이를 이중화하여 두개의 경로를 모두 사용하는것이 아니라,

하나의 경로를 사용하되, 장애에 대비한 백업경로를 두는 개념이기 때문이다.

이러한 문제점은 네트워크별로 여러개의 HSRP를 설정하여 액티브라우터를 분산시키면 해결된다.

=======================================================================================


위의 토플로지에서 PC1은 VLAN10에 연결되어있고, PC2는 VLAN20에 연결되어 있다.

VLAN10의 액티브라우터는 R1, VLAN20의 액티브라우터는 R2가 되도록 HSRP를 설정한다.


R1설정

interface FastEthernet0/0.10
 encapsulation dot1Q 10
 ip address 192.168.10.252 255.255.255.0
 standby 10 ip 192.168.10.254
 standby 10 priority 110
 standby 10 preempt
 standby 10 track Serial2/0 100
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 192.168.20.252 255.255.255.0
 standby 20 ip 192.168.20.254
 standby 20 priority 50


R2설정

interface FastEthernet0/0.10
 encapsulation dot1Q 10
 ip address 192.168.10.253 255.255.255.0
 standby 10 ip 192.168.10.254
 standby 10 priority 50
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 192.168.20.253 255.255.255.0
 standby 20 ip 192.168.20.254
 standby 20 priority 110
 standby 20 preempt
 standby 20 track Serial2/0 100

========================================================================================

설정결과확인

R1#show stan
FastEthernet0/0.10 - Group 10
  State is Active
    2 state changes, last state change 02:04:49
  Virtual IP address is 192.168.10.254
  Active virtual MAC address is 0000.0c07.ac0a
    Local virtual MAC address is 0000.0c07.ac0a (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.368 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.10.253, priority 50 (expires in 9.368 sec)
  Priority 110 (configured 110)
    Track interface Serial2/0 state Up decrement 100
  IP redundancy name is "hsrp-Fa0/0.10-10" (default)
FastEthernet0/0.20 - Group 20
  State is Standby
    4 state changes, last state change 02:00:42
  Virtual IP address is 192.168.20.254
  Active virtual MAC address is 0000.0c07.ac14
    Local virtual MAC address is 0000.0c07.ac14 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.356 secs
  Preemption disabled
  Active router is 192.168.20.253, priority 110 (expires in 7.468 sec)
  Standby router is local
  Priority 50 (configured 50)
  IP redundancy name is "hsrp-Fa0/0.20-20" (default)


R2#show stan
FastEthernet0/0.10 - Group 10
  State is Standby
    4 state changes, last state change 02:03:48
  Virtual IP address is 192.168.10.254
  Active virtual MAC address is 0000.0c07.ac0a
    Local virtual MAC address is 0000.0c07.ac0a (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.808 secs
  Preemption disabled
  Active router is 192.168.10.252, priority 110 (expires in 8.864 sec)
  Standby router is local
  Priority 50 (configured 50)
  IP redundancy name is "hsrp-Fa0/0.10-10" (default)
FastEthernet0/0.20 - Group 20
  State is Active
    1 state change, last state change 02:02:39
  Virtual IP address is 192.168.20.254
  Active virtual MAC address is 0000.0c07.ac14
    Local virtual MAC address is 0000.0c07.ac14 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.808 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.20.252, priority 50 (expires in 7.500 sec)
  Priority 110 (configured 110)
    Track interface Serial2/0 state Up decrement 100
  IP redundancy name is "hsrp-Fa0/0.20-20" (default)


========================================================================================


PC1은 R3로 가기위해 R1을 경유하나, R1이나 R1의 시리얼링크에 문제가 생긴경우 R2를 경유한다.

PC2는 R3로 가기위해 R2를 경유하나, R2나 R2의 시리얼링크에 문제가 생긴경우 R1을 경유한다.

Posted by 비형랑#
:

HSRP - Hot Standby Router Protocol

PC나 서버등의 호스트에는 게이트웨이를 하나만 지정할 수 있다.

(꼭 그런건 아니지만)

그래서 라우터를 여러대 놓아도 하나의 라우터만을 통해 바깥망으로 나가게 된다.

이에 대한 솔루션으로 여러대의 라우터에 가상의 단일주소를 부여하여

게이트웨이의 가용성을 높일 수 있다.

HSRP는 v1, v2가 있으며 Cisco 고유 프로토콜이다.

버전이 다를경우 동작하지 않으며, 그룹별로 다른 버전을 사용할 수 있다.


 

 목적지 주소

그룹번호

액티브라우터 MAC

 version 1

 224.0.0.2


CGMP와 동일주소, HSRP동시사용 불가

 0-255

 0000.0c07.acXX


XX는 그룹번호

 version 2

 224.0.0.102


중복주소 없음

 0-4095

 0000.0c9f.fXXX


XXX는 그룹번호



=======================================================================================


위의 토플로지에서 PC1은 R3로 가기위해 R1을 거칠수도 있고 R2를 거칠수도 있다.

평상시에는 R1을 거쳐가다가, R1이 죽거나 R1의 시리얼링크에 문제가 생길경우 R2를 거쳐가도록 하는 가상라우터 주소를 설정한다.


R1 설정

interface FastEthernet0

ip address 192.168.10.252 255.255.255.0

standby 1 ip 192.168.10.254  그룹번호:1, 가상라우터:192.168.10.254, 이 명령으로 HSRP동작 시작

standby 1 priority 110  (디폴트인 100보다 높은 값)

standby 1 preempt  (프리엠프트 - R1이 죽었다 살았을때 다시 액티브라우터가 되도록)

standby 1 track Serial0 decrement 100  (시리얼이 죽으면 Priority를 100감소, 110-100=10이 된다)


R2 설정

interface FastEthernet0

ip address 192.168.10.253 255.255.255.0

standby 1 ip 192.168.10.254

standby 1 priority 50


=======================================================================================


설정결과 확인


R1#show standby

FastEthernet0 - Group 1

State is Active

6 state changes, last state change 00:00:12

Virtual IP address is 192.168.10.254

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.056 secs

Preemption enabled

Active router is local

Standby router is 192.168.10.253, priority 10 (expires in 7.280 sec)

Priority 110 (configured 110)

Track interface Serial0 state Up decrement 100

IP redundancy name is "hsrp-Fa0-1" (default)


R2#show stand

FastEthernet0 - Group 1

State is Standby

4 state changes, last state change 00:11:30

Virtual IP address is 192.168.10.254

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.060 secs

Preemption disabled

Active router is 192.168.10.252, priority 110 (expires in 7.224 sec)

Standby router is local

Priority 50 (configured 50)

IP redundancy name is "hsrp-Fa0-1" (default)


=======================================================================================


CASE1# R1의 F0를 shutdown


R1#show stand

FastEthernet0 - Group 1

State is Init (interface down)

5 state changes, last state change 00:00:07

Virtual IP address is 192.168.10.254

Active virtual MAC address is unknown

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Preemption enabled

Active router is unknown

Standby router is unknown

Priority 110 (configured 110)

Track interface Serial0 state Up decrement 100

IP redundancy name is "hsrp-Fa0-1" (default)


R2#show stand

FastEthernet0 - Group 1

State is Active

5 state changes, last state change 00:00:51

Virtual IP address is 192.168.10.254

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.848 secs

Preemption disabled

Active router is local

Standby router is unknown

Priority 50 (configured 50)

IP redundancy name is "hsrp-Fa0-1" (default)


CASE2# R3의 S0을 shutdown


R1#show stand

FastEthernet0 - Group 1

State is Active

4 state changes, last state change 00:13:29

Virtual IP address is 192.168.10.254

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.952 secs

Preemption enabled

Active router is local

Standby router is 192.168.10.253, priority 10 (expires in 7.792 sec)

Priority 10

Track interface Serial0 state Down decrement 100

IP redundancy name is "hsrp-Fa0-1" (default)


R2#show stand

FastEthernet0 - Group 1

State is Standby

4 state changes, last state change 00:14:26

Virtual IP address is 192.168.10.254

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.724 secs

Preemption disabled

Active router is 192.168.10.252, priority 5 (expires in 7.192 sec)

Standby router is local

Priority 50 (configured 50)

IP redundancy name is "hsrp-Fa0-1" (default)


=======================================================================================

R1: 액티브라우터

R2: 스탠바이라우터


R1의 이더넷이 죽으면 R2가 액티브라우터가 된다

(192.168.10.254의 패킷을 R2가 처리한다)


R1의 시리얼이 죽으면 R2가 액티브라우터가 되진 않지만,

R1의 Priority가 110-100=10으로 낮아짐에 따라

R2의 Priority가 더 높아진다

(192.168.10.254의 패킷을 R2가 처리한다)


=======================================================================================

Reference


http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3560/software/release/12-2_52_se/configuration/guide/3560scg/swhsrp.html


https://www.ietf.org/rfc/rfc2281.txt


=======================================================================================


HSRP 커맨드 입력시 순서가 매우 중요하다. priority 설정후 preempt를 적용하면 priority 설정이 날아가버리기 때문이다.


액티브라우터를 설정할경우 preempt, priority, ip 순으로 설정해야 한다.

'Cisco R&S' 카테고리의 다른 글

LACP & PAgP  (0) 2016.08.25
GLBP - Gateway Load Balancing Protocol  (0) 2016.08.20
VRRP - Virtual Router Redundancy Protocol  (0) 2016.08.16
HSRP - Multiple Group Configuration  (0) 2016.08.16
VPN(PPTP) Server Configuration  (0) 2015.12.25
CCNA Labsim 공부할 수 있는 곳  (0) 2015.04.27
ip default-network  (0) 2015.04.16
Port-security  (0) 2015.04.15
Posted by 비형랑#
:

ip default-network

Cisco R&S 2015. 4. 16. 18:57 |

CCNA덤프에 ip default-network 0.0.0.0이라는 커맨드가 나와서 적잖이 당황했다.


원래 저 명령은 라우팅테이블에 없는 네트웍으로 가는 패킷이 들어왔을때 어느 네트웍으로 보낼지,


즉 Gateway of last resort를 정해주는 명령이다.


그런데 0.0.0.0이라는 네트웍으로 보내다니..?


여러 방면으로 구글링도 해보고 직접 랩도 돌려봤지만 도무지 쓸 이유가 없는 명령이었다.


그래서 네이버카페에 물어보니 내가 맞았다.


ip default-network 0.0.0.0이라는 명령이 굉장히 어색하고 이상한 명령이라는 것이고,


답변을 달아주신 분 또한 CCIE준비할 때만 사용한 명령으로 실제 상용망에는 적용해본적이 없으시다고 한다.


왜 이명령이 NA덤프에 나왔는지는 모르겠지만


드디어 깔끔하게 정리하고 넘어간다. 한 이틀 붙잡은듯 하다. 


- 임의의 IP network로의 route를 candidate default route로서 flag(*) 설정(표시)하기 위해 사용한다.

- 임의의 IP network는 반드시 Routing table에 class기반으로 존재하야 하며, 명령어 입력시에도 반드시 class기반으로 입력한다.

- candidate default route는 Routing table에서 '*'로 표시되며, "마지막으로 사용될 게이트웨이"로 간주한다.

- IGRP, EIGRP는 자동으로 전달한다. (단, 해당 network을 IGRP, EIGRP가 알아야 한다. - IGRP, EIGRP derived network)

- RIP도 자동으로 전달하나, 입력된 network이 아닌 0.0.0.0/0으로 전달한다.

'Cisco R&S' 카테고리의 다른 글

GLBP - Gateway Load Balancing Protocol  (0) 2016.08.20
VRRP - Virtual Router Redundancy Protocol  (0) 2016.08.16
HSRP - Multiple Group Configuration  (0) 2016.08.16
HSRP - Hot Standby Router Protocol  (0) 2016.08.16
VPN(PPTP) Server Configuration  (0) 2015.12.25
CCNA Labsim 공부할 수 있는 곳  (0) 2015.04.27
Port-security  (0) 2015.04.15
라우터상의 arp테이블 해석  (0) 2015.04.14
Posted by 비형랑#
: