2025. 5. 2. 10:27ㆍCS/CCNA
OSPF (part 3)
Loop back: virtual int (defualt up/up state; provide consistent IP adrs)
Type of OSPF:
1. broad cast
- default on Ethernet, FDDI(Fiber Distributed Data Interface)
-> use multicast adrs <224.0.0.5>
-> DR/ BDR must be elected each subnet (if no OSPF, DR only)
-> Neither DR/BDR, DROther (2-way state; not exchange LSAs)
-> when DR goes down, BDR becomes DR (regardlness DROther's priority)
-> priority:
(1) highest OSPF int priority (default 1)
(2) highest OSPF Router ID
-> hello 10 sec, dead time 40 sec
2. Point-to-Point (legacy)
- default on PPP(point to point protocol), HDLC(High-level Data link Control)
-> use multicast adrs <224.0.0.5>
-> L2 encapsulation
-> DR/BDR not elected
-> One side DCE(Data Communications Equipment), other side DTE(Data Termianl Equipment)
-> router formed full adjacency
-> // clock rate (diff btw speed in Ethernet protocol)
-> hello 10 sec, dead time 40 sec
3. Non-broadcast
- default on Frame Relay, X.25 (out of CCNA)
-> hello 30 sec, dead time 120 sec
OSPF Requirment:
1. Must match Area Number | Subnet(area) | Hello, Dead timers | Authentication setting | IP MTU | OSPF NW Type
2. Must be unnique OSPF ID
OSPF LSA Types:
-> LSDB made of LSA
-> 11 types (CCNA only handle 3)
->types:
(1) Type 1(Router LSA)
- all router generated
- identifies Router ID
- list NW attached to Router's OSPF-activated int
(2) Type 2(NW LSA)
- generated by DR
- list routers which attached to multi access NW
(3) Type 3(AS-External LSA)
- generated by ASBR
CLI//
R1#sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 10.0.1.254 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
GigabitEthernet0/2 unassigned YES unset administratively down down
Serial0/0/0 unassigned YES unset administratively down down
Serial0/0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int s0/0/0
R1(config-if)#ip add 192.168.12.1 255.255.255.252
R1(config-if)#do show controllers s0/0/0
Interface Serial0/0/0
Hardware is PowerQUICC MPC860
DCE V.35, clock rate 2000000
...
R1(config-if)#clock rate 128000
R1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
-
R2(config-if)#do sh contr s0/0/0
Interface Serial0/0/0
Hardware is PowerQUICC MPC860
DTE V.35 TX and RX clocks detected
-
R1(config)#int s0/0/0
R1(config-if)#ip ospf 1 area 0
R1(config-if)#
00:30:36: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.245.1 on Serial0/0/0 from LOADING to FULL, Loading Done
int g0/0
R1(config-if)#ip ospf 1 area 0
R1(config-if)#do sh ip ospf int s0/0/0
Serial0/0/0 is up, line protocol is up
Internet address is 192.168.12.1/30, Area 0
Process ID 1, Router ID 192.168.12.1, Network Type POINT-TO-POINT, Cost: 64
Transmit Delay is 1 sec, State POINT-TO-POINT,
R1(config-if)#do sh ip ospf int g0/0
GigabitEthernet0/0 is up, line protocol is up
Internet address is 10.0.1.254/24, Area 0
Process ID 1, Router ID 192.168.12.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 192.168.12.1, Interface address 10.0.1.254
R2(config-if)#do sh ip ospf neigh
Neighbor ID Pri State Dead Time Address Interface
192.168.12.1 0 FULL/ - 00:00:38 192.168.12.1 Serial0/0/0
192.168.245.2 1 FULL/DR 00:00:35 192.168.245.2 GigabitEthernet0/0
R5#sh ip ospf int g0/0
GigabitEthernet0/0 is up, line protocol is up
Internet address is 192.168.245.3/29, Area 0
Process ID 1, Router ID 203.0.113.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 203.0.113.1, Interface address 192.168.245.3
No backup designated router on this network
Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
Hello due in 00:00:02
Index 1/1, flood queue length 0
## doesn't match with R2 & R4
R5(config)#int g0/0
R5(config-if)#no ip ospf hello-interval
R5(config-if)#no ip ospf dead-interval
R5(config-if)#do sh ip ospf int g0/0
GigabitEthernet0/0 is up, line protocol is up
Internet address is 192.168.245.3/29, Area 0
Process ID 1, Router ID 203.0.113.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 203.0.113.1, Interface address 192.168.245.3
Backup Designated Router (ID) 192.168.245.1, Interface address 192.168.245.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
R5(config-if)#do sh ip ospf neigh
Neighbor ID Pri State Dead Time Address Interface
192.168.245.1 1 FULL/BDR 00:00:31 192.168.245.1 GigabitEthernet0/0
192.168.245.2 1 FULL/DROTHER 00:00:30 192.168.245.2 GigabitEthernet0/0
R5(config-if)#
R5(config-if)#do sh run | section ospf
router ospf 1
log-adjacency-changes
network 192.168.245.3 0.0.0.0 area 0
default-information originate
R5(config-if)#do sh ip route
Codes: L - local, C - connected, S - static, 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.0.1.0/24 [110/66] via 192.168.245.1, 00:02:42, GigabitEthernet0/0
O 10.0.2.0/24 [110/3] via 192.168.245.2, 00:02:42, GigabitEthernet0/0
192.168.12.0/30 is subnetted, 1 subnets
O 192.168.12.0/30 [110/65] via 192.168.245.1, 00:02:42, GigabitEthernet0/0
192.168.34.0/30 is subnetted, 1 subnets
O 192.168.34.0/30 [110/2] via 192.168.245.2, 00:02:42, GigabitEthernet0/0
192.168.245.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.245.0/29 is directly connected, GigabitEthernet0/0
L 192.168.245.3/32 is directly connected, GigabitEthernet0/0
203.0.113.0/24 is variably subnetted, 2 subnets, 2 masks
C 203.0.113.0/30 is directly connected, GigabitEthernet0/0/0
L 203.0.113.1/32 is directly connected, GigabitEthernet0/0/0
---> no default routing
R5(config-if)#exit
R5(config)#ip route 0.0.0.0 0.0.0.0 203.0.113.2
## create default route
R1(config)#do sh ip route
Codes: L - local, C - connected, S - static, 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 192.168.12.2 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 10.0.1.0/24 is directly connected, GigabitEthernet0/0
L 10.0.1.254/32 is directly connected, GigabitEthernet0/0
O 10.0.2.0/24 [110/67] via 192.168.12.2, 00:12:02, Serial0/0/0
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/30 is directly connected, Serial0/0/0
L 192.168.12.1/32 is directly connected, Serial0/0/0
192.168.34.0/30 is subnetted, 1 subnets
O 192.168.34.0/30 [110/66] via 192.168.12.2, 00:17:03, Serial0/0/0
192.168.245.0/29 is subnetted, 1 subnets
O 192.168.245.0/29 [110/65] via 192.168.12.2, 00:04:38, Serial0/0/0
O*E2 0.0.0.0/0 [110/1] via 192.168.12.2, 00:01:32, Serial0/0/0
R1(config)#do sh ip ospf database
OSPF Router with ID (192.168.12.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.12.1 192.168.12.1 1074 0x80000003 0x00f081 3
192.168.34.1 192.168.34.1 784 0x80000008 0x00ec11 2
192.168.245.1 192.168.245.1 351 0x80000006 0x004a83 3
203.0.113.1 203.0.113.1 347 0x80000004 0x00848a 1
192.168.245.2 192.168.245.2 347 0x80000008 0x005e3e 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
192.168.34.2 192.168.245.2 1065 0x80000004 0x00f525
192.168.245.3 203.0.113.1 347 0x80000002 0x00892d
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 203.0.113.1 158 0x80000001 0x00d2c1 1
'CS > CCNA' 카테고리의 다른 글
<Jeremy's IT Lab> Day 30: TCP & UDP (0) | 2025.05.02 |
---|---|
<Jeremy's IT Lab> Day 29: FHRP(First Hop Redundancy Protocols) (0) | 2025.05.02 |
<Jeremy's IT Lab> Day 27: OSPF (part 2) (1) | 2025.04.29 |
<Jeremy's IT Lab> Day 26: OSPF (part 1) (0) | 2025.04.29 |
<Jeremy's IT Lab> Day 25: RIP & EIGRP (0) | 2025.04.27 |