Showing posts with label Cisco. Show all posts
Showing posts with label Cisco. Show all posts

Wednesday, May 7, 2014

Static Routing (Cisco Router) - Komputekid

cisco-logoBasic Configuration

Static Routing adalah teknik routing yang mengharuskan Administrator jaringan menyusun tabel routing secara manual. Administrator jaringan harus mengisikan entry route untuk menuju remote network, beserta gateway (next hop) yang dapat digunakan router untuk mencapai remote network tersebut.
 static_routing_cisco_1
Pada topologi di atas, Administrator jaringan harus memasukkan entry static routing menuju network 192.168.2.0/24 pada R1. Entry ini harus menggunakan 10.10.10.2 sebagai parameter gateway next hop. Sedangkan pada R2, Administrator harus memasukkan entry 192.168.1.0/24 dengan 10.10.10.1 sebagai next hop.
Pada saat static routing belum dikonfigurasikan, maka tabel routing pada kedua router akan terlihat seperti berikut ini.
R1#show ip route
Codes: C – connected, S – static, I – IGRP, 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
       * – candidate default, U – per-user static route, o – ODR
       P – periodic downloaded static route
 
Gateway of last resort is not set
 
     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
 
 

 
R2#show ip route
Codes: C – connected, S – static, I – IGRP, 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
       * – candidate default, U – per-user static route, o – ODR
       P – periodic downloaded static route
 
Gateway of last resort is not set
 
     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/1
C    192.168.2.0/24 is directly connected, FastEthernet0/0
 
 
Adapun konfigurasi static routing yang harus diberikan kepada Router R1 adalah sebagai berikut
 R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip route 192.168.2.0 255.255.255.0 10.10.10.2

Sedangkan konfigurasi static routing pada R2, dapat menggunakan perintah sebagai berikut.
R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#ip route 192.168.1.0 255.255.255.0 10.10.10.1

Sehingga hasil akhir dari konfigurasi static routing tersebut dapat dilihat pada tabel routing seperti berikut ini.

R1#show ip route
Codes: C – connected, S – static, I – IGRP, 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
       * – candidate default, U – per-user static route, o – ODR
       P – periodic downloaded static route
 
Gateway of last resort is not set
 
     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
S    192.168.2.0/24 [1/0] via 10.10.10.2
 
R2#show ip route
Codes: C – connected, S – static, I – IGRP, 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
       * – candidate default, U – per-user static route, o – ODR
       P – periodic downloaded static route
 
Gateway of last resort is not set
 
     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/1
S    192.168.1.0/24 [1/0] via 10.10.10.1
C    192.168.2.0/24 is directly connected, FastEthernet0/0
Pengujian dapat dilakukan pada kedua router seperti terlihat berikut ini.
R1#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 20/24/36 ms
 
 

R2#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/18/20 ms
 
 
 

Load Balance

Teknik Load Balance digunakan untuk membagi bebas (load) dari traffic jaringan. Teknik ini bisa digunakan jika untuk menuju satu remote network terdapat beberapa link (jalur), seperti terlihat pada gambar berikut ini.
 static_routing_cisco_2

Konfigurasi yang perlu dilakukan pada router R1 adalah sebagai berikut.
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip route 192.168.2.0 255.255.255.0 10.10.10.2
R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.10.2

Sedangkan pada Router R2, konfigurasi yang perlu dilakukan adalah sebagai berikut.
R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#ip route 192.168.1.0 255.255.255.0 10.10.10.1
R2(config)#ip route 192.168.1.0 255.255.255.0 172.16.10.1

Tabel routing dari kedua router yang menerapkan teknik load balance akan terlihat seperti berikut ini.
R1#show ip route
Codes: C – connected, S – static, I – IGRP, 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
       * – candidate default, U – per-user static route, o – ODR
       P – periodic downloaded static route
 
Gateway of last resort is not set
 
     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/1
     172.16.0.0/30 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, FastEthernet1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
S    192.168.2.0/24 [1/0] via 10.10.10.2
                    [1/0] via 172.16.10.2
 
 
 
 
 
R2#show ip route
Codes: C – connected, S – static, I – IGRP, 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
       * – candidate default, U – per-user static route, o – ODR
       P – periodic downloaded static route
 
