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 비형랑#
: