|
|
★ OSPF(Open Shortest Path First)의 특징
- OSPF는 라우팅 정보 업데이트 시 224.0.0.5와 224.0.0.6의 멀티캐스트 주소를 사용하며 프로토콜 번호 89를 사용하는 라우팅 프로토콜임
- 경로(링크) 상태에 변화가 생기면 변화된 부분만 업데이트를 실시하며 업데이터 할 내용이 없더라도 30분 간격으로 링크 상태 재생기능 (Link-State Refresh)을 통해 주기적으로 라우팅 업데이트 정보를 교환함
- OSPF는 목적지까지 비용이 가장 적게 소요되는 경로를 최적의 경로로 설정하는 최단 경로 우선 알고리즘 (SPF)을 사용한다.
- RIP는 메트릭으로 홉 수를 EIGRP는 대역폭과 지연 값을 사용하지만 OSPF는 링크비용(cost)을 사용 목적지에 이르는 경로를 결정함
- LSA (Link-State Advertisement)
Hello, DBD, LSR, LSU, LSA 타입들
ㅇ Type 1 : 라우터 링크상태 정보 (Router LSA) - 하나의 라우터에 있는 모든 정보를 링크의 다른쪽 이웃에 대해 알려줌
ㅇ Type 2 : 네트워크 링크상태 정보 (Network LSA) - 다중 접속 링크에서 DR을 나타냄
ㅇ Type 3 : 네트워크 링크상태 요약 정보 (Network Summary LSA) - 네트워크 링크 요약 정보를 나타냄 (internal route)
ㅇ Type 4 : ASBR 링크상태 요약 정보 (ASBR Summary LSA)
ㅇ Type 5 : AS 외부 LSA (AS External LSA) - OSPF 도메인 밖의 루트를 나타냄
ㅇ Type 7 : NSSA 외부 LSA (NSSA External LSA) - type 5 LSA를 대신하여 Stub area에서 사용됨
* 대역폭에 따른 비용
| 대역폭 | 인터페이스 유형 | 비용 |
| 56 Kbps | 1785 | |
| 64 Kbps | B | 1562 |
| 128 Kbps | 2B | 781 |
| 1.544 Mbps | T1 | 64 |
| 2.048 Mbps | E1 | 48 |
| 10 Mbps | Ethernet | 10 |
| 100 Mbps | Fast Ethernet | 1 |
| 1 Gbps | Gigabit Ethernet | 1 |
| 10 Gbps | 10-Gigabit Ethernet | 1 |
| 단계별 | 예제 코드 | 설명 |
| R1 기본 설정 | Router(config)# hostname R1 R1(config)# int loopback 0 R1(config-if)# ip add 1.1.1.1 255.255.255.0 R1(config-if)# exit R1(config)# int gi0/0 R1(config-if)# ip add 203.230.7.1 255.255.255.0 R1(config-if)# no shut R1(config-if)# exit R1(config)# int se0/0/0 R1(config-if)# ip add 203.230.11.2 255.255.255.0 R1(config-if)# clock rate 64000 R1(config-if)# no shut R1(config-if)# exit R1(config)# int se0/0/1 R1(config-if)# ip add 203.230.10.2 255.255.255.0 R1(config-if)# no shut R1(config-if)# ^Z R1# wr | |
| R2 기본 설정 | Router(config)# hostname R2 R2(config)# int loopback 0 R2(config-if)# ip add 2.2.2.1 255.255.255.0 R2(config-if)# exit R2(config)# int gi0/0 R2(config-if)# ip add 203.230.9.1 255.255.255.0 R2(config-if)# no shut R2(config-if)# exit R2(config)# int se0/0/0 R2(config-if)# ip add 203.230.10.1 255.255.255.0 R2(config-if)# clock rate 64000 R2(config-if)# no shut R2(config-if)# exit R2(config)# int se0/0/1 R2(config-if)# ip add 203.230.12.1 255.255.255.0 R2(config-if)# clock rate 64000 R2(config-if)# no shut R2(config-if)# ^z | |
| R3 기본 설정 | Router(config)# hostname R3 R3(config)# int loopback 0 R3(config-if)# ip add 3.3.3.1 255.255.255.0 R3(config-if)# exit R3(config)# int gi0/0 R3(config-if)# ip add 203.230.8.1 255.255.255.0 R3(config-if)# no shut R3(config-if)# exit R3(config)# int se0/0/0 R3(config-if)# ip add 203.230.12.2 255.255.255.0 R3(config-if)# no shut R3(config-if)# exit R3(config)# int se0/0/1 R3(config-if)# ip add 203.230.11.1 255.255.255.0 R3(config-if)# no shut R3(config-if)# ^Z R3# wr | |
| R1에 OSPF 라우팅 프로토콜 적용 | R1# conf t R1(config)# do sh ip int brief Interface IP-Address OK? Method Status Protocol GigaEthernet0/0 203.230.7.1 YES manual up up R1(config)# router ospf 7 R1(config-router)# network 203.230.7.1 0.0.0.0 area 0 R1(config-router)# network 203.230.10.2 0.0.0.0 area 0 R1(config-router)# network 203.230.11.2 0.0.0.0 area 0 R1(config-router)# network 1.1.1.1 0.0.0.0 area 0 R1(config-router)# ^Z R1# wr | |
| R2에 OSPF 라우팅 프로토콜 적용 | R2# conf t R2(config)# do sh ip int brief Interface IP-Address OK? Method Status Protocol GigaEthernet0/0 203.230.7.1 YES manual up up ㆍㆍㆍ 중간 생략 ㆍㆍㆍ Serial0/0/0 203.230.10.1 YES manual up up Serial0/0/1 203.230.12.1 YES manual up up Loopback0 2.2.2.1 YES manual up up Vlan unassigned YES admini- down down R2(config)# router ospf 7 R2(config-router)# network 203.230.9.1 0.0.0.0 area 0 R2(config-router)# network 203.230.10.1 0.0.0.0 area 0 R2(config-router)# network 203.230.12.1 0.0.0.0 area 0 R2(config-router)# network 2.2.2.1 0.0.0.0 area 0 | |
| R3에 OSPF 라우팅 프로토콜 적용 | R3# conf t R3(config)# do sh ip int brief Interface IP-Address OK? Method Status Protocol GigaEthernet0/0 203.230.8.1 YES manual up up ㆍㆍㆍ 중간 생략 ㆍㆍㆍ Serial0/0/0 203.230.18.1 YES manual up up Serial0/0/1 203.230.12.2 YES manual up up Loopback0 3.3.3.1 YES manual up up Vlan unassigned YES admini- down down R3(config)# router ospf 7 R3(config-router)# network 203.230.8.1 0.0.0.0 area 0 R3(config-router)# network 203.230.11.1 0.0.0.0 area 0 R3(config-router)# network 203.230.12.2 0.0.0.0 area 0 R3(config-router)# network 3.3.3.1 0.0.0.0 area 0 | |
| 라우터 ID | R1# show ip protocols R3# debug ip ospf events R1# show ip ospf neighbor R2# show ip ospf neighbor R1# show ip ospf interface s0/0/0 R1# show ip route |
- 모든 OSPF끼리 N:N으로 LSA 교환시 중복된 LSA와 ACK가 발생하는데, 이를 줄이기 위해 DR과 BDR을 설정하여 중계역할을 한다.
라우터와 스위치 간에 연결선은 다이렉트 (Copper-Straight-Through)를 사용한다.
| 단계별 | 예제 코드 | 설명 |
| R1 설정 | Router# conf t Router(config)# hostname R1 R1(config)# int loopback 0 R1(config)# ip add 1.1.1.1 255.255.255.0 R1(config)# exit R1(config)# int Gi0/0 R1(config-if)# ip add 203.230.7.1 255.255.255.0 R1(config-if)# no shut R1(config-if)# exit R1(config)# do sh ip int brief ㆍㆍㆍ 중간 생략 ㆍㆍㆍ R1(config)# router ospf 1 R1(config-router)# network 203.230.7.1 0.0.0.0 area 0 R1(config-router)# network 1.1.1.1 0.0.0.0 area 0 R1(config-if)# ^Z R1# wr | |
| R2 설정 | Router# conf t Router(config)# hostname R2 R2(config)# int loopback 0 R2(config)# ip add 2.2.2.1 255.255.255.0 R2(config)# exit R2(config)# int gi0/0 R2(config-if)# ip add 203.230.7.2 255.255.255.0 R2(config-if)# no shut R2(config-if)# exit R2(config)# do sh ip int brief ㆍㆍㆍ 중간 생략 ㆍㆍㆍ R2(config)# router ospf 1 R2(config-router)# network 203.230.7.2 0.0.0.0 area 0 R2(config-router)# network 2.2.2.1 0.0.0.0 area 0 R2(config-if)# ^Z R2# wr | |
| R3 설정 | Router# conf t Router(config)# hostname R3 R3(config)# int loloopback 0 R3(config)# ip add 3.3.3.1 255.255.255.0 R3(config)# exit R3(config)# int gi0/0 R3(config-if)# ip add 203.230.7.3 255.255.255.0 R3(config-if)# no shut R3(config-if)# exit R3(config)# do sh ip int brief ㆍㆍㆍ 중간 생략 ㆍㆍㆍ R3(config)# router ospf 1 R3(config-router)# network 203.230.7.3 0.0.0.0 area 0 R3(config-router)# network 3.3.3.1 0.0.0.0 area 0 R3(config-if)# ^Z R3# wr | |
| R4 설정 | Router# conf t Router(config)# hostname R4 R4(config)# int loloopback 0 R4(config)# ip add 4.4.4.1 255.255.255.0 R4(config)# exit R4(config)# int gi0/0 R4(config-if)# ip add 203.230.7.4 255.255.255.0 R4(config-if)# no shut R4(config-if)# exit R4(config)# do sh ip int brief ㆍㆍㆍ 중간 생략 ㆍㆍㆍ R4(config)# router ospf 1 R4(config-router)# network 203.230.7.4 0.0.0.0 area 0 R4(config-router)# network 4.4.4.1 0.0.0.0 area 0 R4(config-if)# ^Z R4# wr | |
| 특정 라우터를 DR로 선출되게 함 | R4(config)# int gi0/0 R4(config-if)# ip ospf priority 255 R3(config)# int gi0/0 R3(config-if)# ip ospf priority 254 R4# clear ip ospf process Reset ALL OSPF process? [no]:yes (yes를 입력) R4# sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 1 FULL/DROTHER 00:00:39 203.230.7.1 GiEthernet0/0 2.2.2.1 1 FULL/DROTHER 00:00:39 203.230.7.2 GiEthernet0/0 3.3.3.1 254 FULL/BDR 00:00:39 203.230.7.3 GiEthernet0/0 | (255는 우선순위 값으로 가장 큰 값임) |
| 디폴트 정적 경로 설정과 영역 내 라우터들에게 광고 | R1(config)# ip route 0.0.0.0 0.0.0.0 loopback 0 %Default route without gateway, if not a point-to-point interface, may Impact performance R1(config)# router ospf 1 R1(config-router)# default-information originate | |
| 비용 계산을 위한 기준 대역폭 변경 | R1(config)# router ospf 1 R1(config-router)# auto-cost reference-bandwidth ? <1-4294967> The reference bandwidth in terms of Mbits per second R1(config-router)# auto-cost reference-bandwidth 10000 % OSPF: Reference bandwidth is changed. Please ensure reference bandwidth is consistent across all routers. | |
| Hello 및 Dead Interval 수정 | R1(config)# int gi0/0 R1(config-if)# ip ospf hello-interval 5 R1(config-if)# ip ospf dead-interval 20 01:28:11: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.1 on GigabitEthernet0/0 from 2WAY to DOWN, Neighbor Down: Dead timer expired 01:28:11: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.1 on GigabitEthernet0/0 from 2WAY to DOWN, Neighbor Down: Interface down or detached 01:28:11: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.1 on GigabitEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired | |
| OSPF의 보안 기능 | R1(config)# int gi0/0 R1(config-if)# ip ospf authentication R1(config-if)# ip ospf authentication-key cisco R1(config)# int gi0/0 R1(config-if)# ip ospf authentication message-digest R1(config-if)# ip ospf message-digest-key 1 md5 cisco R1(config)# router ospf 1 R1(config-router)# area 0 authentication R1(config-router)# exit R1(config)# int gi0/0 R1(config-if)# ip ospf authentication-key cisco R1(config)# router ospf 1 R1(config-router)# area 0 authentication message-digest R1(config-router)# exit R1(config)# int gi0/0 R1(config-if)# ip ospf message-digest-key 1 md5 cisco | 평문을 사용한 네이버 인증 MD5 방식을 사용한 네이버 인증 평문을 사용한 영역 인증 MD5 방식을 사용한 영역 인증 |
|
|
