Internal router
4 0 1
2
• Beberapa area di ospf:
1. Backbone area
area 0 dan terhubung dengan setiap area
2. Regular area
non-backbone area, database berisi daftar rute network internal dan
eksternal
3. Stub area
database berisi rute internal network dan rute default
4. Totally stuby area
area khusus untuk perangkat tertentu
Istilah
• Router ID
Untuk mengidentifikasi masing-masing router. Sering kali RID digunakan bersama loopback adapter.
Jika pakai loopback kita dapat menentukan ID secara bebas, tidak harus menggunakan ip address
tertinggi.
*loopback address = Alamat IP (IP Address) yang dialokasikan untuk mengakses host itu sendiri,
hanya digunakan untuk menjalankan aplikasi secara lokal dalam host yang bersangkutan. Digunakan
sebagai router id dalam interface-interface loopback. Interface loopback merupakan interface
logikal, artinya interface ini secara nyata tidak ada atau virtual. IP loopback sangat penting digunakan
dalam router OSPF. Loopback IP loopback di set dengan IP yang tertinggi yaitu dengan subnet mask
255.255.255.255. Ip loopback tidak akan down karena IP ini tidak menghubungkan ke suatu network
tertentu atau interface nyata.
• LSA
Menyimpan informasi topologi di ospf, disimpan di LSDB dan dikomunikasikan dengan LSU message.
• BDR (Backup designated router)
Merupakan router cadangan untuk membackup jika designated router tidak berfungsi.
Tahapan OSPF secara umum
• Neighbor discovery
Bertukar informasi antar router, kemudian akan menyimpan/menulis di tabel
routing.
• Topology database exchange
Setiap router mengirimkan tentang networknya. Infoemasi disimpan pada LSDB.
Biasanya informasinya berupa: Router ID (RID), interface masing-masing router,
IP, netmask, subnet, daftar router + interfacenya.
• Route computation
Melakukan kalkulasi rute terbaik
OSPF Tabel
• Adjencecy Table
Isi: semua router tetangga
• Topological table
Isi: data router dalam 1 area
• Routing table
Isi: cost terendah untuk mencapai router atau network lain
PRAKTIKUM
Latihan 1 (OSPF sederhana)
• Yang digunakan=
1. 2 Router 1841
2. 2 Switch
3. 2 Pc
• Kabel
1. Router ke router = cross
2. Lainnya straight
• Area
•1
1. Buat topologinya
2. Kemudian kita beri PC 0 ip
192.168.100.2 dengan gateway
192.168.100.1
3. Kemudian kita beri PC 1 ip
192.168.200.2 dengan gateway
192.168.200.1
4. Kemudian kita seting router 0 dan
router 1 dengan cli
• Router 0 • Router 0
• Router>en • R1(config)#router ospf 1
• Router#conf t • R1(config-router)#network
• Router(config)#hostname R1 192.168.100.0 0.0.0.255 area 1
• R1(config)#int f0/0 • R1(config-router)#network
• R1(config-if)ip add 20.20.20.1 20.20.20.0 0.0.0.255 area 1
255.255.255.0 • R1(config-router)#ex
• R1(config-if)No sh • R1(config)#ex
• R1(config-if)ex • R1#
• R1(config)#int f0/1 • R1#sh ip route
• R1(config-if)#ip add
192.168.100.1 255.255.255.0
• R1(config-if)#no sh
• R1(config-if)#ex
• 0.0.0.255 dapat dari mana?
• Netmask tersebut dapat dari netmask ip yang digunakan 255.255.255.0 maka
jika diubah biner maka menjadi 11111111.11111111.11111111.00000000
kemudian ubah biner tersebut dari biner 1 menjadi 0 dan biner 0 menjadi 1
sehingga menjadi 00000000.00000000.00000000.11111111 yang decimalnya
adalah 0.0.0.255
ini dinamakan wildcard
Router>en R1#
Router#conf t R1#conf t
Enter configuration commands, one per line. End with CNTL/Z. Enter configuration commands, one per line. End
Router(config)#hostname R1 → memberikan penamaan with CNTL/Z.
R1(config)#int g0/0 R1(config)#router ospf 1
R1(config-if)#ip add 192.168.10.1 255.255.255.0 R1(config-router)#network 192.168.10.0 0.0.0.255
R1(config-if)#no sh → hidupkan area 0
R1(config-router)#network 192.168.9.0 0.0.0.255
R1(config-if)# area 0
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state R1(config-router)#end
to up R1#
ex %SYS-5-CONFIG_I: Configured from console by
R1(config)#int g0/1 console
R1(config-if)#ip add 192.168.9.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state
to up
ex
• Lakukan setting pada router satunya
• Lakukan setting PC sesuai network dan gatewaynya
• Uji konectivitas
Latihan 3 (OSPF beda area menggunakan RID)
• Kebutuhan 4 router tipe 2911
• Kabel cross
• Setting ip tiap interface router
• Setting router 1
• Router>en
• Router#conf t
• Enter configuration commands, one per line. End with CNTL/Z.
• Router(config)#int g0/0
• Router(config-if)#ip add 10.10.10.1 255.255.255.252
• Router(config-if)#no sh
• Router(config-if)#
• %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
• Router(config-if)#ex
• Router(config)#hostname R1
• R1(config)#
• Setting Router 2
• Router>en
• Router#conf t
• Enter configuration commands, one per line. End with CNTL/Z.
• Router(config)#hostname R2
• R2(config)#int g0/1
• R2(config-if)#ip add 20.20.20.1 255.255.255.252
• R2(config-if)#no sh
• R2(config-if)#
• %LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
• R2(config-if)#ex
• R2(config)#int g0/0
• R2(config-if)#ip add 10.10.10.2 255.255.255.252
• R2(config-if)#no sh
• R2(config-if)#
• %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
• R3(config-if)#
• %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
• R3(config-if)#
• %LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
• ex
• R3(config)#
Uji konektivitas
• Kenapa bisa failed? Belum di set routing
• Setting ospf rid R1
• R1>en
• R1#conf t
• Enter configuration commands, one per line. End with CNTL/Z.
• R1(config)#router ospf 1
• R1(config-router)#router-id 1.1.1.1
• R1(config-router)#network 10.10.10.0 0.0.0.3 area 1
• R1(config-router)#exit
• R1(config)#
Wild card
• Mask = 255.255.255.252
• 11111111.11111111.111111111.11111100
• Wildcard= 00000000.00000000.00000000.00000011
• 0.0.0.3
• Setting ospf rid r2
• R2>en
• R2#conf t
• Enter configuration commands, one per line. End with CNTL/Z.
• R2(config)#router ospf 1
• R2(config-router)#router-id 2.2.2.2
• R2(config-router)#network 10.10.10.0 0.0.0.3 area 1
• R2(config-router)#network 20.20.20.0 0.0.0.3
• 00:25:17: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0
from LOADING to FULL, Loading Done
• area 0
• R2(config-router)#ex
• Show ip route
• R2#show 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
• R2#
• Setting routing ospf di r3 sama seperti di r2 karena melewati
backbone/area 0 maka yang dimasukkan dalam network adalah
• 20.20.20.0 0.0.0.3 area 0
• 30.30.30.0 0.0.0.3 area 2
• Untuk ospf r4 hanya 1 karena hanya berada di area 2 dan hanya
terhubung dengan r3
• 30.30.30.0 0.0.0.3 area 2
Uji konektivitas
• Ujilah konektivitas R1-R2, R2-R3, R3-R4
• Kemudian buatlah tambahan device 1 pc masuk ke area 1 (hubungkan
ke r1)
• Kemudian daftarkan router ospfnya ke area 1 melalui r1
• R1(config)#router ospf 1
• R1(config-router)#router-id 1.1.1.1
• R1(config-router)#network 192.168.10.0 0.0.0.255 area 1
• R1(config-router)#ex
• R1(config)#