Gateway of last resort is not set
 
     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/1
     172.16.0.0/30 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, FastEthernet1/0
S    192.168.1.0/24 [1/0] via 10.10.10.1
                    [1/0] via 172.16.10.1
C    192.168.2.0/24 is directly connected, FastEthernet0/0



Fail Over

Teknik Fail Over adalah teknik yang digunakan untuk menyediakan link cadangan untuk menuju suatu network tujuan. Link cadangan ini tidak akan digunakan bila link utama masih berfungsi dengan baik. Untuk menerapkan teknik ini, harus dikonfigurasikan nilai Administrative Distance (AD) yang lebih besar pada link cadangan. Router cenderung akan menggunakan link dengan Administrative Distance terkecil untuk dimasukkan ke dalam tabel routing.
Secara default, static routing memiliki nilai AD = 1, sehingga untuk membuat link cadangan, harus dikonfigurasikan static routing dengan nilai AD yang lebih besar dari 1, seperti terlihat berikut ini.
 static_routing_cisco_3

Konfigurasi static routing dengan nilai AD yang bervariasi harus dilakukan pada kedua router dengan menggunakan perintah sebagai berikut.
R1(config)#
R1(config)#ip route 192.168.2.0 255.255.255.0 10.10.10.2
R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.10.2 2
 
R2(config)#
R2(config)#ip route 192.168.1.0 255.255.255.0 10.10.10.1
R2(config)#ip route 192.168.1.0 255.255.255.0 172.16.10.1 2


Sehingga tabel routing pada kedua router akan terlihat seperti berikut ini.
R1#show ip route
Codes: C – connected, S – static, I – IGRP, 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
       * – candidate default, U – per-user static route, o – ODR
       P – periodic downloaded static route
 
Gateway of last resort is not set
 
     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/1
     172.16.0.0/30 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, FastEthernet1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
S    192.168.2.0/24 [1/0] via 10.10.10.2
 
 
 
 
 
R2#show ip route
Codes: C – connected, S – static, I – IGRP, 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
       * – candidate default, U – per-user static route, o – ODR
       P – periodic downloaded static route
 
Gateway of last resort is not set
 
     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/1
     172.16.0.0/30 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, FastEthernet1/0
S    192.168.1.0/24 [1/0] via 10.10.10.1
C    192.168.2.0/24 is directly connected, FastEthernet0/0

Link yang menggunakan network 172.16.10.0/30 akan terlihat pada tabel routing jika link utama “down”.

Basic Command (Cisco Router) - Komputekid

cisco-logoHostname Configuration

Untuk memudahkan manajemen router dalam jumlah yang banyak, maka setiap router harus diberikan hostname sebagai pengenal. Pengenal ini berguna pada saat akan melakukan konfigurasi maupun monitoring dalam jaringan.
Untuk melakukan konfigurasi hostname, harus dilakukan pada global EXEC Mode, seperti berikut.

Router>enable
Router#conf
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname IlmuJaringan-ROUTER
IlmuJaringan-ROUTER(config)#exit
IlmuJaringan-ROUTER#
%SYS-5-CONFIG_I: Configured from console by console
IlmuJaringan-ROUTER#
IlmuJaringan-ROUTER#

Router Password

Password pada Router Cisco dapat diterapkan pada berbagai level maupun akses konfigurasi. Pada saat akan memasuki privileged EXEC mode dapat diimplementasikan password dengan menggunakan perintah sebagai berikut.
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#enable password 123456

Jika ingin menerapkan password yang sudah dienkripsi pada saat akan memasuki privileged EXEC Mode, maka perintah  yang dapat digunakan adalah sebagai berikut.
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#enable secret 567890
Router(config)#^Z
Jika enable password dan enable secret digunakan bersamaan, maka yang akan digunakan oleh router adalah password yang dikonfigurasikan oleh enable secret.
Port Console yang sering digunakan untuk konfigurasi router juga dapat diberikan password dengan menggunakan perintah sebagai berikut.
Router#
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#line console 0
Router(config-line)#password cisco
Router(config-line)#login
Router(config-line)#exit
Sedangkan untuk akses konfigurasi yang menggunakan telnet dapat diberikan password, dengan menggunakan perintah berikut ini.
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#line vty 0 4
Router(config-line)#password cisco
Router(config-line)#login
Router(config-line)#exit
Secara default konfigurasi password pada line console maupun telnet tidak dienkripsi sehingga dapat dengan mudah dibaca, seperti terlihat berikut ini.
Router#show running-config
Building configuration…
 
