Thứ Tư, 4 tháng 12, 2019

Các lệnh troubleshoot Switch Cisco

Hôm nay mình sẽ liệt kê 1 số lệnh show trong Switch Cisco để kiểm tra cấu hình và trouble shoot mạng nhé 🙂
  1. SHOW RUN (show running-config)
7.png
Trong CLI, tập tin nằm trong bộ nhớ RAM chứa các cấu hình mà hiện tại đang được thiết bị (router, switch…) sử dụng được gọi là running-config.
Nội dung của running-config không được tự động lưu lại trên Cisco SW và sẽ bị mất nếu xảy ra sự cố về nguồn điện cung cấp cho SW (như cúp điện đột ngột, điện áp quá tải hoặc quá thấp khiến SW không thể hoạt động được…).
Sau khi ta thay đổi cấu hình cho SW, các cấu hình mới này sẽ được cập nhật vào tập tin running-config và để lưu lại nội dung của running-config thì ta cần sử dụng lệnh:
7.png
Startup-config(tập tin cấu hình dự phòng) được lưu tại NVRAM.
Startup-config dùng để backup config.( ví dụ như lỡ bạn có config sai trên SW thì còn có cách backup lại )
 2. SHOW START (show startup-config)
7.png
Show cấu hình được lưu trong NVRAM gần nhất – đây là cấu hình sẽ được SW sử dụng ở lần boot tiếp theo (nếu không lưu cấu hình hiện tại )
3.SHOW CDP NE (show cdp neighbors)
7.png
Cisco Dicovery Protocol là một giao thức dùng cho đồ của Cisco. Là một giao thức lớp 2 (Data Link Layer) cho phép ta thu nhập thông tin về thiết bị lân cận. Như
+  Hostname
+  Address list
+  Port ID
+  Platform
7.png
– CDP timer là chu kỳ gởi gói CDP tới tới tất cả cổng đang hoạt động.
– CDP holdtime là khoảng thời gian thiết bị giữ gói nhận được từ láng giềng.
Bạn có thể tắt hòan tòan giao thức CDP trong thiết bị Cisco với lệnh no cdp run. Để tắt CDP trên một cổng sử dụng câu lệnh no cdp enable trên cổng đó.
3.1 SHOW CDP NE DE (show cdp neighbors detail)
7.png
Lệnh này cực kì hữu dụng nhé 🙂  – show khá chi tiết các thiết bị Cisco “hàng xóm”
3.2 SHOW CD EN * (show cdp entry *)
Tương tự lệnh trên nhé
7.png
3.3 SH CDP TR (show cdp traffic)
7.png
3.4 SH CDP IN (show cdp interface)
7.png
3.5 No cdp en (No cdp enable)
Lệnh này dùng để tắt CDP trên 1 cổng
7
4. SH mac add (show mac address-table)
7
Lệnh này có thể giúp ta xác định MAC address kết nối tới Switch (bảng ARP) , từ đây có thể giúp ta kiểm tra IP của thiết bị cắm tới Port trong Switch với lệnh sh ip arp MACADDRESS
7.png
Các giá trị khác trong lệnh Show mac address-table các bạn có thể xem theo hình dưới:
0
4. SH ip rou (Show ip route)
Note: For SW Layer 3 or SW layer 2 support basic static routing/default routing 
0.png
4.1 SH ip rou con (Show ip route connected)
0.png
Lệnh trên chi tiết hơn lệnh sh ip route
5. Show etherchannel detail
8

TẤT CẢ CÁC LỆNH CẤU HÌNH CCNA THEO CHUYÊN MỤC

Phần 1. Routing - Định Tuyến (Các giao thức phức tạp)

OSPF.

Note: Tất cả những router có cùng area phải cấu hình giống nhau tất cả các thông số thì khu vực đó mới hoạt động đúng chức năng được.

1. Cấu hình cơ bản

Router(config)#router ospf process ID
Router(config-router)#network Network_number Wildcard_mask area_ID

2. Cấu hình priority ở các interface để bầu DR và BDR 

Priority càng lớn thì khả năng được bầu làm DR càng cao, ngược với bầu Root brige của Switch, càng nhỏ thì lại càng được bầu. 

Router(config)#interface fastethernet 0/0
Router(config-int)#ip ospf priority 55

Sau khi cấu hình xong priority có thể kiểm tra bằng lệnh.

Router# show ip ospf interface f0/0

3. Chỉnh sửa lại OSPF cost metric trong mỗi interface

Cost càng nhỏ thì tuyến đó càng được coi là best path

Router(config-int)#ip ospf cost 1

4.Cấu hình OSPF Authentication ở các interface và áp dùng vào router

Authentication key được hiểu như là password để các router trong cùng một vùng chia sẻ với nhau.

a.Cấu hình authentication đơn giản

Router(config-if)#ip ospf authentication-key password
Router(config-router)#area area number authentication

b.Cấu hình authentication theo dạng mã hoá, bảo mật cao.

Router(config-if)ip ospf message-digest-key key ID md5 encryption-type key
Router(config-router)#area area ID authentication message-digest

5.Cấu hình OSPF timer trong các interface

Router(config-if)ip ospf hello-interval timer
Router(config-if)ip ospf dead-interval timer

6.Cấu hình quảng bá một tuyến mặc định trong OSPF

Router(config-router)#default-information originate

7.Quảng bà một tuyến khác (không phải là default)

Router(config-router)#redistribute protocols subnets

8.Các lệnh show dùng để kiểm tra cấu hình OSPF

show ip protocol
show ip route
show ip ospf
show ip ospf interface
show ip ospf database
show ip ospf neighbor detail
clear ip route *
debug ip ospf events
debug ip ospf adj

EIGRP

1.Cấu hình cơ bản.

Router(config)#router eigrp autonomous number
Router(config-router)#network network number
Router(config-router)#eigpr log-neighbor-changes (Không có cũng được)
Router(config-router)#no auto-summary

2.Thay đổi băng thông và tự tổng hợp tuyến trong interface

Router(config-if)#bandwidth kilobits
Router(config-if)#ip summary-address protocol AS network number subnets mask

3.Cân bằng tải trong EIGRP

Router(config-router)#variance number

4.Quảng bá default route

Cách 1: 
Router(config)#ip route 0.0.0.0 0.0.0.0 [interface/nexthop]
Router(config)#redistribute static

Cách 2: 
Router(config)#ip default-network network number

Cách 3:
Router(config-if)#ip summary-network eigrp AS number 0.0.0.0 0.0.0.0

5.Quảng bá các tuyến khác trong EIGRP (không phải là default)

Router(config-router)#redistribute protocol process ID metrics k1 k2 k3 k4 k5
Ex: Router(config-router)#redistribute ospf metrics 100 100 100 100 100

6.Chia sẻ traffic trong EIGRP

Router(config-router)#traffic share {balanced/min}

7.Các lệnh kiểm tra cấu hình EIGRP

show ip eigrp neighbor
show ip eigrp interface
show ip eigrp topology
show ip eigrp traffic
debug eigrp fsm
debug eigrp packet

Phần 2. Switching - Chuyển mạch

1.Cấu hình cơ bản chung cho một Switch

Reset tất cả cấu hình của Switch và reload lại.

Switch#delete flash:vlan.dat
Switch#erase startup-config
Switch#reload

2.Cấu hình về Security và management

Switch(config)#hostname tên switch
Switch(config)#line console 0
Switch(config-line)#password mật khẩu
Switch(config-line)#login

Switch(config)#line vty 0 4
Switch(config-line)#pass mật khẩu
Switch(config-line)#login

3.Thiết lập địa chỉ IP và default gateway cho Switch

Switch(config)#interface vlan1
Switch(config-int)#ip address địa chỉ subnetmask
Switch(config)#ip default-gateway địa chỉ 

4.Thiết lập tốc độ và duplex của cổng

Switch(config-int)#speed tốc độ
Switch(config-int)#duplex full

5.Thiết lập dịch vụ HTTP và cổng

Switch(config)#ip http server
Switch(config)#ip http port 80

6.Thiết lập, quản lý địa chỉ MAC

Switch(config)#mac-address-table static địa chỉ MAC interface fastethernet số vlan
Switch#show mac-address-table
Switch#clear mac-address-table

7.Cấu hình bảo mật cho cổng

Switch(config-if)#switchport mode acess
Switch(config-if)#switchport port-security

Cấu hình Static: Switch(config-if)#switchport port-security mac-address địa chỉ Mac

Cấu hình Sticky: Switch(config-if)#switchport port-security mac-address sticky (thông dụng nhất)

Switch(config-if)#switchport port-security maximum value
Switch(config-if)#switchport port-security violation shutdown

8.Tạo Vlan

Cách 1.

Switch#vlan database
Switch(vlan)#vlan number

Cách 2. Khi gán các cổng vào vlan, dù vlan chưa tồn tại nhưng Switch vẫn tự tạo.

Switch(config)#interface fastethernet 0/0
Switch(config-int)#switchport access vlan vlan-id

Muốn xoá vlan ta làm như sau:

Switch(config-if)#no switchport access vlan vlan-id
Switch#clear vlan vlan_number (xoá toàn bộ vlan )

9.Gán nhiều cổng vào trong vlan cùng một lúc, cấu hình Range

Đối với dãy cổng không liên tục.
Switch(config)#interface range cổng 1 , cổng 2 , cổng 3

Đối với một dãy liên tục.
Switch(config)#interface range cổng 1-n
Switch(config-range)#switchport access vlan vlan-id


Ví dụ:
Switch(config)#interface range f0/0 , f0/2 , f0/4
Switch(config)#interface range f0/0-10 
Switch(config-range)#switchport access vlan 10 

10.Cấu hình Trunk

Switch(config-if)#switchport mode trunk
Switch(config-if)#switchpor trunk encapsulation encapsulation-type
Switch#show trunk

11.Cấu hình VTP

Switch#vlan database
Switch(vlan)#vtp v2-mode
Switch(vlan)#vtp domain tên domain
Switch(vlan)#vtp {server/client/transperant}
Switch(vlan)#vtp password password (Tạo pass cho domain)
Switch#show vtp status

12.Cấu hình Inter-Vlan trên Router

Router(config)#interface fastethernet 0/0.1
Router(config-subif)#encapsulation type
Router(config-subif)#ip address địa chỉ subnetmask

Tổng hợp lệnh CCNA Cisco

Bài viết sẽ cố gắng tổng hợp các lệnh CCNA trong cả ICND phần 1 và 2 cũng như kỳ thi CCNA hiện tại (640-802). Mặc dù không thể liệt kê danh sách lệnh IOS đầy đủ, nhưng bao gồm phần lớn các lệnh sẽ xuất hiện trong bài thi CCNA. Những danh sách lệnh CISCO cũ hơn có thể chứa các lệnh bổ sung, chẳng hạn như IPX, không còn xuất hiện trong kỳ thi CCNA.
Nếu các bạn theo dõi các bài Cisco Lab của Quantrimang.com thì sẽ thấy chúng đều bằng tiếng Anh, vì vậy bảng lệnh dưới đây mình sẽ "chơi" kiểu song ngữ, "nửa nạc nửa mỡ" để các bạn hiểu mà vẫn không bị lạ lẫm khi dùng toàn tiếng Việt.

Lệnh Cisco truy cập vào các chế độ

