반응형

 

 

 

 

📌 OSPF란

OSPF는 링크 상태 프로토콜이며, 링크는 라우터 인터페이스라고 볼 수 있습니다. 인터페이스에 대한 설명에는 인터페이스의 IP 주소, 마스크, 연결된 네트워크 유형, 해당 네트워크에 연결된 라우터 등이 포함됩니다.

OSPF는 Open Shortest Path First 알고리즘을 사용하여 모든 대상에 도달하기 위한 최단 경로를 구축하고 계산합니다. 최단 경로는 Dijkstra 알고리즘을 사용하여 계산됩니다.

  1. OSPF 초기 구성 시 또는 라우팅 정보의 변경으로 인해 라우터는 링크 상태 알림을 생성합니다. 이 알림은 해당 라우터에 있는 모든 링크 상태에 나타냅니다.
  2. 모든 라우터는 플러딩을 통해 링크 상태를 교환합니다. 링크 상태 업데이트를 수신하는 각 라우터는 링크 상태 데이터베이스에 복사본을 저장한 다음 다른 라우터에 업데이트를 전파합니다.
  3. 각 라우터의 데이터베이스가 완료되면 라우터는 모든 대상에 대한 최단 경로 트리를 계산합니다. 라우터는 최단 경로 트리, 대상, 관련 비용을 계산하기 위해 Dijkstra 알고리즘을 사용하고 해당 대상에 도달하기 위한 다음 홉을 사용하여 IP 라우팅 테이블을 형성합니다.
  4. OSPF 네트워크에서 링크 비용 또는 네트워크 추가 또는 삭제와 같은 변경 사항이 발생하지 않는 경우 OSPF는 자동으로 실행됩니다. 변경 사항은 링크 상태 패킷을 통해 전달되며, 최단 경로를 찾기 위해 Dijkstra 알고리즘이 다시 계산됩니다.

📌 OSPF 장점

  • OSPF를 사용하는 경우 홉 수에 제한이 없습니다.
  • VLSM를 적용하여 IP 주소 할당이 매우 유용합니다.
  • OSPF는 멀티캐스트를 사용하여 링크 상태 업데이트를 전송합니다. 이렇게 하면 OSPF 패킷을 수신하지 않는 라우터에서 프로세스 리소스 사용이 줄어듭니다. 주기적으로 업데이트가 전송되는 것이 아니라 라우팅 변경이 발생하는 경우에만 업데이트가 전송됩니다. 따라서 효율적인 대역폭이 보장됩니다.
  • OSPF는 라우팅 변경 사항이 주기적으로 전파되는 것이 아니라 즉시 전파됩니다.
  • OSPF는 트래픽을 로드 밸런싱합니다.
  • OSPF는 라우터를 영역으로 나눌 수 있습니다. 이를 통해 전체 네트워크에서 링크 상태 업데이트가 급증하는 것을 제한할 수 있습니다. 또한 경로를 수집하고 서브넷 정보의 불필요한 전파를 줄이는 메커니즘을 제공합니다.
  • OSPF는 다양한 비밀번호 인증 방법을 통해 라우팅 인증을 허용합니다.
  • OSPF는 태킹을 이용하여, BGP같은 외부 경로 프로토콜에서 들어온 경로를 추적할수 있습니다.

📌 OSPF 구성

R1(config)# router ospf <process-id>
R1(config)# network <network or IP address> <mask> <area-id>

예시)
RTA(config)# router ospf 100 
RTA(config)# network 192.168.0.4 0.0.255.255 area 0.0.0.0 
RTA(config)# network 192.168.0.3 0.0.0.0 area 23
  • OSPF process-id는 라우터에 로컬인 숫자 값입니다. 다른 라우터의 process-id와 일치하지 않아도 됩니다.
  • 동일한 라우터에서 여러 OSPF 프로세스를 실행할 수는 있지만 라우터에 추가 오버헤드를 추가하는 여러 데이터베이스 인스턴스를 생성하므로 권장되지 않습니다

📌 OSPF 인증

  • 라우터가 사전 정의된 비밀번호를 기반으로 라우팅 도메인에 참여할 수 있도록 OSPF 패킷을 인증할 수 있습니다.
  • 기본적으로 라우터는 Null 인증을 사용하며, 이로 인해 네트워크를 통한 라우팅 교환이 인증되지 않습니다. 두 가지 인증 방법이 있습니다. 단순 비밀번호 인증 및 Message Digest 인증(MD-5)입니다.
**단순 비밀번호 인증**
R1(config)# ip ospf authentication-key key  (특정 인터페이스 아래에 있음)
R1(config)# area area-id authentication. (이 값은 아래에 router ospf <process-id>있음)

예시1)
RTA(config)# interface Ethernet0
RTA(config)# ip ospf authentication-key mypassword
예시2)
RTA(config)# router ospf 10 network 10.0.0.0 0.0.255.255 area 0 
RTA(config)# area 0 authentication
**Message Digest 인증**
R1(config)# ip ospf message-digest-key key-id md5 key  (인터페이스 아래에 사용) 
R1(config)# area area-id authentication message-digest (아래에서 router ospf <process-id>사용)

예시1)
RTA(config)# interface Ethernet0
RTA(config)# ip ospf message-digest-key 10 md5 mypassword 
예시2)
RTA(config)# router ospf 10 network 10.0.0.0 0.0.255.255 area 0 
RTA(config)# area 0 authentication message-digest 

📌 OSPF 백본 및 Area 0

  • 두개 이상의 영역이 설정된 경우 꼭 Area 0이 존재해야합니다. 이를 백본이라고 합니다.
  • 백본은 모든 Area의 중앙에 있어야 합니다.
  • 백본은 모든 Area의 라우팅 정보를 주입하고 다른 Area로 전파합니다.
  • Area내에서 생성된 경로는 라우팅 테이블에서 O로 표시가되고, 다른 Area에서 시작되는 경로는 inter-area또는 라우팅 테이블에서 O IA로 표시 됩니다.
  • 다른 라우팅 프로토콜에서 시작되고 재배포를 통해 OSPF에 주입되는 경로를 external routes라고 말하고, 라우팅 테이블에서 O E1, O E1로 표시됩니다.

