Bài viết sẽ gắng gượng tổng hợp các lệnh CCNA trong cả ICND phần 1 và 2 cũng giống kỳ thi CCNA ngày nay (640-802). Mặc dù không thể liệt kê bản kê 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 bản kê lệnh CISCO cũ hơn cũng đều 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 Chúng tôithì 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 chưa bị xa lạ khi sử dụng toàn tiếng Việt.
Những lệnh CCNA thông dụng
- Lệnh Cisco truy cập vào các chế độ
- Các phím tắt thông dụng
- Lệnh cấu hình switch CISCO
- Lệnh cấu hình router Cisco
- Các lệnh đặc quyền (Privilege Commands), lệnh show trên Router
- Lệnh copy trên router Cisco
- Lệnh debug trên router Cisco
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 phổ biến
|
Mô tả |
Phím tắt |
|
Recall Previous command (Gọi lệnh Previous) |
Mũi tên lên hoặc p |
|
Recall Next command (Gọi lệnh Next) |
Mũi tên xuống hoặc n |
|
Bắt đầu lệnh |
a |
|
Kết thúc lệnh |
e |
|
Xóa input |
d |
|
Thoát Configuration Mode |
z |
|
Làm mới output trên màn hình |
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, hoàn thành 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 vận 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: cấp 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 thi hành 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 như nó đang nằm ở phía 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ì giữ nguyên đượ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 đường truyền 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ả thứ 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 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 tất 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 để làm 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 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 mọi thứ 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 điểm 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 điểm 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ũng 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ỉ trước mắt 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ề 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 chưa đượ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ả những 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 hành 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 |
6 |
|
Suspend Telnet Session: Tạm dừng phiên telnet |
Nhấn cùng theo đó 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ờ bản địa cho thiết bị. Lệnh này chưa được thi hành 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 tin tức có í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 tình trạng 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 điểm IP. |
Switch#ping 10.1.1.1 |
|
Extended ping: Phải thực hành trong chế độ privilege. |
Switch#ping |
|
Display the interface status: Hiển thị tình trạng interface. |
Switch#show int fa0/1 |
|
Displays the vlan status and the IP address VLAN 1 (often the management vlan): Xem tình trạng VLAN 1. |
Switch#show interfaces vlan 1 |
|
Displays a list of CDP neighbours: Xem bản kê CDP. |
Switch#show cdp neighbors |
|
Extended information on the above: Xem nhiều tin tức 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 ngày nay (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 mọi thứ 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 tin tức chi tiết trên mọi thứ 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ị tình trạng 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à tình trạng của chúng |
Router#show ip ospf neighbor |
|
Xem tình trạng interface ospf. |
Router#show ip ospf interface |
|
Xem bản kê eigrp neighbor và tình trạng của chúng. |
Router#show ip eigrp neighbor |
|
Xem trạng thái interface EIGRP. |
Router#show ip eigrp interface |
|
Xem mọi thứ 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ầu | Lệnh Cisco |
|---|---|
| Lưu cấu hình hiện tại từ DRAM vào NVRAM | copy running-config startup-config |
| Hợp nhất cấu hình NVRAM vào DRAM | copy startup-config running-config |
| Sao chép cấu hình DRAM vào TFTP server | copy 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 DRAM | copy tftp runing-config |
| Sao lưu IOS lên TFTP server | copy flash tftp |
| Nâng cấp router IOS từ TFTP server | copy tftp flash |
Lệnh debug trên router Cisco
| Yêu cầu | Lệnh Cisco |
|---|---|
| Bật debug cho RIP | debug ip rip |
| Xem thông tin debug IGRP tóm lược | debug ip igrp events |
| Xem thông tin debug IGRP chi tiết | debug ip igrp transactions |
| Debug IPX RIP | debug ipx routing activity |
| Debug IPX SAP | debug IPX SAP |
| Bật debug cho CHAP hoặc PAP | debug ppp authentication |
| Tắt tất cả debug | no debug all
undebug all |
Xem thêm: CCNP_BCMSN Lab: Trunk Configuration
- Những kiến thức luôn phải có để lấy chứng thư CCNA của Cisco
- Ưu điểm và yếu điểm của WiFi 802.11ac 5GHz
- Phát hiện ra lỗ hổng đặc biệt hiểm nguy trong phần mềm hội nghị trực tuyến Cisco Jabber
- 10 lệnh cần thành thạo khi làm việc với Cisco IOS
lệnh ccna,ccna,lệnh cisco cơ bản,lệnh cấu hình router,lệnh cấu hình switch,lệnh router,lệnh switch
Nội dung Tổng hợp lệnh CCNA Cisco được tổng hợp sưu tầm biên tập bởi: Tin Học Trường Tín. Mọi ý kiến vui lòng gửi Liên Hệ cho truongtin.top để điều chỉnh. truongtin.top tks.
Bài Viết Liên Quan
Bài Viết Khác
- Địa Chỉ Cài Win Quận 3 – Cài Đặt PC Laptop Tại Nhà Q3
- Sửa Wifi Tại Nhà Quận 4
- Sửa Laptop Quận 3
- Dịch Vụ Cài Lại Windows 7,8,10 Tận Nhà Quận 4
- Dịch Vụ Cài Lại Windows 7,8,10 Tận Nhà Quận 3
- Tuyển Thợ Sửa Máy Tính – Thợ Sửa Máy In Tại Quận 4 Lương Trên 10tr
- Tuyển Thợ Sửa Máy Tính – Thợ Sửa Máy In Tại Quận 3
- Địa Chỉ Vệ Sinh Máy Tính Quận 3 – Dịch Vụ Giá Rẻ
- Pin Laptop Dell Latitude E6430 Giá Rẻ Nhất
- Top 10 Chỗ Sửa Chữa Thay Mực Máy In Epson C1700 Ở Tphcm
- Top 10 Địa Chỉ Sửa laptop bị tắt đột ngột Ở Tại Quận 5 Tphcm
- Cách bật thông báo Facebook trên Google Chrome
- Top 10 Địa Chỉ Sửa ổ cứng laptop Ở Tại Quận 8 Tphcm






