OSPF Tips
  • Router ID = Highest IP atau manual
  • Area 0 = Backbone area
  • Hello Interval = 10s (Broadcast)
  • Dead Interval = 40s (4x Hello)
OSPF Neighbor States
Down No Hello received
Init Hello received
2-Way Bidirectional communication
ExStart Master/slave election
Exchange DBD packets exchanged
Loading LSR/LSU exchange
Full Adjacency established

Pertemuan 5: OSPF Single-Area

Bobot: 10%
Progress Pembelajaran 5/16
Tujuan Pembelajaran

Setelah menyelesaikan praktikum ini, mahasiswa mampu:

  • Memahami konsep dan arsitektur OSPF sebagai link-state routing protocol
  • Mengkonfigurasi OSPF single-area pada router Cisco
  • Memverifikasi OSPF neighbor adjacency dan routing table
  • Melakukan optimasi dan troubleshooting OSPF operation

Materi Teori - OSPF Fundamentals

1. Konsep Dasar OSPF

Open Shortest Path First (OSPF) adalah link-state routing protocol yang menggunakan algoritma Dijkstra untuk menghitung shortest path tree. OSPF merupakan open standard (RFC 2328) dan widely deployed dalam enterprise networks.

Karakteristik OSPF
  • Classless: Mendukung VLSM dan CIDR
  • Fast Convergence: Triggered updates
  • Scalable: Hierarchical design dengan areas
  • Secure: Mendukung authentication
  • Efficient: Menggunakan multicast untuk updates
OSPF Metric

OSPF menggunakan cost sebagai metric yang dihitung berdasarkan bandwidth:

Cost = Reference Bandwidth / Interface Bandwidth

Default Reference Bandwidth: 100 Mbps

Ethernet (100Mbps): 100/100 = 1
FastEthernet (100Mbps): 100/100 = 1
Serial (1.544Mbps): 100/1.544 ≈ 64
2. OSPF Packet Types

OSPF menggunakan lima jenis packet untuk membentuk dan memelihara neighbor relationships:

Hello

Discover/maintain neighbors

Multicast: 224.0.0.5
Interval: 10/30s
DBD

Database Description

Summarize LSDB
Master/Slave election
LSR

Link State Request

Request specific LSA
During loading state
LSU

Link State Update

Contains LSA
Response to LSR
LSAck

Link State Acknowledgment

Acknowledge LSU
Reliable flooding
3. OSPF Neighbor Formation Process

OSPF neighbors melewati beberapa state sebelum mencapai full adjacency:

Down
No Hello
Hello Received
Init
Unidirectional
Hello with My RouterID
2-Way
Bidirectional
DR/BDR Election
ExStart
Master/Slave
DBD Exchange
Exchange
DBD Packets
LSR/LSU
Loading
LSA Request
LSDB Sync
Full
Adjacency
DR/BDR Election Process:
  • Priority: Higher priority wins (default: 1)
  • Router ID: Higher Router ID breaks ties
  • DR: Designated Router untuk segment
  • BDR: Backup Designated Router
  • DROTHER: Non-DR/BDR routers
Election Rules:
1. Highest Priority (0 = tidak ikut election)
2. Highest Router ID
3. Tidak preempt (setelah terpilih)

Broadcast Networks:
- DR/BDR election required

Point-to-Point:
- No DR/BDR election
4. OSPF Network Types

OSPF berperilaku berbeda berdasarkan jenis network yang digunakan:

Network Type DR/BDR Election Hello Interval Adjacency Example
Broadcast Yes 10 seconds DR/BDR dengan semua Ethernet, LAN
Point-to-Point No 10 seconds Full dengan neighbor Serial, PPP
Point-to-Multipoint No 30 seconds Full dengan semua Frame Relay
NBMA Yes 30 seconds DR/BDR dengan semua Frame Relay
5. OSPF LSA Types

Link State Advertisements (LSA) adalah building blocks dari OSPF database:

LSA Type Name Description Generated By
Type 1 Router LSA Intra-area routes All routers
Type 2 Network LSA DR's connected routers DR only
Type 3 Summary LSA Inter-area routes ABR
Type 4 ASBR Summary ASBR location ABR
Type 5 AS External External routes ASBR

Job Sheet Praktikum

Informasi Job Sheet
Durasi: 170 menit
Tujuan

Konfigurasi OSPF single-area

Tools

Cisco Packet Tracer

Bobot

10%

Penilaian

Unjuk Kerja

Diagram Topologi OSPF Single-Area
Router 1
R1-OSPF
Router ID: 1.1.1.1
G0/0: 192.168.10.1/24
G0/1: 192.168.20.1/24
S0/0/0: 10.0.0.1/30
Area 0
Serial Link
10.0.0.0/30
Area 0
Router 2
R2-OSPF
Router ID: 2.2.2.2
G0/0: 192.168.30.1/24
G0/1: 192.168.40.1/24
S0/0/0: 10.0.0.2/30
Area 0
LAN 1 - Router 1
PC1
192.168.10.10/24
PC2
192.168.20.10/24
OSPF Single-Area
Area: 0 (Backbone)
Process ID: 1
Network: 10.0.0.0/30
LAN 2 - Router 2
PC3
192.168.30.10/24
PC4
192.168.40.10/24
Keterangan Topologi:
  • 2 Router Cisco 2911 dengan koneksi serial
  • Router 1: Terhubung ke 2 LAN segments
  • Router 2: Terhubung ke 2 LAN segments
  • WAN Link: Serial connection point-to-point
  • Area 0: Single-area OSPF configuration
  • Process ID 1: OSPF process number
  • Router IDs: Manual configuration
  • Network Types: Broadcast (LAN), Point-to-Point (WAN)
IP Addressing Plan
Device Interface IP Address Subnet Mask Description
Router 1 GigabitEthernet 0/0 192.168.10.1 255.255.255.0 LAN 1 - VLAN 10
GigabitEthernet 0/1 192.168.20.1 255.255.255.0 LAN 2 - VLAN 20
Serial 0/0/0 10.0.0.1 255.255.255.252 WAN Link to Router 2
Router 2 GigabitEthernet 0/0 192.168.30.1 255.255.255.0 LAN 3 - VLAN 30
GigabitEthernet 0/1 192.168.40.1 255.255.255.0 LAN 4 - VLAN 40
Serial 0/0/0 10.0.0.2 255.255.255.252 WAN Link to Router 1
PC1 Ethernet 192.168.10.10 255.255.255.0 Gateway: 192.168.10.1
PC2 Ethernet 192.168.20.10 255.255.255.0 Gateway: 192.168.20.1
PC3 Ethernet 192.168.30.10 255.255.255.0 Gateway: 192.168.30.1
PC4 Ethernet 192.168.40.10 255.255.255.0 Gateway: 192.168.40.1
OSPF Configuration Plan
Parameter Router 1 Router 2 Keterangan
OSPF Process ID 1 1 Harus sama untuk adjacency
Router ID 1.1.1.1 2.2.2.2 Manual configuration
Area 0 0 Single-area design
Networks 192.168.10.0/24
192.168.20.0/24
10.0.0.0/30
192.168.30.0/24
192.168.40.0/24
10.0.0.0/30
Network statements dengan wildcard
Hello/Dead Timers Default (10/40s) Default (10/40s) Point-to-point: 10/40s
Langkah Kerja Detail
Langkah 1: Persiapan Topologi dan IP Addressing 30 menit

Buat topologi dan konfigurasi IP address pada semua devices:

Router 1 Configuration:
enable
configure terminal
hostname R1-OSPF

interface gigabitethernet 0/0
  ip address 192.168.10.1 255.255.255.0
  no shutdown
exit

interface gigabitethernet 0/1
  ip address 192.168.20.1 255.255.255.0
  no shutdown
exit

interface serial 0/0/0
  ip address 10.0.0.1 255.255.255.252
  clock rate 64000    ! DCE side
  no shutdown