📌 가상 링크

  • 백본에 물리적으로 연결되지 않은 영역을 가상으로 연결
  • Area 0의 불연속성이 발생하는 경우 백본 패치

Area 0에 물리적으로 연결되지 않은 경우 가상 링크를 사용하여 다른 Area 라우팅 경로를 제공합니다.

가상 링크는 하나의 ABR이 백본에 연결된 공통 영역이 있는 두 ABR간 설정되어야 합니다.

가상 링크를 구성하려면 RTA, RTB 모두에게 설정
R1(config)# area <area-id> virtual-link <RID>

예시)
RTA(config)# router ospf 10 area 2 virtual-link 10.0.0.22 
RTB(config)# router ospf 10 area 2 virtual-link 10.0.0.11
  • OSPF를 사용하다보면 두 개의 다른 OSPF 백본 Area 0 이 있는 네트워크를 연결하려는 경우가 있습니다. 이런 경우 서로 존재하지않은 Area를 만들어서 서로 가상링크로 연결하여 사용한다. 다른 경우 몇가지 라우터 장애로 인해 백본이 둘로 분할되는 경우에 대비하여 이중화를 위해 가상 링크를 이용합니다.

📌 Neighbor

  • 세그먼트를 공유하는 라우터는 서로간에 neighbor라고 합니다. Neighbor는 Hello 프로토콜을 통해 맺어집니다. Hello 패킷은 멀티캐스트를 통해 각 인터페이스에서 주기적으로 전송됩니다.
  • 라우터는 인접한 Hello 패킷에 나열되는 즉시 인접한 라우터가 됩니다.
  • Area-id : 공통 세그먼트가 있는 두 라우터이며, 해당 인터페이스는 해당 세그먼트의 동일한 영역에 속해야 합니다. 인터페이스는 같은 네트워크 서브넷을 가져야합니다.
  • Authentication : OSPF를 사용하면 특정 Area에 대한 비밀번호의 설정이 가능합니다. 네이버가 되려는 라우터는 특정 세그먼트에서 동일한 비밀번호를 교환해야 합니다.
  • Hello and Dead Intervals : OSPF는 각 세그먼트에서 Hello 패킷을 교환합니다. 이는 세그먼트에서 라우터의 존재를 확인하고 멀티 액세스 세그먼트에서 지정 라우터(DR)를 선택하기 위해 라우터에서 사용하는 keepalive 형식입니다.
  • Hello 패킷은 라우터가 OSPF 인터페이스에서 전송하는 Hello 패킷 간의 시간(초)을 지정합니다.
  • Dead 간격은 인접 디바이스에서 OSPF 라우터의 Hello 다운을 선언하기 전에 라우터 패킷이 표시되지 않은 시간(초)입니다.
  • OSPF에서는 이러한 간격이 두 네이버 간에 정확히 동일해야 합니다. 이러한 간격이 서로 다른 경우 이러한 라우터는 특정 세그먼트에서 인접한 라우터가 되지 않습니다. 이러한 타이머를 설정하는 데 사용되는 라우터 인터페이스 명령입니다.
R1(config)# ip ospf hello-interval seconds
R1(config)# ip ospf dead-interval seconds
  • Stub area flag : 두 라우터가 인접 디바이스가 되려면 패킷의 stub area Hello 플래그에 동의해야 합니다. stub area은 이후 섹션에서 설명합니다. stub area의 정의는 인접한 라우터 선택 프로세스에 영향을 미칩니다.

 

 

 

 

 

 

참고자료

https://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/7039-1.html

반응형
반응형

 

 

 

 

📌 IP SLA, Track

참고자료

- https://www.cisco.com/c/en/us/support/docs/smb/switches/cisco-550x-series-stackable-managed-switches/smb5797-configure-ip-sla-tracking-for-ipv4-static-routes-on-an-sg550.html

 

 

 

 

  • 물리 링크는 살아 있는데 Peer 장비와 통신이 안되는 경우 icmp 패킷을 보내 강제적으로 물리 링크 Down
  • 상대방 장비로 라우팅 되어있는 상태일 때 링크를 Down 시켜 이중화 장비로 라우팅 전환

참고 해당 IP SLA 작업이 설정중이거나 인터페이스에 설정이 안되더라도 상태는 UP으로 표시됩니다.

 

 

상태 체크시 응답 코드 내용 (Latest operation return code)

Operation Return Code Track Operation State
OK Up
Error Down
  • SLA Operation State - 작업이 즉시 시작됨을 의미하는 Scheduled 또는 생성되었지만 활성화되지 않았음을 의미하는 Pending입니다.
  • Timeout value - ICMP 에코 응답 메시지 또는 ICMP 오류 메시지를 기다리는 간격 시간을 지정합니다.
  • Return Code - 작업이 완료된 후 다음에 따라 작업 Return Code가 설정됩니다.
  • ICMP Echo reply has been received - 반송 코드가 OK로 설정되었습니다.
  • ICMP Error reply has been received - 반환 코드가 오류로 설정되었습니다.
  • No any ICMP reply has been received - 반환 코드가 오류로 설정되었습니다.
  • Configured Source IP address or Source interface is not accessible - 반환 코드가 오류로 설정되었습니다.
  • Tracker - 작업 결과를 추적합니다.
  • Delay - IP SLA 작업 결과 추적 개체의 상태가 Y에서 X로 변경되어야 함을 나타내는 경우 추적 개체는 다음 작업을 수행합니다.

 

 

