⭐️ Table of Contents
- Tech 1. OSPF 실습
Tech 1. OSPF 실습
#RIP 프로토콜 동작 확인
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router rip
R1(config-router)#do sh ip protocols
>> 동작하지 않음
라우터 1번에서 RIP 프로토콜을 실행했지만 동작은 하지 않았다. 다음으로 EIGRP 프로토콜에서 동작을 하는지 한번 볼 것이다.
#EIGRP 프로토콜 동작 확인
R1(config)#router eigrp 100
R1(config-router)#do sh ip protocols
Routing Protocol is "eigrp 100"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
Redistributing: eigrp 100
EIGRP NSF-aware route hold timer is 240s
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
Routing Information Sources:
Gateway Distance Last Update
Distance: internal 90 external 170
기본적인 eigrp가 프로토콜이 실행이 되는 것을 볼 수 있다.
#OSPF 프로토콜 동작 확인
R1(config)#router ospf ?
<1-65535> Process ID
R1(config)#router ospf
OSPF의 Process ID란
- 작업에 대한 ID
- 컴퓨터 작업마다 ID가 다르다.
- process ID는 여러개의 프로세스중 각각 다른 ID가 주어진다.
- (실무)프로세스 ID는 작업 지시서를 참고하고 지정하는 것이 좋다.
# 인터페이스 아이디 설정 (임의로)
OSPF의 인터페이스 ID를 라우터 번호를 따라가도록 해볼 것이다.
R1(config)#router ospf 1
*Mar 1 00:04:59.987: %OSPF-4-NORTRID: OSPF process 1 failed to allocate unique router-id and cannot start
*Mar 1 00:04:59.987: %OSPF-4-NORTRID: OSPF process 1 failed to allocate unique router-id and cannot start
지금 보면 라우터 ID를 할당을 못해줬기 때문에 OSPF 프로세스가 실행을 못하는 것 같다. 먼저, 라우터에 각 인터페이스를 연결해주면 이 문제는 해결될 것 같다.
# 인터페이스 설정
R1(config)#int s0/0
R1(config-if)#ip add 192.168.10.1 255.255.255.0
R1(config-if)#no sh
*Mar 1 00:07:16.987: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
R1(config-if)#int f0/0
R1(config-if)#ip add 10.10.10.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo 0
R1(config-if)#ip add 172.16.10.1 255.255.255.0
R1(config-if)#no sh
# ospf 설정
R1(config-if)#router ospf 1
R1(config-router)#ex
R1(config)#no router ospf 1
R1(config)#int lo 0
R1(config-if)#router ospf 1
R1(config-router)#network 192.168.10.0 0.0.0.255 area 0
R1(config-router)#network 10.10.10.0 0.0.0.255 area 0
R1(config-router)#network 172.16.10.0 0.0.0.255 area 0
R1(config-router)#end
area 0 : 백본 area 이다. (사람으로 따지면 중추신경계) 정말 중요하다. 스위치에서도 백본이 존재한다.
ospf 네이버를 확인했다. 확인한 결과 ospf router id가 루프백 주소로 되어 있다. 이유는 다음과 같다. 라우터에서 인터페이스가 꺼지면 ID가 없어지기 때문(ospf가 재동작)이다 반면, Loopback 인터페이스는 관리자가 sh을 시켜주지 않는다면 계속해서 연결되어 잇기 때문에 루프백 인터페이스로 라우터가 켜지는 것 같다. (Loopbcak은 수동으로 라우터 ID를 설정해주지 않는다는 그 다음 우선순위에서 루프백 인터페이스가 높다.
# 라우터 아이디를 지정 변화 확인 (관리자가 수동으로 라우터 ID를 지정해줬을 때)
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#end
R1#
*Mar 1 00:28:20.059: %SYS-5-CONFIG_I: Configured from console by console
R1#sh ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 54 0x80000001 0x004C16 1
ospf 라우터 ID가 바뀐 것을 볼 수 있다. 관리자가 직접 아이디를 지정해줬을 때 우선순위기 바뀐다.
# R2 라우터 인터페이스 설정
R2(config)#int s0/0
R2(config-if)#ip add 192.168.10.254 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int f0/0
R2(config-if)#ip add 20.20.20.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int lo 0
R2(config-if)#ip add 172.16.20.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#ex
# OSPF 프로토콜 설정
R2(config)#router ospf 1
// network [네트워크 주소][와일드카드마스크] area [area-id]
R2(config-router)#network 20.20.20.0 0.0.0.255 area 0
R2(config-router)#network 172.16.20.0 0.0.0.255 area 0
R2(config-router)#network 192.168.10.0 0.0.0.255 area 0
R2(config-router)#end
R2#sh ip ospf database
OSPF Router with ID (172.16.20.1) (Process ID 2)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 26 0x80000003 0x00E225 3
172.16.20.1 172.16.20.1 25 0x80000003 0x005784 4
라우터 아이디를 지정 안해줬기 때문에 루프백으로 되어 있다. 바꿔 보겠다.
# R2 라우터 아이디 변경
R2(config-router)#router-id 1.1.1.2
Reload or use "clear ip ospf process" command, for this to take effect
Reload or use "clear ip ospf process" command, for this to take effect
밑에 영어 문장을 읽어보면 clear 하라고 되어 있다. 일단 라우터 1번에 네이버 아이디를 확인해볼 것이다.
# 라우터 1번에서 변경된 라우터 2번 ID 확인
R1#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
172.16.20.1 0 FULL/ - 00:00:38 192.168.10.254 Serial0/0
라우터 2번에서 분명 라우터 ID를 1.1.1.2로 확실히 바꾸어주었고, 바뀌어야하는데 바뀌지 않았다.
아까 전, 라우터 2번에서 ID를 수동으로 바꾸어 주고 나서 clear~~ 하라고 문구를 확인했었다. 한번 해보겠다.
R2#clear ip ospf pro
R2#clear ip ospf process
Reset ALL OSPF processes? [no]: y
라우터 1번에서 확인
R1#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
1.1.1.2 0 FULL/ - 00:00:39 192.168.10.254 Serial0/0
네이버를 한번 끊었다가 다시 연결이 되었다. 1번 라우터에서 네이버 테이블 확인. 이웃라우터와 연결이 되어있을 때는 아이디가 바로 바뀌지 않는다.
강사님께서 OSPF 라우터 간의 상태 변화 감지 속도와 라우팅 테이블의 업데이트 속도를 최적화할 수 있다고 하셨다.
#Timer 변경
먼저 타이머 확인
R1 sh ip ospf interface
타이머 변경
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int s0/0
R1(config-if)#ip ospf he
R1(config-if)#ip ospf hello-interval 5
R1(config-if)#end
R1#sh ip ospf interface s0/0
라우터 2번에서는 deadtime을 80 바꿔보겠다.
R2#sh ip ospf inte
R2#sh ip ospf interface s0/0
Serial0/0 is up, line protocol is up
Internet Address 192.168.10.254/24, Area 0
Process ID 2, Router ID 1.1.1.2, Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_POINT
Timer intervals configured, Hello 10, Dead 80, Wait 80, Retransmit 5
oob-resync timeout 80
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 3/3, 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 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
헬로우 패킷에는 변화가 없다. 연관성이 없다. 다시 원래대로 지정해주었다, 다시 네이버가 구성되었다.
ospf가 네이버가 맺어지는 과정(장애가 났을 때 수정을 하는 데 용이하다.)
네이버 상태 변화 --> 이 부분은 네이버 상태 변화를 공부 한 후 다시 포스팅을 이어가도록 하겠다.
R1#debug ip ospf events >> 프로토콜에서 수행되는 모든 과정을 확인할 수 있다.
OSPF events debugging is on
R1#clear
*Mar 1 01:10:11.095: OSPF: Send hello to 224.0.0.5 area 0 on Serial0/0 from 192.168.10.1
R1#clear ip router *
*Mar 1 01:10:14.579: OSPF: Rcv hello from 1.1.1.2 area 0 from Serial0/0 192.168.10.254
*Mar 1 01:10:14.583: OSPF: End of hello processing
R1#clear ip ospf pro
*Mar 1 01:10:20.819: OSPF: Send hello to 224.0.0.5 area 0 on Serial0/0 from 192.168.10.1
R1#clear ip ospf process
*Mar 1 01:10:23.599: OSPF: Rcv hello from 1.1.1.2 area 0 from Serial0/0 192.168.10.254
*Mar 1 01:10:23.599: OSPF: End of hello processing
R1#clear ip ospf process
Reset ALL OSPF processes? [no]: y
R1#
*Mar 1 01:10:29.179: OSPF: Flushing External Links
*Mar 1 01:10:29.179: OSPF: Flushing Opaque AS Links
*Mar 1 01:10:29.215: OSPF: Flushing Link states in area 0
*Mar 1 01:10:29.251: OSPF: Interface Loopback0 going Down
*Mar 1 01:10:29.251: OSPF: Interface Serial0/0 going Down
*Mar 1 01:10:29.251: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Mar 1 01:10:29.267: OSPF: Interface Loopback0 going Up
*Mar 1 01:10:29.267: OSPF: i_up : interface FastEthernet0/0 is down
*Mar 1 01:10:29.267: OSPF: Interface Serial0/0 going Up
*Mar 1 01:10:29.267: OSPF: Send hello to 224.0.0.5 area 0 on Serial0/0 from 192.168.10.1
*Mar 1 01:10:29.267: OSPF: Rcv hello from 1.1.1.2 area 0 from Serial0/0 192.168.10.254
*Mar 1 01:10:29.267: OSPF: 2 Way Communication to 1.1.1.2 on Serial0/0, state 2WAY
*Mar 1 01:10:29.267: OSPF: Send DBD to 1.1.1.2 on Serial0/0 seq 0x16F9 opt 0x52 flag 0x7 len 32
*Mar 1 01:10:29.267: OSPF: Send immediate hello to nbr 1.1.1.2, src address 192.168.10.254, on Serial0/0
*Mar 1 01:10:29.267: OSPF: Send hello to 224.0.0.5 area 0 on Serial0/0 from 192.168.10.1
*Mar 1 01:10:29.267: OSPF: End of hello processing
*Mar 1 01:10:29.267: OSPF: Rcv DBD from 1.1.1.2 on Serial0/0 seq 0xCED opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Mar 1 01:10:29.271: OSPF: NBR Negotiation Done. We are the SLAVE
*Mar 1 01:10:29.271: OSPF: Send DBD to 1.1.1.2 on Serial0/0 seq 0xCED opt 0x52 flag 0x0 len 32
*Mar 1 01:10:29.283: OSPF: Rcv DBD from 1.1.1.2 on Serial0/0 seq 0xCEE opt 0x52 flag 0x3 len 52 mtu 1500 state EXCHANGE
*Mar 1 01:10:29.283: OSPF: Send DBD to 1.1.1.2 on Serial0/0 seq 0xCEE opt 0x52 flag 0x0 len 32
*Mar 1 01:10:29.283: OSPF: Rcv DBD from 1.1.1.2 on Serial0/0 seq 0xCEF opt 0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE
*Mar 1 01:10:29.283: OSPF: Exchange Done with 1.1.1.2 on Serial0/0
*Mar 1 01:10:29.283: OSPF: Send LS REQ to 1.1.1.2 length 12 LSA count 1
*Mar 1 01:10:29.283: OSPF: Send DBD to 1.1.1.2 on Serial0/0 seq 0xCEF opt 0x52 flag 0x0 len 32
*Mar 1 01:10:29.283: OSPF: Rcv LS UPD from 1.1.1.2 on Serial0/0 length 100 LSA count 1
*Mar 1 01:10:29.283: OSPF: Synchronized with 1.1.1.2 on Serial0/0, state FULL
*Mar 1 01:10:29.283: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.2 on Serial0/0 from LOADING to FULL, Loading Done
'Network > Network[GNS3, Packet]' 카테고리의 다른 글
[OSPF] Multi-Area(Loopback , EIGRP, 축약, 재분배, 디폴트) (0) | 2024.10.14 |
---|---|
[OSPF] OSPF 실습 -2 (1) | 2024.10.10 |
[EIGRP] - Default Routing (1) | 2024.09.28 |
[EIGRP] 로드 밸런싱(Load Balancing) (1) | 2024.09.27 |
[EIGRP] Metric (0) | 2024.09.27 |