Mô tả
Lệnh
User mode (chế độ user)
Switch>
Enter Privilege mode (vào chế độ đặc quyền)
Switch>enable
Privileged mode (chế độ đặc quyền)
Switch#
Enter configuration mode (vào chế độ cấu hình)
Switch#configure terminal
Global Config mode
Switch(config)#
Vào Interface mode
Switch(config)#interface fa0/1
Interface mode
Switch(config-if)
Return to global configuration (Trở về Global Config)
Switch(config-if)exit
Exit Global Config mode (Thoát Global Config)
Switch(config)#exit
Return to user mode (Trở về user mode)
Switch#disable
Logout (Đăng xuất)
Switch>exit

Các phím tắt thông dụng

Mô tả
Phím tắt
Recall Previous command (Gọi lệnh Previous)
Mũi tên lên hoặc <Ctrl> p
Recall Next command (Gọi lệnh Next)
Mũi tên xuống hoặc <Ctrl> n
Bắt đầu lệnh
<Ctrl> a
Kết thúc lệnh
<Ctrl> e
Xóa input
<Ctrl> d
Thoát Configuration Mode
<Ctrl> z
Làm mới output trên màn hình
<Ctrl> R
Hoàn thành lệnh
TAB

Lệnh cấu hình switch CISCO

Mô tả
Lệnh
Configure device system name (Cấu hình tên thiết bị)
Switch(config)#hostname sw1
Sets the encrypted enable password (Thiết lập mật khẩu mã hóa)
Switch(config)#enable secret cisco
Sets the unencrypted enable password (Đặt mật khẩu không mã hóa)
Switch(config)#enable password cisco
Enable password encryption on all clear text password within the configuration file (mã hóa tất cả các mật khẩu trong file cấu hình)
Switch(config)#service password-encryption
Configure a Message Of The Banner, with an ending character of $ (cài thông báo cho banner, kết thúc bằng $)
Switch(config)#banner motd $
Assign IP address to vlan (gán ip cho vlan)
Switch(config)#int vlan 1
Switch(config-if)#ip addr 172.22.1.11
255.255.255.0
Assign Default gateway, note the mode: gán default gateway.
Switch(config)#ip default-gateway 10.1.1.1
Select one interface: chọn 1 interface.
Switch(config)#int fa0/1
Select a range of interfaces (version dependant): chọn 1 dải interface.
Switch(config)#int range fa0/1 – 12
Set the interface description: Viết mô tả cho interface.
Switch(config-if)#description
Add vlan using config mode: thêm vlan sử dụng config mode.
switch(config)#vlan 11 switch(config-vlan)#name test
Configure Interface fa0/1 @ speed 100 Mbps and full duplex: Cấu hình int fa0/1 tốc độ 100Mbps và full duplex.
Switch(config-if)#speed 100 Switch(config-if)#duplex full
Assign interface to vlan: gán int cho vlan.
switch(config-if)#switchport access vlan 11
Enable Port Security: Bật bảo mật port.
Switch(config-if)#switchport mode access Switch(config-if)#switchport port-security Switch(config-if)#switchport port-security mac-address sticky
Disable Interface: tắt int
Switch(config-if)shutdown
Enable Interface: cho phép int hoạt động.
Switch(config-if)no shutdown
Configures 5 Telnet sessions each with a password of ‘cisco’: cho phép 5 phiên Telnet một lúc, mật khẩu là cisco.
Switch(config)#line vty 0 4
Switch(config-line)#login
Switch(config-line)#password cisco
Enable and define console password of ‘cisco’: Kích hoạt và đặt mật khẩu cho console là cisco.
Switch(config)#line con 0
Switch(config-line)#login
Switch(config-line)#password cisco
Synchronise console messages (keep what you have typing on the screen): Đồng bộ thông báo console, giữ những gì bạn đã gõ trên màn hình.
Switch(config-line)#logging synchronous
Set the timezone and automatically adjust: Thiết lập timezone và tự động thay đổi.
Switch(config)#clock timezone gmt 0 Switch(config)#clock summer-time gmt recurring
Sets the switch priority for the vlan: Thiết lập priority cho vlan.
Switch(config)#spanning-tree vlan 1 priority 4096
Enables portfast: Kích hoạt portfast.
Switch(config)#int fa0/1
Switch(config-if)#spanning-tree portfast
Enables RSTP: Bật RSTP, có tùy chọn khác là PVST và MST.
Switch(config)#spanning-tree mode rapid-pvst
Creates a vlan: Tạo vlan. Lệnh này được thực hiện trong config mode, không phải trong vlan database và lệnh int vlan không tạo vlan.
Switch(config)#vlan 2 Switch(config-vlan)#name sales
Assign an interface to vlan 2: Gán int cho vlan 2.
Switch(config-if)#switchport access vlan 2
Buộc int là trunk vô điều kiện. Có thể chọn chế độ khác là access và dynamic.
Switch(config-if)#switchport mode trunk
Gán thủ công switch vào miền VTP. Switch tự động trở thành 1 phần của miền VTP nếu nó đang trong miền "null" và nhận VTP frame.
Switch(config)#vtp domain lab
Thay đổi VTP mode từ chế độ mặc định là server sang client. Trong client mode thì không thay đổi được nữa.
Switch(config)#vtp mode client