IP SLA 설정

  • ip sla <Number>
  • icmp-echo <체크 IP> <체크할 IP, 인터페이스>
  • frequency <icmp 체크 수=seconds>
  • ip sla schedule <sla number> life forever start-time now
    • 해당 sla 스케쥴이 즉시 동작합니다.
ip sla 1
 icmp-echo 192.168.1.2 source-interface Ethernet 0/1
 frequency 5
 ip sla schedule 1 life forever start-time now

ip sla 2
 icmp-echo 192.168.1.2 source-ip 192.168.2.100 next-hop-ip 192.168.2.1
 frequency 5
 ip sla schedule 2 life forever start-time now

 

 

Track 설정

  • track <track number> ip sla <sla number> reachability
  • delay down <seconds>
track 1 ip sla 1 reachability
 delay down 5

 

 

반응형

'Network > CISCO' 카테고리의 다른 글

[Network] CISCO - OSPF 설정 (1)  (0) 2024.04.28
[Network] CISCO - AAA 설정  (0) 2023.10.08
[Network] CISCO - Switch MAC차단 설정  (1) 2023.10.08
[Network] CISCO - IPSEC (IKEv2) 설정  (0) 2023.10.08
[Network] CISCO - IPSEC (IKEv1) 설정  (1) 2023.10.08
반응형

 

 

 

 

📌 AAA(Authentication, Authorization, and Accounting)

 

참고자료

- https://www.cisco.com/c/ko_kr/support/docs/security-vpn/terminal-access-controller-access-control-system-tacacs-/10384-security.html

 

 

 

 

  • AAA 활성화
    • 해당 명령이 활성화 될 때까지 다른 모든 AAA 관련 명령은 비활성화 상태
aaa new-model

 

 

  • 외부 AAA 서버 설정 (Radius, TACACS+)
    • key는 대소문자 구분
tacacs-server host <AAA 서버의 IP address> <key>
radius-server host <AAA 서버의 IP address> <key>

 

 

  • Authentication 구성 (인증)
    • 첫번째 Radius 서버로 인증됩니다. Radius 서버가 응답하지 않으면 장비에 로컬 데이터베이스가 사용됩니다. 로컬 인증의 경우 사용자 이름 및 비밀번호를 정의합니다.
    • local을 입력안해주면 로그인 불가
    • aaa authentication login default group <group name> local
aaa authentication login default group radius local
aaa authentication login default group tacacs+ local

 

 

  • Authorization 구성 (권한)
    • AAA 서버에서 권한 부여
    • aaa authorization exec default group <group name> local
aaa authorization exec default group radius local

 

 

  • Accounting 구성 (계정)
aaa accounting exec default start-stop group TACACS-SERVER-GROUP
aaa accounting commands 15 default start-stop group TACACS-SERVER-GROUP

 

 

  • AAA Group 구성
    • aaa group server tacacs+ <group name>
    • server-private <AAA server ip> key <tacacs key>
    • ip tacacs source-interface <source interface>
aaa group server tacacs+ group1
 server-private 192.168.0.1 key jinsu_tacacs
 ip tacacs source-interface Loopback0

 

 

  • AAA 예시 구성
aaa authentication login default group group1 local line
aaa authorization exec default group group1 local
aaa authorization commands 15 default group group1 local
aaa accountiong exec default start-stop group group1
aaa accountiong commands 1 default start-stop group group1
aaa accountiong commands 15 default start-stop group group1
aaa accountiong connection default start-stop group group1
aaa accountiong system default start-stop group group1

 

 

 

반응형
반응형

 

 

 

📌 CISCO - Switch MAC 차단 설정

참고자료

- https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3750/software/release/12-2_50_se/configuration/guide/scg/swacl.html#wp1289037

 

 

  •  MAC Table에서 Static MAC을 설정하여 차단하기
mac address-table static 000f.1f43.e62a vlan 8 drop

 

 

  • ACL을 이용하여 MAC 허용, 차단 정책 설정하기
# 700-799 ACL 지원되는지 확인
access-list 700 deny NIC-mac 0000.0000.0000
access-list 700 permit 0000.0000.0000 ffff.ffff.ffff

 

 

 

반응형

'Network > CISCO' 카테고리의 다른 글

[Network] CISCO - IP SLA, Track 설정  (1) 2023.10.08
[Network] CISCO - AAA 설정  (0) 2023.10.08
[Network] CISCO - IPSEC (IKEv2) 설정  (0) 2023.10.08
[Network] CISCO - IPSEC (IKEv1) 설정  (1) 2023.10.08
[Network] CISCO - MTU 설정  (0) 2022.07.24
반응형

 

 

 

 

📌 Site to Site

참고자료

- https://www.cisco.com/c/en/us/td/docs/ios/12_2/security/command/reference/srfipsec.html#wp1017619

 

 

✏️ IKEv2 장점

  • IKEv2를 사용하면 인증에 EAP 사용가능
  • IKEv2는 시퀀스 번호와 확인 응답을 사용하여 신뢰성과 상태 관리 가능
  • 서비스 거부(DoS) 공격 복원력
  • IKEv2는 DPD(Dead Peer Detection) 및 NAT-T(Network Address Translation-Traversal)에 대한 기본 제공 지원을 제공합니다. URL 및 해시를 통해 인증서를 참조하여 조각화를 방지할 수 있습니다.

 

 

ISAKMP (Internet Key Exchange = IKEv2)

  • 1️⃣ 설정 장비#1 (정적 IP 설정)

 

참고자료

- https://www.cisco.com/en/US/docs/ios-xml/ios/sec_conn_ikevpn/configuration/15-1mt/Configuring_Internet_Key_Exchange_Version_2.html#GUID-8412F9B6-A3E2-4C28-A6E3-1A995FF71500

 

 

 

1. 인터페이스 구성(Lan, Wan)

  • 내부 및 외부 네트워크 peer 장비에 모두 연결되어 있는지 확인
  • 보통 Loopback 인터페이스를 만들어서 터널 사용
