กลับไป Net Tools
Cisco Command Reference
คำสั่งที่ใช้บ่อยใน Cisco IOS — รวม 53 คำสั่ง show, configure, troubleshoot, security พร้อมคำอธิบายภาษาไทย กดเพื่อ copy ไปใช้
Show / Verify
15#
show versionดูเวอร์ชัน IOS, model, serial, uptime
#
show running-configดู config ปัจจุบันที่ใช้อยู่
#
show startup-configดู config ที่จะใช้ตอน boot
#
show interfaces statusสถานะทุก interface แบบสรุป
#
show interface gi1/0/1รายละเอียด interface เฉพาะ
#
show vlan brieflist VLANs ทั้งหมด + ports สมาชิก
#
show ip routerouting table
#
show ip interface briefIP ของทุก interface แบบสรุป
#
show mac address-tableMAC table ของ switch
#
show cdp neighborsดู Cisco device ที่เชื่อมต่ออยู่
#
show lldp neighborsดู LLDP neighbors (cross-vendor)
#
show spanning-treeSTP topology + root bridge
#
show etherchannel summaryEtherChannel/LAG status
#
show ip arpARP table
#
show logginglog buffer ของ device
Configuration
15#
configure terminalเข้า global config mode
(config)#
hostname SW01ตั้งชื่อ device
(config)#
enable secret cisco123ตั้ง enable password (encrypted)
(config)#
service password-encryptionencrypt passwords ใน config
(config)#
interface gi1/0/1เข้า interface mode
(config-if)#
switchport mode accessตั้ง port เป็น access (single VLAN)
(config-if)#
switchport access vlan 10กำหนด VLAN ให้ access port
(config-if)#
switchport mode trunkตั้ง port เป็น trunk (multi-VLAN)
(config-if)#
switchport trunk allowed vlan 10,20,30ระบุ VLAN ที่ผ่าน trunk ได้
(config-if)#
no shutdownเปิด interface up
(config)#
vlan 10สร้าง VLAN 10
(config-vlan)#
name SALESตั้งชื่อ VLAN
(config-if)#
ip address 192.168.1.1 255.255.255.0ตั้ง IP ให้ interface
(config)#
ip route 0.0.0.0 0.0.0.0 1.1.1.1default route
#
copy running-config startup-configsave config
Troubleshoot
12#
ping 8.8.8.8ping external IP
#
ping 10.0.0.1 source gi1/0/1ping จาก source interface เฉพาะ
#
traceroute 8.8.8.8traceroute path
#
show interface gi1/0/1 statspacket statistics + errors
#
clear countersล้าง interface counters
#
debug ip packet detaildebug IP packets (ใช้ระวัง)
#
undebug allปิด debug ทั้งหมด
#
show processes cpu sortedprocess ใช้ CPU อันดับสูงสุด
#
show processes memory sortedprocess ใช้ memory อันดับสูงสุด
#
show tech-supportรวมทุก show command (สำหรับ TAC)
#
show errdisable recoveryดู ports ที่โดน err-disable
(config-if)#
shutdown / no shutdownreset interface (toggle)
Security / ACL
11(config)#
access-list 10 permit 192.168.1.0 0.0.0.255Standard ACL — anyone in subnet
(config)#
access-list 100 permit tcp any any eq 80Extended ACL — allow HTTP
(config-if)#
ip access-group 100 inapply ACL กับ interface (inbound)
(config-if)#
switchport port-securityเปิด port-security (จำกัด MAC ต่อ port)
(config-if)#
switchport port-security maximum 2จำกัด MAC ได้สูงสุด 2 ตัว
(config-if)#
switchport port-security violation shutdownถ้าเกิน → ปิด port
(config)#
username admin privilege 15 secret ciscoสร้าง user enable level 15
(config)#
line vty 0 15เข้า VTY (SSH/Telnet) line config
(config)#
transport input sshอนุญาตแค่ SSH (ปิด Telnet)
(config)#
ip ssh version 2บังคับใช้ SSH v2 เท่านั้น
(config)#
crypto key generate rsa modulus 2048สร้าง RSA key 2048-bit
💡 คำสั่งทดสอบบน Cisco IOS 15+ และ IOS-XE — บาง syntax อาจต่างกันใน NX-OS, IOS-XR