July 19, 2018

Lab.15 OSPF Single Area Cisco

Open Shortest Path First (OSPF) adalah link state routing protokol, dimana dalam menentukan router terdekatnya, router menggunakan parameter cost. OSPF menggunakan alogartima Dijkstra, untuk menentukan jarak terdekatnya. Dijkstra diambil dari penemunya Edsger Wybe Dijkstra.

Lab.15 OSPF Single Area Cisco

OSPF mendukung VLSM dan CIDR, serta cocok digunakan untuk jaringan skala kecil sampai besar. Selian itu, OSPF juga mendukung MD5 Authentication. OSPF mempunyai Adminstration Distance 110. Komponen utama dari Routing OSPF ada 3, yakni :

  • Adjency Database : membentuk tabel router yang terhubung langusung
  • Link-state database : membentuk topologi
  • Forwarding database : membentuk tabel routing.


OSPF juga saling melakukan pertukaran informasi untuk membentuk routing tabel, berikut 5 pesan/packet yang dipertukarkan oleh OSPF:

  • Hello paket
  • Database paket
  • LSR
  • LSU
  • LSAck


OSPF membutuhkan router ID yang unik untuk membedakan dengan router yang lain saat melakukan pertukaran LSA. RouterID dapat dikonfigurasi manual. Jika tidak dikonfigurasi manual, routerID akan menggunakan interface loopback. Jika interface looback tidak dikonfigurasi, maka router akan memilih IP Address tertinggi yang ada pada router tersebut.

(Baca juga : Cara konfigurasi Virtual Local Area Network VLAN di Mikrotik)

Selanjutnya network yang terhubung langsung dengan router harus di advertise menggunakan syntax network network-address wildcard-mask area area-id. Setiap router yang ingin terhubung dengan router lainya, harus berada dalam area yang sama. Area 0 sering disebut sebagai area backbone.

(Baca juga : Cara konfigurasi Virtual Routing Redudancy Protocol VRRP Mirkotik)

OSPF melakukan advertise network cukup kepada device yang membutuhkan saja. Oleh sebab itu Advertise cukup ke router yang saling terhubung dan membutuhkan pertukaran informasi. Advertise tidak perlu dilakukan ke network yang menuju ke host langsung. Selain masalah kemanan, juga mempertimbangkan bandwidth dan resource dari Router tersebut. Untuk membatasi advertise ke network yang tidak perlu bisa digunakan syntax passive interface.
Lab.15 OSPF Single Area Cisco 1


Konfigurasi R1

Konfigurasi hostname
Router#configure terminal
Router(config)#hostname R1
Selanjutnya konfigurasi IP Address sesuai dengan topologi, dan pastikan antar router bisa saling ping
R1(config)#interface gigabitEthernet 0/0
R1(config-if)#ip address 12.12.12.1 255.255.255.252
R1(config-if)#no shutdown
R1(config)#interface gigabitEthernet 0/1
R1(config-if)#ip address 13.13.13.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface gigabitEthernet 0/2
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
Untuk mengaktifkan routing OSPF, gunakan sintaks router ospf [process-id], selanjutnya konfigurasi router-id, dimana router id harus berbeda pada setiap Router yang terhubung dalam network OSPF. Selanjutnya definisikan masing-masing network yang connected directly. Passive-interface pada gig0/2 yang menuju LAN, karena LAN tidak memerlukan update OSPF
R1(config)#router ospf 10
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 12.12.12.0 0.0.0.3 area 0
R1(config-router)#network 13.13.13.0 0.0.0.3 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#passive-interface gigabitEthernet 0/2
R1(config-router)#end
R1#

Konfigurasi R2

Router#configure terminal
Router(config)#hostname R2
R2(config)#interface GIgabitEthernet 0/2
R2(config-if)#ip address 192.168.2.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface gigabitEthernet 0/0
R2(config-if)#ip address 12.12.12.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)# exit
R2(config)#interface gigabitEthernet 0/1
R2(config-if)#ip address 23.23.23.1 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#router ospf 10
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 12.12.12.0 0.0.0.3 area 0
R2(config-router)#network 23.23.23.0 0.0.0.3 area 0
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
R2(config-router)#passive-interface gigabitEthernet 0/2
R2(config-router)#end
R2#