Current configuration : 518 bytes
!
version 12.2
no service timestamps log datetime msec
!
line con 0
 password cisco
 login
line vty 0 4
 password cisco
 login
!
!
end

Untuk membuat password terenkripsi dapat digunakan perintah berikut ini.
 Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#service password-encryption


Banner

Mengkonfigurasikan banner sangat penting untuk pertimbangan keamanan suatu router, banner tersebut akan diperlihatkan pada saat ada user yang akan mengakses router. Peirntah yang dapat digunakan adalah sebagai berikut.
 Router(config)#banner motd #
Enter TEXT message.  End with the character ‘#’.
*********************************************
WARNING !!! Forbiden Access to this Device
*********************************************
#

Interface Configuration

Untuk mengkonfigurasikan interface Router Cisco, ada baiknya melihat terlebih dahulu interface apa saja yang dimiliki router tersebut. Perintah yang dapat digunakan adalah sebagai berikut
Router#show interface
FastEthernet0/0 is administratively down, line protocol is down (disabled)
  Hardware is Lance, address is 0060.3e14.7701 (bia 0060.3e14.7701)
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  ARP type: ARPA, ARP Timeout 04:00:00,
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of “show interface” counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
FastEthernet0/1 is administratively down, line protocol is down (disabled)
  Hardware is Lance, address is 0060.3e14.7702 (bia 0060.3e14.7702)
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  ARP type: ARPA, ARP Timeout 04:00:00,
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of “show interface” counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
Sebagai contoh untuk mengkonfigurasikan IP Address pada interface router, dapat digunakan skenario jaringan berikut ini.
basic_cisco_1

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface f0/0
Router(config-if)#ip address 192.168.0.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
 
Router(config)#
Router(config)#interface f0/1
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit



Saving Configuration

Cisco Router menggunakan dua konfigurasi yang disimpan pada dua file yang berbeda pula. Startup Configuration File adalah adalah file yang menyimpan konfigurasi yang akan digunakan router pada saat router tersebut pertama kali dihidupkan. Startup Configuration disimpan pada NVRAM sehingga tidak akan hilang pada saat router dimatikan maupun kehilangan power. Pada saat Router dihidupkan, Startup Configuration File akan di-copy ke dalam RAM untuk menjadi Running Configuration File. Karena disimpan dalam RAM, maka Running Configuration File akan hilang pada saat router kehilangan power.
Pada saat melakukan konfigurasi router, semua perintah konfigurasi akan disimpan pada Running Configuration File. Sehingga untuk mencegah kehilangan konfigurasi, maka konfigurasi yang tersimpan pada Running Configuration File perlu di-copy ke Startup Configuration File. Perintah yang dapat digunakan adalah sebagai berikut.

Router#copy running-config startup-config
Destination filename [startup-config]?
Building configuration…
[OK]
Router#
 Atau dapat juga menggunakan perintah singkat seperti berikut ini.
 Router#write
Building configuration…
[OK]
 
 
 
 
 

Basic Routing Table

Tabel routing adalah tabel yang akan digunakan router sebagai pedoman untuk mengirimkan paket data. Router hanya akan mengirimkan paket ke suatu network, jika network tersebut terdaftar didalam tabel routingnya. Jika ada sebuah paket yang menuju suatu network yang tidak terdaftar di dalam tabel routingnya, maka paket tersebut akan di-drop.
Yang akan ada di dalam tabel routing adalah network address dari jaringan yang dapat dituju beserta bagaimana cara router tersebut mencapai jaringan tersebut. Entry pada tabel routing tersebut bisa berupa network yang terhubung langsung (directly connected network) maupun network yang dapat dituju melalui router lain (remote network).
Sebagai contoh entry tabel routing untuk jaringan sederhana, dapat dilihat pada gambar dan uraian berikut ini.
 basic_cisco_1
Router#show ip route
Codes: C – connected, S – static, I – IGRP, 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
 
C    192.168.0.0/24 is directly connected, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/1