interface GigabitEthernet0/0
 description ## 외부 및 터널 IP ##
 ip address 172.17.1.1 255.255.255.252
 no shutdown

interface GigabitEthernet0/1
 description ## 내부 서버 IP ##
 ip address 10.20.10.1 255.255.255.0
 no shutdown

 

 

2. VPN 트래픽에 대한 ACL 구성

  • 터널을 위한 ACL 설정
access-list 100 remark tunnel ACL
access-list 100 permit gre host 172.17.1.1 host 172.17.1.2

 

 

3. IKEv2 Proposal 구성

  • no crypto ikev2 proposal default : 기본 proposal 지우기
  • crypto ikev2 proposal <proposal name>
  • encryption <encryption type>
    • 3des
    • aes-cbc-128
    • aes-cbc-192
    • aes-cbc-256
  • integrity <algorithm type>
    • SHA-2 family 256-bit
  • group <Diffie-Hellman (DH) group>
    • 1--768-bit DH
    • 2--1024-bit DH
    • 5--1536-bit DH
    • 14--Specifies the 2048-bit DH group.
    • 15--Specifies the 3072-bit DH group.
    • 16--Specifies the 4096-bit DH group.
    • 19--Specifies the 256-bit elliptic curve DH (ECDH) group.
    • 20--Specifies the 384-bit ECDH group.
    • 24--Specifies the 2048-bit DH group.
no crypto ikev2 proposal default
crypto ikev2 proposal jinsu_proposal
 encryption aes-cbc-256
 integrity sha256
 group 14

 

 

4. IKEv2 Policy 구성

  • no crypto ikev2 policy default : 기본 policy 지우기
  • crypto ikev2 policy <policy name>
  • proposal <proposal name>
no crypto ikev2 policy default
crypto ikev2 policy jinsu_policy
  proposal jinsu_proposal

 

 

5. IKEv2 Keyring 구성

  • crypto ikev2 keyring <keyring name>
  • peer <peer name>
  • address <상대방 외부 IP>
  • pre-shared-key <키 생성>
crypto ikev2 keyring jinsu_key
 peer jinsu_pr
  address 172.17.1.2
  pre-shared-key auhjinsu123

 

 

6. IKEv2 Profile 구성

  • crypto ikev2 profile <profile name>
  • match identity remote address <상대방 외부IP>
  • identity local address <내부 IP>
  • authentication local <authentication method>
  • authentication remote <authentication method>
  • keyring <keyring name>
crypto ikev2 profile jinsu_profile
 match identity remote address 172.17.1.2 255.255.255.255
 identity local address 172.17.1.1
 authentication local pre-share
 authentication remote pre-share
 keyring jinsu_key

 

 

7. transform-set 구성

  • 보안 프로토콜과 알고리즘 설정
  • crypto ipsec transform-set <Set-Name>
crypto ipsec transform-set auhjinsu esp-aes 256 esp-sha256-hmac
 mode tunnel

 

 

8. crypto map 생성 후 인터페이스에 설정

  • crypto map <Map Name> <Number> ipsec-isakmp
  • set peer <상대방 IP>
  • set transform-set <transform-set Name>
  • set ikev2-profile <profile name>
  • match address <ACL Number>
crypto map jinsu_map 10 ipsec-isakmp
 set peer 172.17.1.2
 set transform-set auhjinsu
 set ikev2-profile jinsu_profile
 match address 100
  • 터널 맺을 외부 인터페이스에 Map 설정
  • crypto map <Map Name>
interface GigabitEthernet0/0
 crypto map jinsu_map

 

 

9. 터널 인터페이스 설정

  • interface Tunnel<Number>
  • ip address <Tunnel IP>
  • tunnel source <외부 IP>
  • tunnel destination <상대방 source IP>
interface Tunnel12345
 ip address 10.255.100.1 255.255.255.252
 no ip redirects
 ip mtu 1400
 keepalive 3 3
 tunnel source 172.17.1.1
 tunnel destination 172.17.1.2

 

 

 

 

 

 

 

  • 2️⃣ 설정 장비#2 (정적 IP 설정)

 

1. 인터페이스 구성(Lan, Wan)

  • 내부 및 외부 네트워크 peer 장비에 모두 연결되어 있는지 확인
  • 보통 Loopback 인터페이스를 만들어서 터널 사용
interface GigabitEthernet0/0
 description ## 외부 및 터널 IP ##
 ip address 172.17.1.2 255.255.255.252
 no shutdown

interface GigabitEthernet0/1
 description ## 내부 서버 IP ##
 ip address 192.168.1.1 255.255.255.0
 no shutdown

 

 

2. IKEv2 Proposal 구성

  • no crypto ikev2 proposal default : 기본 proposal 지우기
  • crypto ikev2 proposal <proposal name>
  • encryption <encryption type>
    • 3des
    • aes-cbc-128
    • aes-cbc-192
    • aes-cbc-256
  • integrity <algorithm type>
    • SHA-2 family 256-bit
  • group <Diffie-Hellman (DH) group>
    • 1--768-bit DH
    • 2--1024-bit DH
    • 5--1536-bit DH
    • 14--Specifies the 2048-bit DH group.
    • 15--Specifies the 3072-bit DH group.
    • 16--Specifies the 4096-bit DH group.
    • 19--Specifies the 256-bit elliptic curve DH (ECDH) group.
    • 20--Specifies the 384-bit ECDH group.
    • 24--Specifies the 2048-bit DH group.
no crypto ikev2 proposal default
crypto ikev2 proposal jinsu_proposal
 encryption aes-cbc-256
 integrity sha256
 group 14

 

 

3. IKEv2 Policy 구성

  • no crypto ikev2 policy default : 기본 policy 지우기
  • crypto ikev2 policy <policy name>
  • proposal <proposal name>
no crypto ikev2 policy default
crypto ikev2 policy jinsu_policy
  proposal jinsu_proposal

 

 

