OSPF
OSPF (Open Shortest Path First)
-
OSPF는 Dijkstra의 SPF (Shortest Path First) 알고리즘을 사용하여 패킷이 네트워크를 통과할 수 있는 최적의 경로를 계산하는 link-state routing Protocol이다.
-
IP protocol Number 89번 사용.
- Multicast 224.0.0.5 (All-OSPF-Router)
- OSPF 영역에 있는 다른 모든 라우터에게 LSA를 송신한다.
-
Multicast 224.0.0.6 (DR, BDR 수신)
- Metric으로 cost를 사용. Cost = 10^8 / Bandwidth
- total cost는 각 구간의 ocst를 모두 합한 것 이다.
-
OSPF에서 동일한 네트워크 내의 서로 다른 서브넷에 대해 서로 다른 서브넷 마스크를 사용할 수 있는 VLSM(Variable Length Subnet Masking)을 지원.
-
IP주소를 효과적으로 사용하고, 라우팅 테이블을 줄일 수 있어 효율적인 리소스 사용이 가능하다.
- 모든 area는 backborn area 0번에 접해야 한다.
실습
# 공통 설정
En
conf t
no ip domain lookup
line c 0
logg syn
exec-timeout 0
exit
hostname
int s1/0
no shut
encap fram
no fram inver
clock rate 64000
exit
# IP Address & Mapping
R1]
conf t
int l0
ip add 4.4.1.1 255.255.255.0
exit
int s1/0
ip add 4.4.12.1 255.255.255.0
fram map ip 4.4.12.2 102 br
R2]
conf t
int l0
ip add 4.4.2.2 255.255.255.0
exit
int s1/0.12 m
ip add 4.4.12.2 255.255.255.0
fram map ip 4.4.12.1 201 br
exit
int s1/0.23 m
ip add 4.4.23.2 255.255.255.0
fram map ip 4.4.23.3 203 br
R3]
conf t
int l0
ip add 4.4.3.3 255.255.255.0
exit
int s1/0.23 m
ip add 4.4.23.3 255.255.255.0
fram map ip 4.4.23.2 302 br
exit
int s1/0.34 p
ip add 4.4.34.3 255.255.255.0
fram inter 304
R1]
conf t
int l0
ip add 4.4.4.4 255.255.255.0
exit
int s1/0.34 p
ip add 4.4.34.4 255.255.255.0
fram inter 403
# OSPF
R1]
conf t
router ospf 4 => proccess id
router-id 4.4.1.1
network 4.4.1.1 0.0.0.0 area 0
network 4.4.12.1 0.0.0.0 area 0
R2]
conf t
router ospf 4
router-id 4.4.2.2
network 4.4.2.2 0.0.0.0 area 0
network 4.4.12.2 0.0.0.0 area 0
netwrok 4.4.23.2 0.0.0.0 area 0
R3]
conf t
router ospf 4
router-id 4.4.3.3
network 4.4.3.3 0.0.0.0 area 0
netwrok 4.4.23.3 0.0.0.0 area 0
network 4.4.34.3 0.0.0.0 area 0
R4]
conf t
router ospf 4
router-id 4.4.4.4
network 4.4.4.4 0.0.0.0 area 0
network 4.4.34.4 0.0.0.0 area 0
=> show ip ospf neighbor 명령어 확인시 R3 - R4의 interface 0.34 p 만 형성 됨을 확인할 수 있다.
# neighbor 형성
R1]
conf t
router ospf 4
neighbor 4.4.12.2 => 한쪽에서만 설정해도 neighbor 형성.
# R2 - R3의 int s1/0.23 m 의 neighbor membership 변경.
R2]
show ip ospf int s1/0.23 => 물리적인 인터페이스는 multi point로 구분하였으나 확인시 Network type NON_BROADCAST로 확인됨.
conf t
int s1/0.23
ip ospf network point-to-multipoint
R3]
conf t
int s1/0.23
ip ospf network point-to-multipoint
# R1 - R2 Neighbor membership P to P 설정.
R1]
conf t
int s1/0
ip ospf network point-to-point
R2]
conf t
int s1/0.12
ip ospf network point-to-point
# R1 - R2 // DR (Designated Router), BDR(Backup Designated Router) 선출.
[선출 과정]
- priority default 값은 1이다.
- priority 값이 동등할때 router-id를 확인한다. (주로 루프백 주소를 사용. 루프백 설정시 인터페이스가 다운되지 않음.)
- priority가 0인 interface는 DROTHER 이다.
R1]
int s1/0
ip ospf network broadcast
R2]
int s1/0
ip ospf network broadcast
end
clear ip ospf process
=> router-id로 인해 R2의 4.4.2.2 가 DR임을 확인.
# R1 - R2 // Priority 값 조정.
R1]
int s1/0
ip ospf priority 100
end
clear ip ospf process
=>Priority 100인 R1이 DR임을 확인.
댓글남기기