네트워크

[CISCO] OSPF(Open Shortest Path First) 프로토콜 설정

화이트해커 Luna 🌙 2022. 12. 1. 18:18
728x90
반응형

OSPF(Open Shortest Path First) 프로토콜 설정

정적 라우팅은 모든 경로에 대한 정보를 직접 관리자가 입력해주는 방식이다. 단순 경로 네트워크나 단일 외부 경로를 가진 최종 사용자 네트워크에 매우 유용하고, 라우터 장치 이외에 리눅스나 유닉스 윈도우즈 등의 OS에서도 기본적인 기능으로 제공된다. 일반 PC나 서버도 로컬 라우터로 이용할 수 있다.

-목차-
1. OSPF 라우팅 프로세스 활성화
2. OSPF Router ID 설정
3. OSPF 인터페이스 설정
4. OSPF 동작 확인

 


 

 

1. OSPF 프로세스 활성화

 

 

명령어
# router ospf [process‐id]

 

예제) router ospf 1
R1(config)# router ospf 1
R1(config‐router)#

R2(config)# router ospf 1
R2(config‐router)#

R3(config)# router ospf 1
R3(config‐router)#

 


2. OSPF Router ID 설정

프로세스 ID에 대한 제약은 거의 없고, 관리자의 정책에 따라 결정한다.

 

명령어
# router-id [process‐id]

 

예제) router ospf 1
R1(config)# router ospf 1
R1(config‐router)# router‐id 1.1.1.1
R1(config‐router)#

R2(config)# router ospf 1
R2(config‐router)# router‐id 2.2.2.1
R2(config‐router)#

R3(config)# router ospf 1
R3(config‐router)# router‐id 3.3.3.1
R3(config‐router)#

 


3. OSPF 인터페이스 설정

 

각 인터페이스를 등록한다.

명령어
# network //인터페이스 설정
# passive‐interface //패시브 인터페이스 설정

 

예제) router ospf 1
R1(config)# router ospf 1
R1(config‐router)# router‐id 1.1.1.1
R1(config‐router)# network 1.1.1.1 0.0.0.0 area 0
R1(config‐router)# network 12.1.1.1 0.0.0.0 area 0
R1(config‐router)# network 31.1.1.1 0.0.0.0 area 0

R2(config)# router ospf 1
R2(config‐router)# router‐id 2.2.2.1
R2(config‐router)# network 2.2.2.1 0.0.0.0 area 0
R2(config‐router)# network 23.1.1.2 0.0.0.0 area 0
R2(config‐router)# network 12.1.1.2 0.0.0.0 area 0

R3(config)# router ospf 1
R3(config‐router)# router‐id 3.3.3.1
R3(config‐router)# network 3.3.3.1 0.0.0.0 area 0
R3(config‐router)# network 31.1.1.3 0.0.0.0 area 0
R3(config‐router)# network 23.1.1.3 0.0.0.0 area 0

R1(config‐router)# passive‐interface g0/0

 

 


4. OSPF 동작확인

 

명령어
R1# show ip route ospf // ospf로 교환된 라우팅 정보만 확인
R1# show ip ospf int [interface] // ospf 작동중 interface 정보확인
R1# show ip ospf neighbor // 네이버상태표시

 

예제) show ip route ospf

 OSPF로 교환된 라우팅 정보만을 확인한다.

R1# show ip route ospf
2.0.0.0/24 is subnetted, 1 subnets
O       2.2.2.0 [110/65] via 12.1.1.2, 00:06:52, Serial0/0/0
3.0.0.0/24 is subnetted, 1 subnets
O       3.3.3.0 [110/65] via 31.1.1.3, 00:05:28, Serial0/0/1
23.0.0.0/24 is subnetted, 1 subnets
O       23.1.1.0 [110/128] via 12.1.1.2, 00:05:28, Serial0/0/0
[110/128] via 31.1.1.3, 00:05:28, Serial0/0/1

 

 

예제) show ip ospf int s0/0/0

 OSPF가 작동하고 있는 interface의 정보 확인

R1# show ip ospf int s0/0/0
Serial0/0/0 is up, line protocol is up
Internet address is 12.1.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type POINT‐TO‐POINT, Cost: 64
Transmit Delay is 1 sec, State POINT‐TO‐POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1 , Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.1
Suppress hello for 0 neighbor(s)

 

예제) show ip ospf neighbor

 

네이버의 상태 정보 표시

R1# show ip ospf neighbor
Neighbor ID     Pri State           Dead Time   Address         Interface
3.3.3.1           0   FULL/  ‐ 00:00:31    192.168.31.3    Serial0/0/1
2.2.2.1           0   FULL/  ‐ 00:00:31    192.168.12.2    Serial0/0/0

 

완성화면


궁금한점 있으시면 댓글 남겨주세요.

728x90
반응형