Konfigurasi R3

Router#configure terminal
Router(config)#hostname
Router(config)#hostname R3
R3(config)#interface gigabitEthernet 0/1
R3(config-if)#ip address 13.13.13.2 255.255.255.0
R3(config-if)#ip address 13.13.13.2 255.255.255.252
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#inter
R3(config)#interface gigabitEthernet 0/0
R3(config-if)#ip address 23.23.23.2 255.255.255.252
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface gigabitEthernet 0/2
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#router ospf 10
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 23.23.23.0 0.0.0.3 area 0
R3(config-router)#network 13.13.13.0 0.0.0.3 area 0
R3(config-router)#network 192.168.3.0 0.0.0.255 area 0
R3(config-router)#passive-interface gigabitEthernet 0/2
R3#

Verifikasi Konfigurasi

Untuk melihat konfigurasi OSPF bisa menggunakan show ip ospf neighbor, show ip protocols, show ip ospf, show ip route dan show running-config.

Terlihat pada R1, router-id dari R3 dan R2 sudah melakukan adjencies dengan R1
R1#show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface
3.3.3.3 1 FULL/BDR 00:00:33 13.13.13.2 GigabitEthernet0/1
2.2.2.2 1 FULL/DROTHER 00:00:35 12.12.12.2 GigabitEthernet0/0
R1#

Untuk melihat routing protokol yang digunaka R1, bisa menggunakan perintah dibawah ini
R1#show ip protocols
Routing Protocol is "ospf 10"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 1.1.1.1
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
12.12.12.0 0.0.0.3 area 0
13.13.13.0 0.0.0.3 area 0
192.168.1.0 0.0.0.255 area 0
Passive Interface(s):
GigabitEthernet0/2
Routing Information Sources:
Gateway Distance Last Update
1.1.1.1 110 00:06:55
2.2.2.2 110 00:05:38
3.3.3.3 110 00:07:03
192.168.1.1 110 00:52:42
Distance: (default is 110)
R1#
R1#show ip ospf
Routing Process "ospf 10" with ID 1.1.1.1
Supports only single TOS(TOS0) routes
Supports opaque LSA
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
External flood list length 0
Area BACKBONE(0)
Number of interfaces in this area is 3
Area has no authentication
SPF algorithm executed 15 times
Area ranges are
Number of LSA 8. Checksum Sum 0x040fac
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
R1#
Selanjutnya, show ip route menunjukan route yang digunakan oleh R1 untuk mencapai suatu target. Flag O menunjukan bahwa untuk mencapai suatu target, R1 menggunakan dynamic Routing OSPF
R1#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
Gateway of last resort is not set
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.12.12.0/30 is directly connected, GigabitEthernet0/0
L 12.12.12.1/32 is directly connected, GigabitEthernet0/0
13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 13.13.13.0/30 is directly connected, GigabitEthernet0/1
L 13.13.13.1/32 is directly connected, GigabitEthernet0/1
23.0.0.0/30 is subnetted, 1 subnets
O 23.23.23.0/30 [110/2] via 13.13.13.2, 00:07:51, GigabitEthernet0/1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/2
L 192.168.1.1/32 is directly connected, GigabitEthernet0/2
O 192.168.2.0/24 [110/2] via 12.12.12.2, 00:06:41, GigabitEthernet0/0
O 192.168.3.0/24 [110/2] via 13.13.13.2, 00:23:50, GigabitEthernet0/1
R1#
R1#show running-config
Building configuration...
Current configuration : 1111 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
!
!
!
interface GigabitEthernet0/0
ip address 12.12.12.1 255.255.255.252
duplex auto
speed auto
!
interface GigabitEthernet0/1
ip address 13.13.13.1 255.255.255.252
duplex auto
speed auto
!
interface GigabitEthernet0/2
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
router ospf 10
router-id 1.1.1.1
log-adjacency-changes
passive-interface GigabitEthernet0/2
network 12.12.12.0 0.0.0.3 area 0
network 13.13.13.0 0.0.0.3 area 0
network 192.168.1.0 0.0.0.255 area 0
!
end

R1
Disqus Comments