Little boy questioned his mother, he asked what he can be in the future..with a sad smile, she tells him he can be anything he wants to be.... Boy said he’d become (an) astronaut and fly out into space crews around the universe he wanted to see the stars and also see other planets in outer space------------- "Why don’t we just keep dreaming, let’s keep our mind with dream and faith, as long as we wish we can make it come true, how old you are never forget your dream and keep dreaming "

Sunday 27 May 2018

Cisco Discovery Protocol (CDP)

Cisco Discovery Protocol (CDP) 

Cisco Discovery Protocol (CDP) adalah protocol proprietary yang dirancang oleh Cisco untuk membantu administrator mengumpulkan informasi tentang perangkat yang terpasang secara lokal. Dengan CDP, kita bisa mengumpulkan informasi perangkat keras dan protokol pada perangkat tetangga, yang merupakan informasi penting  ketika melakukan troubleshooting  dan mendokumentasikan jaringan. Protocol CDP ini secara default sudah aktif di semua interface Cisco device.

CDP Timer dan CDP Holdtime

Perintah show cdp akan memberi informasi tentang dua CDP global parameter yang dapat dikonfigurasi pada perangkat Cisco:
  • CDP Timer :  Membatasi seberapa sering paket CDP dikirim keluar ke semua interface yang aktif.
  • CDP Holdtime : Membatasi jumlah waktu perangkat akan menerima dan menyimpan informasi paket CDP yang diterima dari perangkat tetangga.
Untuk melihat bagaimana CDP bekerja saya gunakan skema dibawah ini. Semua Router dan Switch menggunakan parameter default.
RT1
Gi0/0
192.168.1.1/24
Gi0/1
192.168.2.1/24
SW1
VLAN1
192.168.1.10/24
Gateway
192.168.1.1/24
SW2
VLAN1
192.168.2.10/24
Gateway
192.168.2.1/24


Output dari perintah show cdp pada SW1, SW2 dan RT1 adalah sebagai berikut :
SW1#sh cdp
Global CDP information:
    Sending CDP packets every 60 seconds
    Sending a holdtime value of 180 seconds
    Sending CDPv2 advertisements is enabled
SW2#sh cdp
Global CDP information:
    Sending CDP packets every 60 seconds
    Sending a holdtime value of 180 seconds
    Sending CDPv2 advertisements is enabled
RT1#sh cdp
Global CDP information:
    Sending CDP packets every 60 seconds
    Sending a holdtime value of 180 seconds
    Sending CDPv2 advertisements is enabled

Output ini memberitahu kita bahwa secara default paket CDP dikirimkan setiap 60 detik dan akan menyimpan paket CDP dari tetangganya di  CDP table selama 180 detik. Kita dapat menggunakan perintah  cdp holdtime dan cdp timer pada mode global configuration untuk mengatur waktu CDP Holdtime dan CDP Timer :

RT1(config)#cdp ?
 advertise-v2 CDP sends version-2 advertisements
 holdtime     Specify the holdtime (in sec) to be sent in packets
 run          Enable CDP
 timer        Specify the rate at which CDP packets are sent (in                  sec)
 tlv          Enable exchange of specific tlv information

RT1(config)#cdp holdtime ?
 <10-255> Length of time (in sec) that receiver must keep this packet

RT1(config)#cdp timer ?
 <5-254> Rate at which CDP packets are sent (in sec)

Ketika menggunkan Cisco Packet Tracer, anda akan menyadari tidak menemukan opsi advertise-v2, holdtime, timer dan tlv. Opsi perintah tsb tidak tersedia di software simulasi cisco packet tracer tapi tersedia di software simulasi lain (seperti GNS3) yang menggunakan real Cisco IOS (Cisco IOU).

Untuk mematikan protokol CDP sepenuhnya menggunakan perintah no cdp run dari  mode konfigurasi global dan mengaktifkannya dengan perintah cdp run :

RT1(config)#no cdp run 
RT1(config)#cdp run 

Untuk mematikan atau mengaktifkan protokol CDP pada interface tertentu gunakan perintah no cdp enable atau cdp enable :

RT1(config)#interface gigabitEthernet 0/0
RT1(config-if)#cdp enable 

RT1(config)#interface gigabitEthernet 0/0
RT1(config-if)#no cdp enable 

Mendapatkan Informasi Device Tetangga (Neighbour Device)

Informasi yang dapat diperoleh dari CDP :
  • Versi Cisco IOS
  • Paltform/jenis perangkat
  • Hostname
  • IP address dari interface
  • Device lain yang menggunakan CDP
  • Interface yang aktif pada perangkat Cisco
  • Duplex seting
  • VTP Domain
  • Native VLAN
Perintah show cdp neighbor memberikan informasi tentang perangkat yang terhubung secara langsung. 

