Open Shortest Path First adalah protokol routing link state dan digunakan untuk menghubungkan router-router yang berada dalam satu Autonomous System (AS) sehingga protokol routing ini termasuk juga kategori Interior Gateway Protocol (IGP).
Gambar di atas adalah contoh topology sederhana untuk melakukan basic konfigurasi OSPF.
Router (R1) :
interface Loopback0 ip address 10.10.1.1 255.255.255.255 ! interface FastEthernet0/0 ip address 172.10.1.1 255.255.255.252 duplex full ! interface FastEthernet1/0 ip address 192.168.10.1 255.255.255.0 speed auto duplex auto ! router ospf 1 router-id 10.10.1.1 network 172.10.1.0 0.0.0.3 area 0 network 192.168.10.0 0.0.0.255 area 0
Jika keluar seperti ini ketika menambahkan router-id, maka harus melakukan prosess “clear ip ospf process” untuk merefresh router-id sebelumnya, untuk melihat router-id nya bisa menggunakan command “sh ip protocols”
R1(config-router)#router-id 10.10.1.1 % OSPF: Reload or use "clear ip ospf process" command, for this to take effect R1#sh ip protocols *** IP Routing is NSF aware *** Routing Protocol is "ospf 1" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 192.168.10.1 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: 172.10.1.0 0.0.0.3 area 0 192.168.10.0 0.0.0.255 area 0 Routing Information Sources: Gateway Distance Last Update 10.20.1.1 110 00:07:17 192.168.20.1 110 05:36:18 Distance: (default is 110) R1#clear ip ospf process Reset ALL OSPF processes? [no]: yes R1# *Dec 20 17:00:19.838: %OSPF-5-ADJCHG: Process 1, Nbr 10.20.1.1 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached *Dec 20 17:00:19.982: %OSPF-5-ADJCHG: Process 1, Nbr 10.20.1.1 on FastEthernet0/0 from LOADING to FULL, Loading Done
Check kembali Router-ID nya apakah sudah berubah atau belum
R1#show ip protocols *** IP Routing is NSF aware *** Routing Protocol is "ospf 1" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 10.10.1.1 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: 172.10.1.0 0.0.0.3 area 0 192.168.10.0 0.0.0.255 area 0 Routing Information Sources: Gateway Distance Last Update 10.20.1.1 110 00:09:37 192.168.20.1 110 05:38:38 Distance: (default is 110)
# Lakukan hal yang sama di router (R2)
Router (R2)
interface Loopback0 ip address 10.20.1.1 255.255.255.255 ! interface FastEthernet0/0 ip address 172.10.1.2 255.255.255.252 duplex full ! interface FastEthernet1/0 ip address 192.168.20.1 255.255.255.0 ! router ospf 1 router-id 10.20.1.1 network 172.10.1.0 0.0.0.3 area 0 network 192.168.20.0 0.0.0.255 area 0 !
PC1
PC1> ip 192.168.10.10/24 192.168.10.1 PC1> show ip NAME : PC1[1] IP/MASK : 192.168.10.10/24 GATEWAY : 192.168.10.1 DNS : MAC : 00:50:79:66:68:00 LPORT : 10006 RHOST:PORT : 127.0.0.1:10007 MTU : 1500
PC2
PC2> show ip NAME : PC2[1] IP/MASK : 192.168.20.20/24 GATEWAY : 192.168.20.1 DNS : MAC : 00:50:79:66:68:01 LPORT : 10008 RHOST:PORT : 127.0.0.1:10009 MTU : 1500
Test Koneksi
Skenario selanjutnya adalah test koneksi antara PC1 – PC2, dan Router 1 – Router 2 dengan cara mengirimkan paket icmp :
PC2> ping 192.168.10.10 84 bytes from 192.168.10.10 icmp_seq=1 ttl=62 time=49.468 ms 84 bytes from 192.168.10.10 icmp_seq=2 ttl=62 time=26.298 ms 84 bytes from 192.168.10.10 icmp_seq=3 ttl=62 time=27.744 ms 84 bytes from 192.168.10.10 icmp_seq=4 ttl=62 time=26.173 ms 84 bytes from 192.168.10.10 icmp_seq=5 ttl=62 time=26.503 ms PC1> ping 192.168.20.20 84 bytes from 192.168.20.20 icmp_seq=1 ttl=62 time=21.601 ms 84 bytes from 192.168.20.20 icmp_seq=2 ttl=62 time=27.685 ms 84 bytes from 192.168.20.20 icmp_seq=3 ttl=62 time=26.792 ms 84 bytes from 192.168.20.20 icmp_seq=4 ttl=62 time=26.108 ms 84 bytes from 192.168.20.20 icmp_seq=5 ttl=62 time=26.462 ms R1#ping 192.168.20.20 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.20.20, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/32/40 ms R1#ping 192.168.10.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.10.10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 8/8/12 ms R2#ping 192.168.20.20 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.20.20, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/12 ms R2#ping 192.168.10.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.10.10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 20/24/40 ms
IP Route
Check ip route di Router 1 dan Router 2
R1#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 i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP + - replicated route, % - next hop override Gateway of last resort is not set 10.0.0.0/32 is subnetted, 1 subnets C 10.10.1.1 is directly connected, Loopback0 172.10.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.10.1.0/30 is directly connected, FastEthernet0/0 L 172.10.1.1/32 is directly connected, FastEthernet0/0 192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.10.0/24 is directly connected, FastEthernet1/0 L 192.168.10.1/32 is directly connected, FastEthernet1/0 O 192.168.20.0/24 [110/2] via 172.10.1.2, 05:01:14, FastEthernet0/0
R2#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 i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP + - replicated route, % - next hop override Gateway of last resort is not set 10.0.0.0/32 is subnetted, 1 subnets C 10.20.1.1 is directly connected, Loopback0 172.10.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.10.1.0/30 is directly connected, FastEthernet0/0 L 172.10.1.2/32 is directly connected, FastEthernet0/0 O 192.168.10.0/24 [110/2] via 172.10.1.1, 05:11:40, FastEthernet0/0 192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.20.0/24 is directly connected, FastEthernet1/0 L 192.168.20.1/32 is directly connected, FastEthernet1/0
Semoga bermanfaat
Cheers – Andito Yugo Wicaksono