4. IKEv2 Keyring 구성

  • crypto ikev2 keyring <keyring name>
  • peer <peer name>
  • address <모든 대역>
  • pre-shared-key <키 생성>
crypto ikev2 keyring jinsu_key
 peer jinsu_pr
  address 0.0.0.0 0.0.0.0
  pre-shared-key auhjinsu123

 

 

5. IKEv2 Profile 구성

  • crypto ikev2 profile <profile name>
  • match identity remote address <모든 대역>
  • identity local address <내부 IP>
  • authentication local <authentication method>
  • authentication remote <authentication method>
  • keyring <keyring name>
crypto ikev2 profile jinsu_profile
 match identity remote any
 identity local address 172.17.1.2
 authentication local pre-share
 authentication remote pre-share
 keyring jinsu_key

 

 

6. transform-set 구성

  • 보안 프로토콜과 알고리즘 설정
  • crypto ipsec transform-set <Set-Name>
crypto ipsec transform-set auhjinsu esp-aes 256 esp-sha256-hmac
 mode tunnel

 

 

7. crypto dynamic-map, crypto map 생성

  • crypto dynamic-map <Map Name> <Number>
  • set transform-set <transform-set Name>
  • set ikev2-profile <profile name>
crypto dynamic-map jinsu_map 10
 set transform-set auhjinsu
 set ikev2-profile jinsu_profile
  • crypto map <map name> <number> ipsec-isakmp dynamic <dynamic map name>
crypto map jinsu_dynamic_map 10 ipsec-isakmp dynamic jinsu_map

 

 

8. 인터페이스에 crypto map 설정

  • 터널 맺을 외부 인터페이스에 Map 설정
  • crypto map <Map Name>
interface GigabitEthernet0/0
 crypto map jinsu_dynamic_map

 

 

9. 터널 인터페이스 설정

  • interface Tunnel<Number>
  • ip address <Tunnel IP>
  • tunnel source <외부 IP>
  • tunnel destination <상대방 source IP>
interface Tunnel12345
 ip address 10.255.100.2 255.255.255.252
 no ip redirects
 ip mtu 1400
 keepalive 3 3
 tunnel source 172.17.1.2
 tunnel destination 172.17.1.1

 

 

 

 

 

📌 옵션

crypto isakmp invalid-spi-recovery
crypto isakmp keepalive 60
  • lifetime seconds
    • 시간이 지정된 수명(초)이 경과하면 ipsec이 해제됩니다.
  • lifetime kilobytes
    • 트래픽 볼륨 수명으로 인해 지정된 트래픽 양(KB)이 보안 연결 키로 보호된 후 보안 연결 시간이 초과됩니다.
crypto ipsec security-association lifetime seconds 43200
crypto ipsec security-association lifetime kilobytes 10000000
crypto ipsec security-association replay disable
crypto ipsec security-association replay window-size 1024

 

 

 

 

 

 

반응형

'Network > CISCO' 카테고리의 다른 글

[Network] CISCO - AAA 설정  (0) 2023.10.08
[Network] CISCO - Switch MAC차단 설정  (1) 2023.10.08
[Network] CISCO - IPSEC (IKEv1) 설정  (1) 2023.10.08
[Network] CISCO - MTU 설정  (0) 2022.07.24
[Network] CISCO - EtherChannel 설정  (0) 2022.07.24
반응형

 

 

📌 Site to Site

참고자료

- https://www.cisco.com/c/en/us/td/docs/ios/12_2/security/command/reference/srfipsec.html#wp1017619

 

 

ISAKMP (Internet Key Exchange = IKEv1)

  • 1️⃣ 설정 장비#1 (정적 IP 설정)

참고자료

- https://www.cisco.com/c/ko_kr/support/docs/security-vpn/ipsec-negotiation-ike-protocols/119425-configure-ipsec-00.html

 

 

1. 인터페이스 구성(Lan, Wan)

  • 내부 및 외부 네트워크 peer 장비에 모두 연결되어 있는지 확인
  • 보통 Loopback 인터페이스를 만들어서 터널 사용
interface GigabitEthernet0/0
 description ## 외부 및 터널 IP ##
 ip address 172.17.1.1 255.255.255.252
 no shutdown
!
interface GigabitEthernet0/1
 description ## 내부 서버 IP ##
 ip address 10.20.10.1 255.255.255.0
 no shutdown

 

 

2. ISAKMP(IKEv1) 정책 구성

  • crypto isakmp policy <priority> : 우선순위
  • encr aes 192 : 고급 암호화 192 bits.
  • authentication pre-share : 사전 공유키 [default]
  • group 2 : Group 2 (1024-bit)
  • hash : sha (default)
  • lifetime : (86400 seconds = default)
crypto isakmp policy 10
 encr aes 192
 authentication pre-share
 group 2

 

 

3. 암호화 ISAKMP 키 구성

  • crypto isakmp key <key 값> address <상대방 IP>
crypto isakmp key auhjinsu123 address 172.17.1.2

 

 

4. VPN 트래픽에 대한 ACL 구성

  • 터널을 위한 ACL 설정
access-list 100 remark tunnel ACL
access-list 100 permit gre host 172.17.1.1 host 172.17.1.2

 

 

5. transform-set 구성

  • 보안 프로토콜과 알고리즘 설정
  • crypto ipsec transform-set <Set-Name>
crypto ipsec transform-set auhjinsu esp-aes 192 esp-sha-hmac
 mode tunnel

 

 

6. Crypto map 구성 후 인터페이스에 적용

  • crypto map <Map Name> <Number> ipsec-isakmp
  • set peer <상대방 IP>
  • set transform-set <transform-set Name>
  • match address <ACL Number>
crypto map jinsu_map 10 ipsec-isakmp
 set peer 172.17.1.2
 set transform-set auhjinsu
 match address 100
  • 터널 맺을 외부 인터페이스에 Map 설정
  • crypto map <Map Name>
