반응형

 

 

 

 

 

 

 

FHRP (First Hop Redundancy Protocol)

두개 이상의 라우터나 L3 스위치를 논리적으로 하나의 라우터나 L3스위치로 보이게 구성하는 프로토콜입니다.

Gateway 이중화 Protocol 이라고도 합니다.

FHRP 설정은 Gateway 장비에서 실제로 IP 주소가 할당된 L3 interface에 명령어를 입력하여야 합니다.

FHRP에는 HSRP, VRRP, GLBP라는 3가지 종류가 있습니다.

 

 

 

VRRP (Virtual Router Redundancy Protocol)

IEEE RFC에 표준 이중화 프로토콜입니다. HSRP는 시스코 전용으로 주로 VLAN에 설정하지만, VRRP는 벤더 공용으로 VLAN이 조금씩 다르므로 인터페이스에 설정하여 사용합니다. 가상 라우터 IP를 게이트웨이 주소로 주로 사용하며 HSRP와는 다르게 실제 인터페이스의 IP주소를 사용할 수도 있다.

  • 주 라우터 : Master / 백업 라우터 : Backup
  • 우선순위(Priority)가 높은 라우터가 Master라우터가 된다. (기본 100)
  • 인터페이스에 설정하기 때문에 Virtual group을 하나밖에 만들지 못합니다. (VLAN에 설정하면 여러개 가능)
  • 가상 MAC : 0000.5e00.01XX[Group Num]
  • Multicast 224.0.0.18
  • Priority가 같으면 높은 IP를 가진 인터페이스가 Master 라우터가 된다.

 

 

 

VRRP 설정

가상 인터페이스에 설정하였습니다.

 

R1(config)#track 1 interface ethernet 0/1 line-protocol
# 인터페이스 Tracking을 위한 설정 - eth0/1이 죽으면 Backup라우터로 게이트웨이가 넘어감

R1(config)#interface ethernet 0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 10.10.10.2 255.255.255.0
R1(config-subif)#vrrp 1 ip 10.10.10.1 - VRRP Group 번호 설정과 IP를 설정해주세요.
R1(config-subif)#vrrp 1 priority 150 - 우선순위를 설정해주세요.
R1(config-subif)#vrrp 1 timers advertise 3 - VRRP 광고주기를 설정한다.
R1(config-subif)#vrrp 1 timers learn - Master라우터에 VRRP 광고 주기값을 배우도록 설정한다.(모든 장비 같은 설정)
R1(config-subif)#vrrp 1 preempt delay minimum 10 - 장애가 복구되면 Master를 이어받는 대기시간
R1(config-subif)#vrrp 1 authentication md5 key-string vrrp1 - VRRP 인증
R1(config-subif)#vrrp 1 track 1 decrement 30 - track 1에 설정한 eth0/1이 장애 발생시 우선순위를 30 감소
R1(config-subif)#no shutdown

 

# R2 설정

R2(config)#interface ethernet 0/0.10
R2(config-subif)#encapsulation dot1Q 10
R2(config-subif)#ip address 10.10.10.3 255.255.255.0
R2(config-subif)#vrrp 1 ip 10.10.10.1
R2(config-subif)#vrrp 1 priority 140 
R2(config-subif)#vrrp 1 timers advertise 3
R2(config-subif)#vrrp 1 timers learn
R2(config-subif)#vrrp 1 authentication md5 key-string vrrp1
R2(config-subif)#no shutdown

 

 

테스트로 R1의 eth0/1 포트를 Down 시켜 보겠습니다.

 

전

R1#show vrrp brief
Interface     Grp     Pri     Time     Own     Pre     State     Master addr     Group addr
Et0/0.10       1       150     9414                Y      Master      10.10.10.2      10.10.10.1

R2#show vrrp brief
Interface     Grp     Pri     Time     Own     Pre     State     Master addr     Group addr
Et0/0.10       1       140    9453                 Y      Backup      10.10.10.2      10.10.10.1


후

R1#show vrrp brief
Interface     Grp     Pri     Time     Own     Pre     State     Master addr     Group addr 
Et0/0.10       1      120     9414                Y      Backup      10.10.10.3        10.10.10.1

R2#show vrrp brief
Interface     Grp     Pri     Time     Own     Pre     State     Master addr     Group addr 
Et0/0.10       1      140     9453                Y      Master       10.10.10.3        10.10.10.1

 

 

# 장애로그

R1
*Jul 16 10:40:31.421: %TRACK-6-STATE: 1 interface Et0/1 line-protocol Up -> Down
*Jul 16 10:40:39.999: %VRRP-6-STATECHANGE: Et0/0.10 Grp 1 state Master -> Backup

R2
*Jul 16 10:40:39.997: %VRRP-6-STATECHANGE: Et0/0.10 Grp 1 state Backup -> Master

 

 

 

 

 

HSRP (Hot Standby Redundancy Protocol)

Cisco 전용 게이트웨이 이중화 프로토콜로 하나의 네트워크에 여러개의 Gateway를 사용할 때 HSRP가 설정된 Active 라우터가 장애 발생시 Standby 라우터가 Active 라우터로 동작하도록 구성하는 프로토콜입니다.

