Link-state Routing Protocol - OSPF
OSPF의 장점
- Open standard
- SPF(Shortest path first) 알고리즘
- Convergence time이 빠름
- VLSM을 지원
- 네트워크 크기의 제한이 없음
- 네트워크 대역폭의 활용이 높음(네트워크에 변화가 있을때만 정보가 날아갈 뿐만 아니라 멀티캐스트로 날아가기 때문)
- RIP에 비해 정확한 경로선택이 가능
------------------------------------------------------------------------------------------------------------------
Router 2 설정
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#int se 0/0/0
R1(config-if)#ip add 10.1.12.1 255.255.255.0
R1(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R1(config-if)#clock rate 64000
R1(config-if)#exit
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
- OSPF 설정 -
R1(config)#router ospf 1
R1(config-router)#router-id 192.168.1.1
R1(config-router)#network 10.1.12.1 0.0.0.0 area 0
R1(config-router)#^Z
%SYS-5-CONFIG_I: Configured from console by console
00:06:32: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.2 on Serial0/0/0 from LOADING to FULL, Loading Done
- OSPF 설정 확인 -
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.1.2 1 FULL/- 00:00:30 10.1.12.2 Serial0/0/0
R1#show ip ospf database
OSPF Router with ID (192.168.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.1.1 192.168.1.1 53 0x80000002 0x000152 2
192.168.1.2 192.168.1.2 53 0x80000002 0x00f45c 2
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
O 10.1.2.0 [110/65] via 10.1.12.2, 00:00:21, Serial0/0/0 - 새로운 장비(스위치 2)의 OSPF 설정이 완료되면 나타난다.
C 10.1.12.0 is directly connected, Serial0/0/0
- 새로운 장비(스위치 3) 설정 -
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int fa 0/0
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
- 새로운 장비(스위치 3)의 OSPF 설정 -
R1(config)#router ospf 1
R1(config-router)#network 10.1.1.1 0.0.0.0 area 0
R1(config-router)#^Z
%SYS-5-CONFIG_I: Configured from console by console
R1#show ip ospf database
OSPF Router with ID (192.168.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.1.2 192.168.1.2 231 0x80000003 0x004ae7 3
192.168.1.1 192.168.1.1 4 0x80000003 0x0035ff 3
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 3 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0 - 새로운 장비(스위치 3)의 설정이 완료되면 나타난다.
O 10.1.2.0 [110/65] via 10.1.12.2, 00:03:47, Serial0/0/0 - 새로운 장비(스위치 2)의 OSPF 설정이 완료되면 나타난다.
C 10.1.12.0 is directly connected, Serial0/0/0
R1#
------------------------------------------------------------------------------------------------------------------
Router 3 설정
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#int se 0/0/0
R2(config-if)#ip add 10.1.12.2 255.255.255.0
R2(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
R2(config-if)#exit
R2(config)#do ping 10.1.12.1 - 라우터끼리 serial 연결이 제대로 되었는지 확인
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.1, timeout is 2 seconds:
R2(config)#!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/4/5 ms
- OSPF 설정 -
R2(config)#router ospf 1
R2(config-router)#router-id 192.168.1.2
R2(config-router)#network 10.1.12.2 0.0.0.0 area 0
R2(config-router)#^Z
%SYS-5-CONFIG_I: Configured from console by console
00:06:26: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.1 on Serial0/0/0 from LOADING to FULL, Loading Done
- OSPF 설정 확인 -
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.1.1 1 FULL/- 00:00:37 10.1.12.1 Serial0/0/0
R2#show ip ospf database
OSPF Router with ID (192.168.1.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.1.2 192.168.1.2 87 0x80000002 0x00f45c 2
192.168.1.1 192.168.1.1 87 0x80000002 0x000152 2
R2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.12.0 is directly connected, Serial0/0/0
- 새로운 장비(스위치 2) 설정 -
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int fa 0/0
R2(config-if)#ip add 10.1.2.2 255.255.255.0
R2(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
- 새로운 장비(스위치 2)의 OSPF 설정 -
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#network 10.1.2.2 0.0.0.0 area 0
R2(config-router)#^Z
%SYS-5-CONFIG_I: Configured from console by console
R2#show ip ospf database
OSPF Router with ID (192.168.1.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.1.1 192.168.1.1 201 0x80000002 0x000152 2
192.168.1.2 192.168.1.2 13 0x80000003 0x004ae7 3
R2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, FastEthernet0/0
C 10.1.12.0 is directly connected, Serial0/0/0
R2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 3 subnets
O 10.1.1.0 [110/65] via 10.1.12.1, 00:00:09, Serial0/0/0 - 새로운 장비(스위치 3)의 OSPF 설정이 완료되면 나타난다.
C 10.1.2.0 is directly connected, FastEthernet0/0 - 새로운 장비(스위치 2)의 OSPF 설정이 완료되면 나타난다.
C 10.1.12.0 is directly connected, Serial0/0/0
R2#
------------------------------------------------------------------------------------------------------------------
OSPF의 장점
- Open standard
- SPF(Shortest path first) 알고리즘
- Convergence time이 빠름
- VLSM을 지원
- 네트워크 크기의 제한이 없음
- 네트워크 대역폭의 활용이 높음(네트워크에 변화가 있을때만 정보가 날아갈 뿐만 아니라 멀티캐스트로 날아가기 때문)
- RIP에 비해 정확한 경로선택이 가능
------------------------------------------------------------------------------------------------------------------
Router 2 설정
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#int se 0/0/0
R1(config-if)#ip add 10.1.12.1 255.255.255.0
R1(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R1(config-if)#clock rate 64000
R1(config-if)#exit
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
- OSPF 설정 -
R1(config)#router ospf 1
R1(config-router)#router-id 192.168.1.1
R1(config-router)#network 10.1.12.1 0.0.0.0 area 0
R1(config-router)#^Z
%SYS-5-CONFIG_I: Configured from console by console
00:06:32: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.2 on Serial0/0/0 from LOADING to FULL, Loading Done
- OSPF 설정 확인 -
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.1.2 1 FULL/- 00:00:30 10.1.12.2 Serial0/0/0
R1#show ip ospf database
OSPF Router with ID (192.168.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.1.1 192.168.1.1 53 0x80000002 0x000152 2
192.168.1.2 192.168.1.2 53 0x80000002 0x00f45c 2
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
O 10.1.2.0 [110/65] via 10.1.12.2, 00:00:21, Serial0/0/0 - 새로운 장비(스위치 2)의 OSPF 설정이 완료되면 나타난다.
C 10.1.12.0 is directly connected, Serial0/0/0
- 새로운 장비(스위치 3) 설정 -
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int fa 0/0
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
- 새로운 장비(스위치 3)의 OSPF 설정 -
R1(config)#router ospf 1
R1(config-router)#network 10.1.1.1 0.0.0.0 area 0
R1(config-router)#^Z
%SYS-5-CONFIG_I: Configured from console by console
R1#show ip ospf database
OSPF Router with ID (192.168.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.1.2 192.168.1.2 231 0x80000003 0x004ae7 3
192.168.1.1 192.168.1.1 4 0x80000003 0x0035ff 3
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 3 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0 - 새로운 장비(스위치 3)의 설정이 완료되면 나타난다.
O 10.1.2.0 [110/65] via 10.1.12.2, 00:03:47, Serial0/0/0 - 새로운 장비(스위치 2)의 OSPF 설정이 완료되면 나타난다.
C 10.1.12.0 is directly connected, Serial0/0/0
R1#
------------------------------------------------------------------------------------------------------------------
Router 3 설정
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#int se 0/0/0
R2(config-if)#ip add 10.1.12.2 255.255.255.0
R2(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
R2(config-if)#exit
R2(config)#do ping 10.1.12.1 - 라우터끼리 serial 연결이 제대로 되었는지 확인
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.1, timeout is 2 seconds:
R2(config)#!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/4/5 ms
- OSPF 설정 -
R2(config)#router ospf 1
R2(config-router)#router-id 192.168.1.2
R2(config-router)#network 10.1.12.2 0.0.0.0 area 0
R2(config-router)#^Z
%SYS-5-CONFIG_I: Configured from console by console
00:06:26: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.1 on Serial0/0/0 from LOADING to FULL, Loading Done
- OSPF 설정 확인 -
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.1.1 1 FULL/- 00:00:37 10.1.12.1 Serial0/0/0
R2#show ip ospf database
OSPF Router with ID (192.168.1.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.1.2 192.168.1.2 87 0x80000002 0x00f45c 2
192.168.1.1 192.168.1.1 87 0x80000002 0x000152 2
R2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.12.0 is directly connected, Serial0/0/0
- 새로운 장비(스위치 2) 설정 -
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int fa 0/0
R2(config-if)#ip add 10.1.2.2 255.255.255.0
R2(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
- 새로운 장비(스위치 2)의 OSPF 설정 -
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#network 10.1.2.2 0.0.0.0 area 0
R2(config-router)#^Z
%SYS-5-CONFIG_I: Configured from console by console
R2#show ip ospf database
OSPF Router with ID (192.168.1.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.1.1 192.168.1.1 201 0x80000002 0x000152 2
192.168.1.2 192.168.1.2 13 0x80000003 0x004ae7 3
R2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, FastEthernet0/0
C 10.1.12.0 is directly connected, Serial0/0/0
R2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 3 subnets
O 10.1.1.0 [110/65] via 10.1.12.1, 00:00:09, Serial0/0/0 - 새로운 장비(스위치 3)의 OSPF 설정이 완료되면 나타난다.
C 10.1.2.0 is directly connected, FastEthernet0/0 - 새로운 장비(스위치 2)의 OSPF 설정이 완료되면 나타난다.
C 10.1.12.0 is directly connected, Serial0/0/0
R2#
------------------------------------------------------------------------------------------------------------------
'CCNA 기초' 카테고리의 다른 글
Wireless LAN (0) | 2008.12.04 |
---|---|
CDP (Cisco Discovery Protocol) (0) | 2008.12.04 |
Router Flash Backup (0) | 2008.12.04 |
IP Routing - EIGRP (0) | 2008.12.03 |
IP Routing - Distance Vector RIP Version (0) | 2008.12.02 |
IP Routing - Distance Vector RIP (0) | 2008.12.02 |