Konfigurasi Routing OSPF Pada Router Cisco
Konfigurasi Routing OSPF Pada Router Cisco

Open Shortest Path First (OSPF) adalah merupakan routing protokol yang menggunakan konsep hirarki routing, dengan cara membagi-bagikan kelompok area. OSPF tidak memiliki batasan hop (hop count unlimited), dan dapat diimplementasikan di berbagai macam vendor. Dalam tutorial ini saya tidak membahas secara detail tentang OSPF dan cara kerja OSPF, namun saya akan memberi sedikit cara singkat untuk mengimplementasikan OSPF.

Berikut topologi yang akan digunakan dalam tutorial ini.

Konfigurasi Routing OSPF Pada Router Cisco LAB GNS3

1. Konfigurasi Router R1

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int fa0/1
R1(config-if)#ip add 12.12.12.1 255.255.255.252
R1(config-if)#no shutdown 
R1(config-if)#exit
R1(config)#
R1(config)#int fa0/0
R1(config-if)#ip add 192.168.1.254 255.255.255.0 
R1(config-if)#no shutdown 
R1(config-if)#exit
R1(config)#int loopback 0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#no shutdown 
R1(config-if)#exit
R1(config)#
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 192.168.1.0 0.0.0.255 area 0
R1(config-router)#exit         
R1(config)#

2. Konfigurasi Router R2

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int fa0/1
R2(config-if)#ip add 12.12.12.2 255.255.255.252
R2(config-if)#no shutdown 
R2(config-if)#exit
R2(config)#int fa
R2(config)#int fa0/0
R2(config-if)#ip add 192.168.2.254 255.255.255.0
R2(config-if)#no shutdown 
R2(config-if)#exit
R2(config)#
R2(config)#int loopback 0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#no shutdown 
R2(config-if)#exit
R2(config)#
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 192.168.2.0 0.0.0.255 area 0
R2(config-router)#exit
R2(config)#

3. Konfigurasi KOMPUTER-A

KOMPUTER-A> ip 192.168.1.1/24 192.168.1.254
Checking for duplicate address...
PC1 : 192.168.1.1 255.255.255.0 gateway 192.168.1.254
KOMPUTER-A>

4. Konfigurasi KOMPUTER-B

KOMPUTER-B> ip 192.168.2.1/24 192.168.2.254
Checking for duplicate address...
PC1 : 192.168.2.1 255.255.255.0 gateway 192.168.2.254
KOMPUTER-B> 

5. Verifikasi OSPF dan konektivitas di router R1 dan R2

R1#sh ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/BDR        00:00:38    12.12.12.2      FastEthernet0/1
R1#
R1#

R1#sh ip ospf database 

            OSPF Router with ID (1.1.1.1) (Process ID 10)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         11          0x80000004 0x00C689 2
2.2.2.2         2.2.2.2         1818        0x80000002 0x00A1A6 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
12.12.12.1      1.1.1.1         11          0x80000002 0x0038CE
R1#
R1#

R1#sh ip route 
Codes: 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

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     12.0.0.0/30 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
O    192.168.2.0/24 [110/20] via 12.12.12.2, 00:30:30, FastEthernet0/1
R1#
R2#sh ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1          1   FULL/BDR        00:00:38    12.12.12.1      FastEthernet0/1
R2#

R2#sh ip ospf database 

            OSPF Router with ID (2.2.2.2) (Process ID 10)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         108         0x80000004 0x00C689 2
2.2.2.2         2.2.2.2         1913        0x80000002 0x00A1A6 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
12.12.12.1      1.1.1.1         108         0x80000002 0x0038CE
R2#

R2#sh ip route 
Codes: 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

Gateway of last resort is not set

     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     12.0.0.0/30 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, FastEthernet0/1
O    192.168.1.0/24 [110/20] via 12.12.12.1, 00:32:18, FastEthernet0/1
C    192.168.2.0/24 is directly connected, FastEthernet0/0
R2#

6. Tes koneksi dari KOMPUTER-A ke KOMPUTER-B

KOMPUTER-A> sh ip
NAME        : KOMPUTER-A[1]
IP/MASK     : 192.168.1.1/24
GATEWAY     : 192.168.1.254
DNS         : 
MAC         : 00:50:79:66:68:00
LPORT       : 10022
RHOST:PORT  : 127.0.0.1:10023
MTU:        : 1500

KOMPUTER-A> ping 192.168.2.1   
84 bytes from 192.168.2.1 icmp_seq=1 ttl=62 time=62.400 ms
84 bytes from 192.168.2.1 icmp_seq=2 ttl=62 time=62.401 ms
84 bytes from 192.168.2.1 icmp_seq=3 ttl=62 time=62.401 ms
84 bytes from 192.168.2.1 icmp_seq=4 ttl=62 time=62.400 ms
84 bytes from 192.168.2.1 icmp_seq=5 ttl=62 time=40.002 ms
KOMPUTER-A>

7. Tes koneksi dari KOMPUTER-B ke KOMPUTER-A

KOMPUTER-B> sh ip
NAME        : KOMPUTER-B[1]
IP/MASK     : 192.168.2.1/24
GATEWAY     : 192.168.2.254
DNS         : 
MAC         : 00:50:79:66:68:01
LPORT       : 10019
RHOST:PORT  : 127.0.0.1:10021
MTU:        : 1500

KOMPUTER-B> ping 192.168.1.1
84 bytes from 192.168.1.1 icmp_seq=1 ttl=62 time=62.400 ms
84 bytes from 192.168.1.1 icmp_seq=2 ttl=62 time=46.801 ms
84 bytes from 192.168.1.1 icmp_seq=3 ttl=62 time=62.400 ms
84 bytes from 192.168.1.1 icmp_seq=4 ttl=62 time=62.400 ms
84 bytes from 192.168.1.1 icmp_seq=5 ttl=62 time=41.003 ms
KOMPUTER-B> 

Terima kasih atas kunjunganya, semoga bermanfaat.



Tulis Komentar

(Tidak ditampilkan dikomentar)