interface GigabitEthernet0/0
 crypto map jinsu_map

 

 

7. 터널 인터페이스 설정

  • interface Tunnel<Number>
  • ip address <Tunnel IP>
  • tunnel source <외부 IP>
  • tunnel destination <상대방 source IP>
interface Tunnel12345
 ip address 10.255.100.1 255.255.255.252
 no ip redirects
 ip mtu 1400
 keepalive 3 3
 tunnel source 172.17.1.1
 tunnel destination 172.17.1.2

 

 

  • 2️⃣ 설정 장비#2 (동적 IP 설정)

참고자료

- https://www.cisco.com/c/en/us/support/docs/security-vpn/ipsec-architecture-implementation/118048-technote-ipsec-00.html

 

 

1. 인터페이스 구성(Lan, Wan)

  • 외부 인터페이스는 보통 공인IP를 사용합니다.
  • 보통 Loopback 인터페이스를 만들어서 터널 사용
interface GigabitEthernet0/0
 description ## 외부 및 터널 IP ##
 ip address 172.17.1.2 255.255.255.252
 no shutdown
!
interface GigabitEthernet0/1
 description ## 내부 서버 IP ##
 ip address 192.168.1.1 255.255.255.0
 no shutdown

 

 

2. ISAKMP(IKEv1) 정책 구성

  • crypto isakmp policy <priority> : 우선순위
  • encr aes 192 : 고급 암호화 192 bits.
  • authentication pre-share : 사전 공유키 [default]
  • group 2 : Group 2 (1024-bit)
  • hash : sha (default)
  • lifetime : (86400 seconds = default)
crypto isakmp policy 10
 encr aes 192
 authentication pre-share
 group 2

 

 

3. 암호화 ISAKMP 키 구성

  • crypto isakmp key <key 값> address <모든대역 IP>
crypto isakmp key auhjinsu123 address 0.0.0.0

 

 

4. VPN 트래픽에 대한 ACL 구성

  • 터널을 위한 ACL 설정
access-list 100 remark tunnel ACL
access-list 100 permit gre host 172.17.1.2 host 172.17.1.1

 

 

5. transform-set 구성

  • 보안 프로토콜과 알고리즘 설정
  • crypto ipsec transform-set <Set-Name>
crypto ipsec transform-set auhjinsu esp-aes 192 esp-sha-hmac
 mode tunnel

 

 

6. Crypto Dynamic-map 생성, crypto map 생성 후 인터페이스 설정

  • crypto dynamic-map <Map Name> <Number>
  • set transform-set <transform-set Name>
crypto dynamic-map jinsu 10
 set transform-set auhjinsu
  • crypto map <Map Name> <Number> ipsec-isakmp dynamic <dynamic-map Name>
crypto map jinsu_map 10 ipsec-isakmp dynamic jinsu
  • 터널 맺을 외부 인터페이스에 Map 설정
  • crypto map <Map Name>
interface GigabitEthernet0/0
 crypto map jinsu_map

 

 

7. 터널 인터페이스 설정

  • interface Tunnel<Number>
  • ip address <Tunnel IP>
  • tunnel source <외부 IP>
  • tunnel destination <상대방 source IP>
interface Tunnel12345
 ip address 10.255.100.2 255.255.255.252
 no ip redirects
 ip mtu 1400
 keepalive 3 3
 tunnel source 172.17.1.2
 tunnel destination 172.17.1.1

 

 

반응형

'Network > CISCO' 카테고리의 다른 글

[Network] CISCO - Switch MAC차단 설정  (1) 2023.10.08
[Network] CISCO - IPSEC (IKEv2) 설정  (0) 2023.10.08
[Network] CISCO - MTU 설정  (0) 2022.07.24
[Network] CISCO - EtherChannel 설정  (0) 2022.07.24
[Network] CISCO - 기능 설정  (0) 2022.02.18
반응형

 

 

 

 

 

 

 

 

 

 

MTU (Maximum Transmission Unit) 란?

  • MTU는 디바이스가 전달할 수 있는 최대 전송 단위입니다.
  • 일반적으로 이 "Unit"은 IP 헤더를 포함한 IP 패킷 길이입니다.
  • Dot1q Tag, MacSec, SVL 헤더 등의 L2 헤더는 이 계산에 포함되지 않습니다.

 

L2 Header 및 길이

  • 일반 L2 Header는 14바이트 + 4바이트의 CRC이며 총 18바이트
  • 트렁크는 dot1q vlan Tag에 4바이트를 추가하며 총 22바이트
  • MacSec은 일반적인 L2 헤더 길이 위에 자체 헤더 길이를 추가합니다

 

기본 MTU란?

  • 기본 MTU는 사용자가 구성하기 이전에 스위치가 기본적으로 설정된 MTU입니다
  • 스위치의 기본 MTU는 1500바이트입니다.
  • 이더넷 포트는 1500바이트 레이어 3 패킷 + 레이어 2 헤더를 전달합니다.

 

MTU 요약 테이블

총 프레임 크기 =  MTU + L2 헤더

포트 유형 기본 MTU - 바이트 구성된 MTU - 바이트 L2 Header 총 프레임 크기
L2 Acess 1500   18 1518
    9216 18 9234
L2 Trunk 1500   22 1522
    9216 22 9238
L3 물리적 포트 1500   18 1518
    9216 18 9234
L3 SVI 1500   18 1518
    9216 18 9234
L3 포트의 IP MTU 1500 범위가 지원됨 18 ip mtu 구성 값 기반

 

 

 

 

 

MTU 검사는 Ingress, Egress가 언제 발생되나요?

 

Egress : MTU는 Maximum Transmission Unit, Egress 확인, Fragment(조각화) 또는 Trending(전송)에 대한 결정, Egress에 대해 결정

  • 포트의 MTU가 라우팅될 패킷 길이보다 크면 패킷이 있는 그대로 전송됩니다.
  • 패킷이 Egress 포트의 MTU보다 크고 Egress 포트가 레이어 3 포트, 패킷은 MTU에 따라 조각화됩니다. 레이어 2 포트, 패킷이 삭제됩니다.(조각화는 레이어 3에서만 수행)