exit
Router 2 Configuration:
enable
configure terminal
hostname R2-OSPF

interface gigabitethernet 0/0
  ip address 192.168.30.1 255.255.255.0
  no shutdown
exit

interface gigabitethernet 0/1
  ip address 192.168.40.1 255.255.255.0
  no shutdown
exit

interface serial 0/0/0
  ip address 10.0.0.2 255.255.255.252
  no shutdown
exit
Pastikan:
  • Semua interfaces dalam status up/up
  • Clock rate dikonfigurasi pada DCE side
  • Basic connectivity antara adjacent devices
  • PCs memiliki default gateway yang benar
Langkah 2: Konfigurasi OSPF pada Router 1 25 menit

Konfigurasi OSPF process dan advertise networks di Router 1:

! Masuk ke mode global configuration
configure terminal

! Aktifkan OSPF dengan process ID 1
router ospf 1

! Konfigurasi Router ID manual
router-id 1.1.1.1

! Advertise networks ke OSPF
! Format: network [address] [wildcard] area [area-id]
network 10.0.0.0 0.0.0.3 area 0
network 192.168.10.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0

! Keluar dari mode OSPF
exit

! Verifikasi konfigurasi
show ip protocols
show running-config | section router ospf
Wildcard Mask Explanation:
Network Subnet Mask Wildcard Mask Explanation
10.0.0.0/30 255.255.255.252 0.0.0.3 Inverse of subnet mask
192.168.10.0/24 255.255.255.0 0.0.0.255 Matches entire /24 network
192.168.20.0/24 255.255.255.0 0.0.0.255 Matches entire /24 network
Langkah 3: Konfigurasi OSPF pada Router 2 25 menit

Konfigurasi OSPF process dan advertise networks di Router 2:

! Masuk ke mode global configuration
configure terminal

! Aktifkan OSPF dengan process ID 1
router ospf 1

! Konfigurasi Router ID manual
router-id 2.2.2.2

! Advertise networks ke OSPF
network 10.0.0.0 0.0.0.3 area 0
network 192.168.30.0 0.0.0.255 area 0
network 192.168.40.0 0.0.0.255 area 0

! Keluar dari mode OSPF
exit

! Verifikasi konfigurasi
show ip protocols
show running-config | section router ospf
OSPF Network Statements:
  • Process ID: Hanya significant locally, tidak perlu sama antar router
  • Area ID: Harus sama untuk membentuk adjacency
  • Wildcard Mask: Inverse dari subnet mask (0=match, 1=ignore)
  • Network Command: Mengaktifkan OSPF pada interfaces yang match
Langkah 4: Verifikasi OSPF Configuration 30 menit

Lakukan verifikasi untuk memastikan OSPF beroperasi dengan benar:

OSPF Neighbor Verification:
! Verifikasi OSPF neighbors
show ip ospf neighbor
show ip ospf interface
show ip ospf interface brief

! Expected Output:
Neighbor ID   Pri  State     Dead Time  Address     Interface
2.2.2.2       1   FULL/  -    00:00:39    10.0.0.2    Serial0/0/0
OSPF Routes Verification:
! Verifikasi OSPF routes
show ip route ospf
show ip route

! Expected Output:
Codes: O - OSPF

O    192.168.30.0/24 ...
O    192.168.40.0/24 ...

! O = OSPF routes
OSPF Database Verification:
show ip ospf database
show ip ospf database router
show ip ospf database network

! Perhatikan LSA types:
- Type 1: Router LSA
- Type 2: Network LSA
Interface Verification:
show ip ospf interface serial 0/0/0
show ip ospf interface gigabitethernet 0/0

! Perhatikan:
- Network Type
- Cost
- Hello/Dead Timers
- Neighbor Count
Langkah 5: Testing End-to-End Connectivity 20 menit

Test konektivitas end-to-end untuk memverifikasi OSPF routing:

Testing dari PC1:
! Test konektivitas ke semua networks
ping 192.168.20.10    ! Local LAN - Should SUCCESS
ping 192.168.30.10    ! Remote LAN - Should SUCCESS
ping 192.168.40.10    ! Remote LAN - Should SUCCESS
ping 10.0.0.2        ! Router 2 WAN - Should SUCCESS

