Cheat Sheet Perintah CLI
Kumpulan perintah untuk diagnosa jaringan (di OS) dan konfigurasi perangkat (Cisco IOS). Praktikkan di simulator.
Tool diagnosa (Windows / Linux / macOS)
| Tujuan | Windows | Linux / macOS |
|---|---|---|
| Cek konektivitas | ping 8.8.8.8 | ping 8.8.8.8 |
| Lihat jalur (hop) | tracert google.com | traceroute google.com |
| Konfigurasi IP | ipconfig /all | ip addr / ifconfig |
| Uji DNS | nslookup domain | dig domain / nslookup |
| Koneksi & port aktif | netstat -ano | ss -tulnp |
| Tabel ARP | arp -a | ip neigh / arp -a |
| Tabel routing | route print | ip route |
| Perbarui IP DHCP | ipconfig /renew | dhclient |
| Bersihkan cache DNS | ipconfig /flushdns | sudo systemd-resolve --flush-caches |
Cisco IOS — mode & navigasi
Router> enable ! masuk privileged mode
Router# configure terminal ! masuk global config
Router(config)# hostname R1 ! ganti nama perangkat
R1(config)# exit ! keluar satu level
R1# write memory ! simpan konfigurasi (atau: copy run start)
R1# show running-config ! lihat config aktif| Prompt | Mode |
|---|---|
Router> | User EXEC |
Router# | Privileged EXEC |
Router(config)# | Global Configuration |
Router(config-if)# | Interface Configuration |
Konfigurasi IP pada interface
R1(config)# interface gigabitEthernet 0/0
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# no shutdown ! aktifkan interface
R1(config-if)# exitVLAN (pada switch)
Switch(config)# vlan 10
Switch(config-vlan)# name HRD
Switch(config-vlan)# exit
! assign port ke VLAN (access)
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
! konfigurasi trunk antar-switch
Switch(config)# interface fa0/24
Switch(config-if)# switchport mode trunkVerifikasi: show vlan brief
Routing statis
! ip route <tujuan> <mask> <next-hop>
R1(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2
! default route
R1(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.1Verifikasi: show ip route
OSPF (routing dinamis)
R1(config)# router ospf 1
R1(config-router)# network 192.168.1.0 0.0.0.255 area 0
R1(config-router)# network 10.0.0.0 0.0.0.3 area 0Perhatikan: OSPF memakai wildcard mask, bukan subnet mask. Lihat Cheat Sheet Subnetting.
NAT / PAT
! tandai interface dalam & luar
R1(config)# interface g0/0
R1(config-if)# ip nat inside
R1(config)# interface g0/1
R1(config-if)# ip nat outside
! PAT (overload) — banyak host satu IP public
R1(config)# access-list 1 permit 192.168.1.0 0.0.0.255
R1(config)# ip nat inside source list 1 interface g0/1 overloadVerifikasi: show ip nat translations
DHCP (pada router)
R1(config)# ip dhcp pool LAN
R1(dhcp-config)# network 192.168.1.0 255.255.255.0
R1(dhcp-config)# default-router 192.168.1.1
R1(dhcp-config)# dns-server 8.8.8.8
R1(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.10Keamanan dasar perangkat
R1(config)# enable secret RahasiaKuat ! password privileged mode
R1(config)# service password-encryption ! enkripsi password di config
R1(config)# line vty 0 4
R1(config-line)# password VtyKuat
R1(config-line)# login
R1(config)# banner motd #Akses terbatas#Perintah show penting
| Perintah | Menampilkan |
|---|---|
show running-config | Konfigurasi aktif |
show ip interface brief | Ringkasan status interface & IP |
show ip route | Tabel routing |
show vlan brief | Daftar VLAN |
show mac address-table | Tabel MAC switch |
show ip nat translations | Translasi NAT aktif |
show interfaces | Detail & statistik interface |
Tip: ketik
?di IOS kapan saja untuk melihat opsi perintah yang tersedia.