Ingress : 인터페이스에 도착하는 패킷에 대해서도 MTU 확인이 수행됩니다 

  • 인터페이스가 구성된 MTU 위에 패킷을 수신하면 이러한 패킷은 큰 패킷으로 처리되고 삭제됩니다. 

 

 

 

 

Jumbo Packet 이란?

스위치에서 1500바이트 이상의 모든 스위치는 대형 패킷 또는 점보 패킷입니다.

  • 예-1:9216바이트의 점보 프레임 크기를 전달하도록 인터페이스 MTU가 구성된 경우 9216바이트 + 레이어 2 헤더의 프레임을 허용하거나 전송합니다. 
  • 예-2:인터페이스 MTU가 5000바이트의 점보 프레임 크기를 전달하도록 구성된 경우 5000바이트 + 레이어 2 헤더의 프레임을 허용하거나 전송합니다.

 

 

MTU 설정

 

# System MTU 설정
SW(config)# system mtu ?
 <1500-9216> MTU size in bytes

SW(config)# system mtu 1800
Global Ethernet MTU is set to 1800 bytes.
Note: this is the Ethernet payload size, not the total
Ethernet frame size, which includes the Ethernet
header/trailer and possibly other tags, such as ISL or
802.1q tags.

# Interface MTU 설정
SW(config)# interface Ethernet0/0
SW(config-if)# mtu 9126

 

 

MTU 설정 확인

SW# show system mtu
Global Ethernet MTU is 1800 bytes.

SW# show interfaces mtu

Port         Name              MTU
Twe1/0/1                       9216   <-- Per-Port MTU override
Twe1/0/2                       1800   <-- No per-port MTU uses global MTU 


SW# show interfaces TwentyFiveGigE 1/0/1 | inc MTU
MTU 9216 bytes, BW 1000000 Kbit/sec, DLY 10 usec,

SW# show interfaces TwentyFiveGigE 1/0/2 | inc MTU
MTU 1800 bytes, BW 25000000 Kbit/sec, DLY 10 usec,

 

 

하드웨어 MTU 확인

SW# show platform software fed active ifm mappings
Interface                 IF_ID    Inst Asic Core Port SubPort Mac Cntx LPN GPN Type Active
TwentyFiveGigE1/0/1       0x8        1   0   1    20     0      16  4    1   101 NIF  Y  <-- Retrieve the IF_ID for use in the next command
TwentyFiveGigE1/0/2       0x9        1   0   1    21     0      17  5    2   102 NIF  Y

SW# show platform software fed active ifm if-id 0x8 | inc MTU
                Jumbo MTU ............ [9216]  <-- Hardware matches software configuration

SW# show platform software fed active ifm if-id 0x9 | in MTU
                Jumbo MTU ............ [1800]  <-- Hardware matches software configuration

 

 

 

 

반응형
반응형

 

 

 

 

 

 

 

EtherChannel 이란 ?

 

  • EtherChannel를 사용하면 여러 물리적 이더넷 링크를 하나의 논리적 채널로 결합하는 기술입니다.
  • EtherChannel를 통해 데이터 트래픽 로드를 공유할 수 있습니다.
  • EtherChannel를 사용하여 하나 이상의 링크에 장애가 발생할 경우 이중화가 가능합니다.
  • EtherChannel을 사용하여 UTP(Unshielded Twisted Pair) 와이어링 또는 단일 모드 및 다중 모드 파이버를 통해 LAN 스위치, 라우터, 서버 및 클라이언트를 연결할 수 있습니다.
  • 단일 용어인 EtherChannel을 사용하는 Fast EtherChannel, Gigabit EtherChannel, Port Channel, Channel Group 및 Port Group을 가리킵니다.이 문서의 정보는 이러한 모든 EtherChannel과 같은 기술입니다.

 

 

요구사항

 

EtherChannel을 사용하기전에 해당 스위치와 포트가 지원이 되는지 확인해야합니다.

Switch# show interfaces Gi2/0/23 capabilities GigabitEthernet2/0/23
Model: WS-C3750G-24T
Type: 10/100/1000BaseTX
Speed: 10,100,1000,auto
Duplex: half,full,auto
Trunk encap. type: 802.1Q,ISL
Trunk mode: on,off,desirable,nonegotiate
Channel: yes
Broadcast suppression: percentage(0-100)
Flowcontrol: rx-(off,on,desired),tx-(none)
Fast Start: yes
QoS scheduling: rx-(not configurable on per port basis),tx-(4q2t)
CoS rewrite: yes ToS rewrite: yes
UDLD: yes Inline power: no
SPAN: source/destination
PortSecure: yes
Dot1x: yes
Switch#

 

 

 

 

EtherChannel 협상 프로토콜 종류

 

  • PAgP (Cisco 장비만 사용가능)
  • LACP (IEEE 802.3ad = 모든 장비 사용가능)

 

 

 

EtherChannel 협상 모드

 

모드 협상 프로토콜 내용
on None (둘다) EtherChannel을 항상 활성화합니다.
Workstation/Server에서 협상 프로토콜을 지원하지 않는 경우 권장합니다.
off None (둘다) EtherChannel을 항상 비활성화합니다.
active LACP LACP 패킷을 전송하여 협상을 시작합니다.
Workstation/Server가 LACP를 지원하는 경우 권장됩니다.
passive LACP 연결된 Peer 장비가 LACP 패킷을 전송하면 협상이 시작됩니다.
desirable PAgP PAgP 패킷을 전송하여 협상을 시작합니다.
Workstation/Server가 PAgP를 지원하는 경우 권장됩니다.
auto PAgP 연결된 Peer 장비가 PAgP 패킷을 전송하면 협상이 시작됩니다.

