VRRP - Virtual Router Redundancy Protocol

HSRP는 시스코 고유의 프로토콜이나, VRRP는 IETF 표준 RFC 2338로 정의된 표준 프로토콜이다.

HSRP와 설정방법이 거의 유사하지만 약간의 차이가 있다.


2016/08/16 - HSRP - Hot Standby Router Protocol - HSRP는 여기 참고

1. 액티브라우터가 아닌 마스터라우터이다.

2. HSRP Priority는 0-255, VRRP Priority는 1-254

3. 마스터라우터의 MAC은 0000.5e00.01XX, XX는 그룹번호

4. VRRP Advertisement는 1초마다

5. 인터페이스 트래킹을 별도의 트랙으로 설정해두어야 함. - 세부설정 가능!



위의 토플로지의 R1과 R2의 이더넷인터페이스에 VRRP를 적용하여 가상의 라우터를 만들되 R1이 마스터라우터가 되도록 설정한다.

또한 R1의 시리얼링크에 문제가 생길경우 R2가 마스터라우터가 되도록 한다.

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

R1설정

track 1 interface Serial2/0 line-protocol  "line-protocol"대신 "ip routing"으로 입력하면 L3감지
       
interface FastEthernet0/0
 ip address 192.168.10.252 255.255.255.0
 vrrp 10 ip 192.168.10.254
 vrrp 10 priority 110
 vrrp 10 track 1 decrement 100


R2설정

interface FastEthernet0/0
 ip address 192.168.10.253 255.255.255.0
 duplex auto
 speed auto
 vrrp 10 ip 192.168.10.254
 vrrp 10 priority 50


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

설정결과확인

R1#show vrrp
FastEthernet0/0 - Group 10
  State is Master 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 110
    Track object 1 state Up decrement 100
  Master Router is 192.168.10.252 (local), priority is 110
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.570 sec


R2#show vrrp
FastEthernet0/0 - Group 10
  State is Backup 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 50 
  Master Router is 192.168.10.252, priority is 110
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.804 sec (expires in 2.960 sec)

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

CASE1# R1의 F0를 shutdown

R1#show vrrp
FastEthernet0/0 - Group 10
  State is Init   
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 110
    Track object 1 state Up decrement 100
  Master Router is unknown, priority is unknown
  Master Advertisement interval is unknown
  Master Down interval is unknown


R2#show vrrp
FastEthernet0/0 - Group 10
  State is Master 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 50 
  Master Router is 192.168.10.253 (local), priority is 50 
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.804 sec

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

CASE2# R3의 S0을 shutdown

R1#show vrrp
FastEthernet0/0 - Group 10
  State is Backup 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 10  (cfgd 110)
    Track object 1 state Down decrement 100
  Master Router is 192.168.10.253, priority is 50 
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.570 sec (expires in 3.090 sec)


R2#show vrrp
FastEthernet0/0 - Group 10
  State is Master 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 50 
  Master Router is 192.168.10.253 (local), priority is 50 
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.804 sec

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

다중 VRRP설정은 HSRP와 동일하므로 생략~

2016/08/16 - HSRP - Multiple Group Configuration


Reference.

http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipapp_fhrp/configuration/12-4/fhp-12-4-book/fhp-vrrp.html#GUID-A6F936CD-71DF-4407-A943-3BD35389049A

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

https://tools.ietf.org/html/rfc5798 - VRRPv3

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