SW1
SW1#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge, S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID  Local Intrfce  Holdtme  Capability  Platform  Port ID
RT1        Fas 0/1        175      R           C2900     Gig 0/0
Keterangan :
Switch 1 (SW1) terhubung langsung dengan RT1 (Cisco Router 2900) melalui interface lokal SW1 Fas 0/1 ke interface Gig 0/0 milik RT1

SW2
SW2#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge, S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID  Local Intrfce  Holdtme  Capability  Platform  Port ID
RT1        Fas 0/1        140      R           C2900     Gig 0/1
Keterangan :
Switch 2 (SW2) terhubung langsung dengan RT1 (Cisco Router 2900) melalui interface lokal SW2 Fas 0/1 ke interface Gig 0/1 milik RT1

RT1
RT1#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge, S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID  Local Intrfce  Holdtme  Capability  Platform  Port ID
SW1        Gig 0/0        142      S           2960      Fas 0/1
SW2        Gig 0/1        173      S           2960      Fas 0/1
Keterangan :
Router 1 (RT1) terhubung langsung dengan SW1 (Cisco Switch 2960) melalui interface lokal RT1 Gig0/0 ke interface Fas 0/1 milik SW1 dan terhubung ke SW2 (Cisco Switch 2960) melalui interface lokal RT1 Gig0/1 ke interface Fas 0/1 milik SW2.

Deskripsi
Device ID
Nama host dari device yang terhubung langsung
Local Interface
Port dari interface dimana anda menerima paket CDP
Holdtime
Sisa waktu dari informasi untuk disimpan sebelum membuangnya jika tidak ada lagi paket CDP yang diterima
Capability
Jenis perangkat tetangga Router, Switch, Repeater dan lain lain. R - Router, T - Trans Bridge, B - Source Route Bridge, S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Platform
Tipe dari perangkat Cisco yang terhubung
Port ID
Port atau interface perangkat tetanggga yang mengirimkan paket CDP

Penting untuk diingat bahwa paket CDP tidak dilewatkan melalui Switch Cisco dan anda hanya melihat perangkat yang terhubung langsung. Jadi ini berarti bahwa jika router anda terhubung ke sebuah switch, anda tidak akan melihat salah satu perangkat Cisco terhubung ke switch itu!

Untuk mendapatkan informasi yang lebih yang lebih detail anda bisa menggunakan perintah show cdp neighbor detail seperti dibawah ini :

RT1
RT1#show cdp neighbors detail 

Device ID: SW1
Entry address(es): 
  IP address : 192.168.1.10
Platform: cisco 2960, Capabilities: Switch
Interface: GigabitEthernet0/0, Port ID (outgoing port): FastEthernet0/1
Holdtime: 120

Version :
Cisco IOS Software, C2960 Software (C2960-LANBASE-M), Version 12.2(25)FX, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by Cisco Systems, Inc.
Compiled Wed 12-Oct-05 22:05 by pt_team

advertisement version: 2
Duplex: full
---------------------------

Device ID: SW2
Entry address(es): 
  IP address : 192.168.2.10
Platform: cisco 2960, Capabilities: Switch
Interface: GigabitEthernet0/1, Port ID (outgoing port): FastEthernet0/1
Holdtime: 151

Version :
Cisco IOS Software, C2960 Software (C2960-LANBASE-M), Version 12.2(25)FX, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by Cisco Systems, Inc.
Compiled Wed 12-Oct-05 22:05 by pt_team

advertisement version: 2
Duplex: full

SW1
SW1#sh cdp neighbors detail 

Device ID: RT1
Entry address(es): 
  IP address : 192.168.1.1
Platform: cisco C2900, Capabilities: Router
Interface: FastEthernet0/1, Port ID (outgoing port): GigabitEthernet0/0
Holdtime: 141

Version :
Cisco IOS Software, C2900 Software (C2900-UNIVERSALK9-M), Version 15.1(4)M4, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Thurs 5-Jan-12 15:41 by pt_team

advertisement version: 2
Duplex: full

SW2
SW2#sh cdp neighbors detail 

Device ID: RT1
Entry address(es): 
  IP address : 192.168.2.1
Platform: cisco C2900, Capabilities: Router
Interface: FastEthernet0/1, Port ID (outgoing port): GigabitEthernet0/1
Holdtime: 157

Version :
Cisco IOS Software, C2900 Software (C2900-UNIVERSALK9-M), Version 15.1(4)M4, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Thurs 5-Jan-12 15:41 by pt_team

advertisement version: 2
Duplex: full

Dengan perintah tsb kita mendapatkan informasi tambahan yaitu Hostname bersama dengan IP address dan versi dari IOS yang dipakai.

Alhamdulilah, sekian yang bisa saya sampaikan.. semoga bermanfaat ^^

No comments:

Post a Comment