서버와 클라이언트 설정과 맞추면서 NIC 어댑터에서 지원하는 협상 프로토콜에 따라 적절한 모드를 사용합니다.

 

 

 

EtherChannel 설정 (L2)

 

SW1

# EtherChannel 생성
SW1(config)# interface range ethernet 1/2-3
SW1(config-if-range)# switchport
SW1(config-if-range)# switchport mode trunk
W1(config-if-range)# channel-group 1 mode ?
active Enable LACP unconditionally
auto Enable PAgP only if a PAgP device is detected
desirable Enable PAgP unconditionally
on Enable Etherchannel only
passive Enable LACP only if a LACP device is detected

SW1(config-if-range)# channel-group 1 mode active
Creating a port-channel interface Port-channel 1

SW1(config-if-range)# no shutdown

# Port-Channel 설정
SW1(config)# interface port-channel 1
SW1(config-if)# switchport 
SW1(config-if)# switchport mode trunk
SW1(config-if)# no shutdown

 

 

SW2

# EtherChannel 생성
SW2(config)# interface range eth1/2-3
SW2(config-if-range)# switchport
SW2(config-if-range)# switchport mode trunk
SW2(config-if-range)# channel-group 1 mode active
Creating a port-channel interface Port-channel 1

SW2(config-if-range)# no shutdown

# Port-Channel 설정
SW2(config)# interface port-channel 1 
SW2(config-if)# switchport 
SW2(config-if)# switchport mode trunk
SW2(config-if)# no shutdown

 

 

 

EtherChannel 상태 확인

SW1

SW1# show interfaces po1
Port-channel1 is up, line protocol is up (connected) 
  Hardware is EtherChannel, address is aabb.cc00.1031 (bia aabb.cc00.1031)
  MTU 1500 bytes, BW 20000 Kbit/sec, DLY 1000 usec, 
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, Auto-speed, media type is RJ45
  input flow-control is off, output flow-control is unsupported 
  Members in this channel: Et1/2 Et1/3 
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts (0 multicasts)
     0 runts, 0 giants, 0 throttles 
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 input packets with dribble condition detected
     966 packets output, 77372 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 unknown protocol drops
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
SW1#

SW1#  show etherchannel  summary  
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      N - not in use, no aggregation
        f - failed to allocate aggregator

        M - not in use, minimum links not met
        m - not in use, port not aggregated due to minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

        A - formed by Auto LAG


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Et1/2(P)    Et1/3(P)    

SW1#

 

SW2

SW2# show interfaces po1
Port-channel1 is up, line protocol is up (connected) 
  Hardware is EtherChannel, address is aabb.cc00.2021 (bia aabb.cc00.2021)
  MTU 1500 bytes, BW 20000 Kbit/sec, DLY 1000 usec, 
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, Auto-speed, media type is RJ45
  input flow-control is off, output flow-control is unsupported 
  Members in this channel: Et1/2 Et1/3 
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:00, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     820 packets input, 47560 bytes, 0 no buffer
     Received 820 broadcasts (0 multicasts)
     0 runts, 0 giants, 0 throttles 
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 input packets with dribble condition detected
     148 packets output, 24112 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 unknown protocol drops
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
SW2#

SW2#  show etherchannel summary 
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      N - not in use, no aggregation
        f - failed to allocate aggregator

        M - not in use, minimum links not met
        m - not in use, port not aggregated due to minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

        A - formed by Auto LAG


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Et1/2(P)    Et1/3(P)    

SW2#

 

 

 

 

 

반응형

'Network > CISCO' 카테고리의 다른 글

[Network] CISCO - IPSEC (IKEv1) 설정  (1) 2023.10.08
[Network] CISCO - MTU 설정  (0) 2022.07.24
[Network] CISCO - 기능 설정  (0) 2022.02.18
[Network] CISCO - HSRP 라우터 이중화  (0) 2020.07.16
[Network] CISCO - Errdisable 기능  (0) 2020.07.10
반응형

 

 

 

CISCO 기준으로 기능 설정을 기록하였습니다.

 

 

 

logging synchronous

스위치나 라우터에서 설정작업을 입력하다보면 명령어 입력도중에 시스템이나 log 메시지들이 화면에 표시되면서 입력중인 명령어와 겹치면서 표시됩니다.

해당 명령어를 설정해 놓으면 명령어 입력하기에 편합니다.

 

# logging synchronous를 설정 안해놨을 경우

Switch(config-if)#inter
*Feb 17 15:08:22.339: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Feb 17 15:08:23.345: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to upface
# logging synchronous를 설정해놨을 경우

Switch(config)#line vty 0 4
Switch(config-line)#logging synchronous 

Switch(config-if)#interface 
*Feb 17 15:24:30.514: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
Switch(config-if)#interface et
*Feb 17 15:24:31.522: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
Switch(config-if)#interface eth0/0

 

 

콘솔 접속 유지하기

라우터나 스위치에 콘솔을 통하여 접속한 후 아무런 응답이 없을 경우 기본적으로 10분 후에 콘솔모드에서 빠져나옵니다.

해당 명령어를 설정해 놓으면 응답이 없어도 콘솔 접속이 유지됩니다.

 

# 콘솔 무제한 유지
Switch(config)#line console 0
Switch(config-line)#exec-timeout 0

# 15분 유지
Switch(config)#line vty 0 4
Switch(config-line)#exec-timeout 15 0

 

반응형

'Network > CISCO' 카테고리의 다른 글

[Network] CISCO - MTU 설정  (0) 2022.07.24
[Network] CISCO - EtherChannel 설정  (0) 2022.07.24
[Network] CISCO - HSRP 라우터 이중화  (0) 2020.07.16
[Network] CISCO - Errdisable 기능  (0) 2020.07.10
[Network] CISCO - Storm-Control 이란?  (1) 2020.07.09
반응형

 

 

 

 

 

 

 

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