! Trace route untuk path verification
tracert 192.168.30.10
tracert 192.168.40.10
Expected Results:
  • Local LAN: Direct connectivity ✓
  • Remote LANs: OSPF routing ✓
  • WAN Link: Direct connectivity ✓
  • Traceroute: Shows path melalui OSPF ✓
Routing Table Check:
Router1# show ip route

O    192.168.30.0/24 ...
      [110/65] via 10.0.0.2
O    192.168.40.0/24 ...
      [110/65] via 10.0.0.2
Langkah 6: OSPF Optimization (Optional) 25 menit

Konfigurasi optimasi OSPF untuk performance dan management:

Router ID Modification:
! Ubah OSPF Router ID
router ospf 1
router-id 1.1.1.1    ! Pada Router1
exit

router ospf 1
router-id 2.2.2.2    ! Pada Router2
exit

! Restart OSPF process untuk apply changes
clear ip ospf process
Cost Adjustment:
! Adjust OSPF cost pada interface
interface gigabitethernet 0/0
ip ospf cost 10
exit

! Verifikasi perubahan cost
show ip ospf interface gigabitethernet 0/0
Passive Interface:
! Configure passive interface untuk LAN
router ospf 1
passive-interface gigabitethernet 0/0
passive-interface gigabitethernet 0/1
exit

! Verifikasi
show ip ospf interface brief
Verification Commands:
show ip ospf neighbor
show ip route ospf
show ip ospf interface
show ip protocols
Langkah 7: Troubleshooting (Jika Diperlukan) 15 menit

Gunakan troubleshooting commands jika ada issues dengan OSPF:

Debug Commands:
! Debug OSPF events
debug ip ospf events
debug ip ospf packet
debug ip ospf adj

! Turn off debug
undebug all

! Show OSPF statistics
show ip ospf statistics
Common Issues:
  • Adjacency tidak terbentuk: Cek area ID, hello/dead timers
  • Routes tidak muncul: Verifikasi network statements
  • Interface tidak aktif: Cek interface status dan IP addresses
  • Authentication failed: Pastikan authentication configuration match
Troubleshooting Checklist:
1. Cek physical connectivity
2. Verifikasi IP addressing
3. Pastikan network statements correct
4. Cek area configuration match
5. Verifikasi interface OSPF enabled
6. Check for ACL blocking OSPF (224.0.0.5/6)

Kriteria Penilaian

Kriteria Indikator Bobot Status
IP Addressing IP address terkofigurasi dengan benar pada semua interfaces 2.0% Check
OSPF Configuration OSPF process, router ID, dan network statements benar 3.0% Check
OSPF Adjacency Neighbor adjacency mencapai state FULL 2.5% Check
Routing Table OSPF routes muncul di routing table dengan benar 1.5% Check
End-to-End Connectivity Konektivitas berhasil antara semua networks 1.0% Check
Total 10% Complete

Tips dan Best Practices OSPF

Security Best Practices
  • Gunakan OSPF authentication (plain text atau MD5) untuk mencegah routing attacks
  • Implementasi passive interfaces untuk mencegah unnecessary OSPF hellos pada LAN segments
  • Gunakan ACL untuk membatasi OSPF peer relationships
  • Monitor OSPF adjacency changes dengan logging
Configuration Tips
  • Selalu konfigurasi manual Router ID daripada mengandalkan automatic selection
  • Gunakan wildcard masks yang tepat dalam network statements
  • Documentasikan OSPF area design dan network summarization points
  • Test OSPF convergence setelah perubahan configuration
Common OSPF Issues and Solutions:
  • Adjacency stuck in INIT/2-Way: Cek MTU mismatch atau authentication
  • Routes missing: Verifikasi network statements dan area configuration
  • High CPU utilization: Cek untuk OSPF flooding atau large LSDB
  • Network flapping: Monitor interface stability dan OSPF timers