주게이트웨이와 백업게이트웨이 양쪽에 똑같은 가상 IP, 가상 MAC(0000.0c[vender ID]07.ac01[Group Num])을 사용하여 Standby 게이트웨이를 논리적으로 block 시켜 Active 라우터로만 트래픽이 발생한다.

  • 주 라우터 : Active / 백업 라우터 : Standby
  • 부하분산(Load Balancing)은 제공되지 않습니다.
  • 라우터나 L3 이상의 스위치에서 구성 가능합니다.
  • UDP Port 1985 사용합니다.
  • Hello message를 통하여 우선순위 선정 (Hello 주기 3초, Hold-time 10초)
  • Multicast 224.0.0.2
  • Priority가 같으면 높은 IP를 가진 인터페이스가 Active 라우터가 된다.
  • 가상 MAC(0000.0c[vender ID]07.ac01[Group Num])

 

 

HSRP 동작 시 인터페이스의 상태 변화

  • Initial - HSRP가 동작하지 않음
  • Learn - Hello 패킷 교환 진행중
  • Listen - Hello 패킷 완료 및 주기적 교환.
  • Speak - Hello 패킷 주기적으로 교환, Active 라우터와 Standby 라우터 비교중
  • Standby - Hello 패킷 주기적으로 교환, Standby 라우터 선출
  • Active - Hello 패킷 주기적으로 교환,  Active 라우터 선출

 

 

HSRP 설정

# R1 설정

R1(config)#track 1 interface ethernet 0/1 line-protocol
인터페이스 Tracking을 위한 설정 - eth0/1이 죽으면 Backup라우터로 게이트웨이가 넘어감


R1(config)#interface ethernet 0/0.20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 20.20.20.2 255.255.255.0
R1(config-subif)#standby 1 ip 20.20.20.1 - HSRP Group 번호와 IP 설정
R1(config-subif)#standby 1 priority 250 - 우선순위 설정 
R1(config-subif)#standby 1 timers 1 3 - Hello / hold time 설정 (가장 많이 사용하는 1 / 3 초)
R1(config-subif)#standby 1 preempt delay minimum 5 - 장애 처리 후 우선순위 복구 후 Active라우터 변경시간
R1(config-subif)#standby 1 authentication md5 key-string cisco - HSRP 인증
R1(config-subif)#standby 1 track 1 decrement 100 - track 1에 설정된 eth0/1이 장애시 우선순위 100 감소
R1(config-subif)#no shutdown 



# R2 설정

R2(config)#interface ethernet 0/0.20
R2(config-subif)#encapsulation dot1Q 20 
R2(config-subif)#ip address 20.20.20.3 255.255.255.0
R2(config-subif)#standby 1 ip 20.20.20.1
R2(config-subif)#standby 1 priority 200
R2(config-subif)#standby 1 timers 1 3
R2(config-subif)#standby 1 preempt
R2(config-subif)#standby 1 authentication md5 key-string cisco
R2(config-subif)#no shutdown

 

 

테스트로 R1의 eth0/1 포트를 Down 시켜 보겠습니다.

전
R1#show standby brief
Interface     Grp     Pri     P     State     Active     Standby     Virtual IP
Et0/0.20       1      250     P     Active    local     20.20.20.3    20.20.20.1

R2#show standby brief
Interface     Grp     Pri     P     State     Active     Standby     Virtual IP 
Et0/0.20       1      200     P   Standby  20.20.20.2    local      20.20.20.1

후
R1#show standby brief
Interface     Grp     Pri     P     State     Active     Standby     Virtual IP 
Et0/0.20       1      150     P   Standby  20.20.20.3    local      20.20.20.1

R2#show standby brief
Interface     Grp     Pri     P     State     Active     Standby     Virtual IP 
Et0/0.20       1      200     P    Active     local    20.20.20.2     20.20.20.1

 

 

# 장애로그

R1
*Jul 16 11:26:56.883: %TRACK-6-STATE: 1 interface Et0/1 line-protocol Up -> Down
*Jul 16 11:26:56.926: %HSRP-5-STATECHANGE: Ethernet0/0.20 Grp 1 state Active -> Speak
*Jul 16 11:27:00.443: %HSRP-5-STATECHANGE: Ethernet0/0.20 Grp 1 state Speak -> Standby
*Jul 16 11:27:06.285: %VRRP-6-STATECHANGE: Et0/0.10 Grp 1 state Master -> Backup

R2
*Jul 16 11:26:56.921: %HSRP-5-STATECHANGE: Ethernet0/0.20 Grp 1 state Standby -> Active
*Jul 16 11:27:06.282: %VRRP-6-STATECHANGE: Et0/0.10 Grp 1 state Backup -> Master

 

 

저는 이렇게 사용합니다.

R1

R1(config-subif)#standby 1 ip 20.20.20.1
R1(config-subif)#standby 1 priority 250
R1(config-subif)#standby 1 preempt delay minimum 60
R1(config-subif)#standby 1 track 1 decrement 2


R2

R2(config-subif)#standby 1 ip 20.20.20.1
R2(config-subif)#standby 1 priority 254
R2(config-subif)#standby 1 preempt

 

 

 

 

 

 

감사합니다.

반응형

+ Recent posts