Lệnh cấu hình router Cisco

Set a console password to cisco: Đặt mật khẩu console là Cisco.Router(config)#line con 0
Router(config-line)#login
Router(config-line)#password cisco
Set a telnet password: Đặt mật khẩu telnet.Router(config)#line vty 0 4
Router(config-line)#login
Router(config-line)#password cisco
Stop console timing out: Console không bị log off.Router(config)#line con 0
Router(config-line)#exec-timeout 0 0
Set the enable password to cisco: Đặt mật khẩu enable là cisco.Router(config)#enable password cisco
Set the enable secret password to peter:
Đặt mật khẩu secret là peter. Mật khẩu này ghi đè lên mật khẩu enable và được mã hóa trong file cấu hình.
Router(config)#enable secret peter
Enable an interface: Bật interface.Router(config-if)#no shutdown
To disable an interface: Tắt interface.Router(config-if)#shutdown
Set the clock rate for a router with a DCE cable to 64K: Đặt clock rate cho router với cáp DCE là 64000.Router(config-if)clock rate 64000
Set a logical bandwidth assignment of 64K to the serial interface: Gán băng thông logic cho serial interface. Router(config-if)bandwidth 64
To add an IP address to a interface: Thêm IP cho interface.Router(config-if)#ip addr 10.1.1.1 255.255.255.0
To enable RIP on all 172.16.x.y interfaces: Bật RIP trên tất cả interface 172.16.x.y.Router(config)#router rip
Router(config-router)#network 172.16.0.0
Disable RIP: Tắt RIP.Router(config)#no router rip
To enable IRGP with a AS of 200, to all interfaces: Bật IRGP với AS 200 cho tất cả interface.Router(config)#router igrp 200
Router(config-router)#network 172.16.0.0
Disable IGRP: Tắt IGRP.Router(config)#no router igrp 200
Định tuyến tĩnh remote network là 172.16.1.0, với mask là 255.255.255.0, next hop là 172.16.2.1, với cost là 5 hop.Router(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1 5
Disable CDP for the whole router: Tắt CDP cho cả router.Router(config)#no cdp run
Enable CDP for the whole router: Bật CDP cho cả router.Router(config)#cdp run
Disable CDP on an interface: Tắt CDP trên interface.Router(config-if)#no cdp enable
Enable the http server to SDM can be used: Bật http server để dùng SDM.
Router(config)#ip http server
Defines a username and password: Đặt username (sue) và mật khẩu (cisco). Có thể dùng để xác thực PPP hoặc truy cập của người dùng.
Router(config)#username sue password cisco
Xác định file local host trong unix, kiểu như:
/etc/hosts in unix
Router(config)#ip host mypc 10.1.1.3
Vô hiệu hóa Disables DNS lookup. Hữu ích khi lệnh bị gõ lỗi.
Router(config)#no ip domain-lookup
Thiết lập băng thông logic (không phải vật lý) cho interface. Thường được sử dụng bởi các giao thức định tuyến, truy vấn SNMP.
Router(config)#int s0
Router(config-if)#bandwidth
Thiết lập physical clock
Router(config-if)#clock rate 64000
Set the serial interface WAN encapsulation: Ngoài hdlc còn có tùy chọn khác là PPP và frame-relay.
Router(config-if)#encapsulation hdlc
Authentication on PPP is optional: Xác thực trên PPP là tùy chọn. Lệnh này bật chap trên interface, tùy chọn khác là PAP.
Router(config-if)#ppp authentication chap
Chọn kiểu LMI. Nếu kiểu LMI không được cấu hình đúng nó sẽ được phát hiện tự động.
Router(config-if)#frame-relay lmi-type cisco
Định tuyến tĩnh. Kiểu định tuyến tĩnh có Administrative Distance (AD) là 1, do đó nó sẽ ghi đè lên bất kỳ định tuyến động nào.
Router(config)#ip route 50.0.0.0 255.0.0.0
10.1.2.1
Enables RIP version 1 on all LOCAL interfaces which have a 10.x.x.x address: Bật RIP v1 trên tất cả LOCAL interfaces có địa chỉ la 10.x.x.x.

Enables RIP version 2: Bật RIP v2
Router(config)#router rip
Router(config-router)#network 10.0.0.0


Router(config-router)#version 2
Enable the router to provide a DHCP service: Thiết lập DHCP trên router.
Router(config)#ip dhcp pool MYPOOL
Router(dhcp-config)#network 10.1.1.0 255.255.255.0
Router(dhcp-config)#default-router 10.1.1.1 Router(dhcp-config)#exit
Router(config)#ip dhcp excluded-address 10.1.1.1 10.1.1.99
Thiết lập config register: Chỉ định việc router sẽ làm khi nó khởi động.
Router(config)#config-register 0x2102
Tạo sub logic interface dưới physical interface.

Kích hoạt 802.1q trunking trên interface.

Đặt địa chỉ IP.
Router(config)#int fa0/0.1


Router(config-subif)#encapsulation dot1Q 1


Router(config-subif)#ip address 10.1.1.1
255.255.255.0
Bật OSPF trên bất kỳ local interface nào bắt đầu bằng địa chỉ IP 10.1.x.x.
Router(config-)#router ospf 1
Router(config-router)#network 10.1.0.0
0.0.255.255 area 0
EIGRP có thể cấu hình giống với RIP hoặc sử dụng tùy chọn mask.
Router(config)#router eigrp 1
Router(config-router)#network 172.16.0.0 Or
Router(config-router)#network 172.16.2.0
0.0.0.255
Thiết lập chuẩn ACL. Chuẩn này sử dụng số từ 1 đến 99.
Router(config)#access-list 1 permit
172.16.1.1
Thiết lập Extended ACL. Địa chỉ đầu tiên là địa chỉ IP nguồn.
Router(config)#access-list 101 deny tcp host
172.16.1.1 host 172.16.2.1 eq telnet Router(config)#access-list 101 permit ip any any
Use the group command to attach an ACL to an interface: Sử dụng lệnh group để gắn ACL vào interface.
Router(config)#interface fa0/0
Router(config-if)#ip access-group 1 out
Ví dụ về sử dụng tên ACL thay vì số.
Router(config)#ip access-list extended my_list
Router(config-ext-nacl)# deny tcp host
172.16.1.1 host 172.16.2.1 eq ftp
Router(config-ext-nacl)# permit ip any any
Gán ACL cho interface bằng tên.
Router(config)#int fa0/0
Router(config-if)#ip access-group my_list in
Configuring a static NAT to allow a server to be access via the Internet, using the IP address on interface s0/0/1: Cấu hình NAT tĩnh để cho phép truy cập server qua Internet, sử dụng địa chỉ IP trên interface s0/0/1.
Router(config)#ip nat inside source static
10.1.1.2 interface s0/0/1
Defining interface which NAT takes place between: Xác định interface mà NAT xảy ra.
Router(config)#int fa0/0.1
Router(config-if)#ip nat inside
Enables RIPng: Bật RIPng
Router(config)#ipv6 unicast-routing
Router(config)#ipv6 router rip ccna
Router(config)#int s0/0/0
Router(config-if)#ipv6 rip ccna enable
Các lệnh đặc quyền (Privilege Commands) trên Switch
Mô tả
Lệnh
Bật hộp thoại setup tự động khi thiết bị khởi động mà không có cấu hình.
Switch#setup
Displays the config held in DRAM. Which is lost if not copy run start command is not used: Hiển thị cấu hình lưu trong DRAM. Cấu hình này bị mất khi lệnh not copy run start không được sử dụng.
Switch#show running-config
Displays the NVRAM (None volatile) config: Hiển thị cấu hình NVRAM.
Switch#show startup-config
Saves the config: Lưu cấu hình, nếu không có lệnh này tất cả các thay đổi, cấu hình sẽ bị mất.
Switch#copy running-config startup-config
Saves the running config to a TFTP server: Lưu cấu hình đang chạy vào TFTP server.
Switch#copy running-config tftp
Copies IOS files to a TFTP server: Sao chép file IOS vào TFTP server.
Switch#copy flash tftp
Copies files from a TFTP server the device flash: Copy file từ TFTP vào thiết bị flash.
Switch#copy tftp flash
Erase the config held in NVRAM: Xóa cấu hình lưu trong VNRAM. Nếu thực hiện lệnh này kèm với reload thì tất cả cấu hình sẽ bị mất.
Switch#erase startup-config
Reboots the device: Khởi động lại switch.
Switch#reload
Abort sequence: Hủy một lệnh, thủ tục
<Shift> <Ctrl> 6
Suspend Telnet Session: Tạm dừng phiên telnet
Nhấn cùng lúc <Shift> <Ctrl> 6, thả hết các phím ra và nhấn ngay x
Show the current sessions: Xem phiên hiện tại, phiên nào có * là phiên hiện hoạt.
Switch#show sessions
Forcible closes a telnet session: Buộc đóng một phiên telnet.
Switch#disconnect
Set the device local clock: Thiết lập giờ địa phương cho thiết bị. Lệnh này không được thực hiện trong chế độ cấu hình.
Switch#clock set 10:00:00 april 2 2008
Display the IOS version along with other useful info: Xem phiên bản IOS và các thông tin hữu ích khác như uptime hệ thống, cấu hình register...
Switch#show version
Xem nội dung file của flash.
Switch#show flash
Xem giờ.
Switch#show clock
Xem user hiện đang đăng nhập.
Switch#show users
By default displays the last 10 commands: Xem 10 lệnh vừa dùng.
Switch#show history
Displays the ARP cache: Xem cache ARP.
Switch#show arp
Displays the spanning tree status on vlan 1: Xem trạng thái spanning tree trên vlan 1.
Switch#show spanning-tree vlan 1
Lists all the configured vlans: Liệt kê tất cả vlan đã cấu hình.
Switch#show vlan
Displays VTP info such as VTP mode, VTP domain, VTP counter: Xem thông tin VTP như chế độ, miền, bộ đếm.
Switch#sh vtp status
Ping selected address: Ping một địa chỉ IP.
Switch#ping 10.1.1.1
Extended ping: Phải thực hiện trong chế độ privilege.
Switch#ping
Display the interface status: Hiển thị trạng thái interface.
Switch#show int fa0/1
Displays the vlan status and the IP address VLAN 1 (often the management vlan): Xem trạng thái VLAN 1.
Switch#show interfaces vlan 1
Displays a list of CDP neighbours: Xem danh sách CDP.
Switch#show cdp neighbors
Extended information on the above: Xem nhiều thông tin hơn lệnh trên.
Switch#show cdp neighbors details
Display CDP packets as they arrive: Xem các gói CDP khi chúng đến.
Switch#debug cdp packets
Display ping packets as they arrive: Hiển thị các gói ping khi chúng đến.
Switch#debug icmp packets
Display switch MAC Addresses table. These entries are learnt from the source mac address in the Ethernet frames: Xem bảng địa chỉ MAC, lấy từ địa chỉ MAC nguồn trong Ethernet frame.
Switch#show mac address-table

Các lệnh đặc quyền (Privilege Commands), lệnh show trên Router

Yêu cầu
Lệnh Cisco
Vào chế độ đặc quyền
enable
Trở về user mode từ privileged
disable
Thoát router
logout/exit/quit
Xem phiên bản router
Router#show version
Xem cấu hình hiện tại (DRAM)
Router#show running-config
Xem cấu hình startup (NVRAM)
Router#show startup-config
Xem dung lượng file IOS, flash
Router#show flash
Xem tất cả log router ghi lại.
Router#show log
Xem trạng thái interface của interface e0
Router#show interface e0
Displays the interface operational status and IP addresses for all router interfaces: Xem trạng thái hoạt động của interface và địa chỉ IP cho tất cả các interface router.
Router#show ip interface brief
Xem kiểu cáp trên s0
Router#show controllers 0
Xem các thiết bị cdp đã kết nối
Router#show cdp neighbor
Xem thông tin chi tiết trên tất cả các thiết bị
Router#show cdp entry *
Displays all the configured routing protocols: Xem tất cả các giao thức định tuyến đã được cấu hình.
Router#show ip protocols
Displays the IP routeing table: Hiển thị bảng định tuyến IP.
Router#show ip route
Hiển thị access list
Router#show access-lists
Xem router nào thấy được switch ISDN

Router#show isdn status
Displays the NAT translations: Xem các NET translation.
Router#show ip nat translations
Xem cấu hình cáp vật lý:
DTE/DCE, x.21, V.35,
RS232
Router#show controllers s 0
Displays the end-to-end status: Hiển thị trạng thái end-to-end
Router#show frame-relay pvc
Displays the type of LMI and the number LMI frames: Xem kiểu LMI và số khung LMI.
Router#show frame-relay lmi
Displays the frame relay inverse ARP table: Hiện thị bảng frame relay inverse ARP.
Router#show frame-relay map
Xem danh sách ospf neighbor và trạng thái của chúng
Router#show ip ospf neighbor
Xem trạng thái interface ospf.
Router#show ip ospf interface
Xem danh sách eigrp neighbor và trạng thái của chúng.
Router#show ip eigrp neighbor
Xem trạng thái interface EIGRP.
Router#show ip eigrp interface
Xem tất cả trunk port trên thiết bị
Router#show interface trunk
ping IPv6
Router#ping 2000:1000:500:3::1

Lệnh copy trên router Cisco

Yêu cầuLệnh Cisco
Lưu cấu hình hiện tại từ DRAM vào NVRAMcopy running-config startup-config
Hợp nhất cấu hình NVRAM vào DRAMcopy startup-config running-config
Sao chép cấu hình DRAM vào TFTP servercopy runing-config tftp
Hợp nhất cấu hình TFTP với cấu hình router hiện tại lưu trên DRAMcopy tftp runing-config
Sao lưu IOS lên TFTP servercopy flash tftp
Nâng cấp router IOS từ TFTP servercopy tftp flash

Lệnh debug trên router Cisco

Yêu cầuLệnh Cisco
Bật debug cho RIPdebug ip rip
Xem thông tin debug IGRP tóm tắtdebug ip igrp events
Xem thông tin debug IGRP chi tiếtdebug ip igrp transactions
Debug IPX RIPdebug ipx routing activity
Debug IPX SAPdebug IPX SAP
Bật debug cho CHAP hoặc PAPdebug ppp authentication
Tắt tất cả debugno debug all
undebug all