範文齋

位置:首頁 > 校園範文 > 考試

思科CCNA考試實驗常用的命令彙總

考試2.36W

路由器實驗:

思科CCNA考試實驗常用的命令彙總

router> enable 從用戶模式進入特權模式

router# disable or exit 從特權模式退出到用戶模式

router# show sessions 查看本機上的TELNET會話

router# disconnect 關閉所有的TELNET會話

router# show users 查看本機上的用戶

router# erase startupconfig 刪除NVRAM中的配置

router# reload 重啓路由器

router# config terminal 從用戶模式進入特權模式

router(config)# hostname rl 配置用戶名爲rl

router(config)# #banner welcome# 配置開機話語

router# show controllers serial0 查看串口0的物理層信息(主要是查看DTE/DCE)

router# show ip interface 查看端口的IP配置信息

router# show hosts 查看主機表

end or ctrl+z 從各種配置模式退到特權模式

rl(config)# no ip domainlookup 關閉動態域名解析

rl(config)# ip domainlookup 打開動態域名解析

rl(config)# ip nameserver 打開動態域名解析之後便可以指定DNS服務

rl(config)# interface serial 0 進入serial 0的接口配置模式

rl(configif)# no shutdown 路由器出廠默認所有端口關閉,使用此命令使它們打開

rl(configif)# encapsulation ppp 封裝ppp

rl(configif)# clockrate 64000 如果是DCE使需要設置時鐘速率,如果是DTE使不必設置

rl(configif)# bandwidth 64 設置端口帶寬爲64K

rl(configif)# ctrl+c 或者ctrl+z 快捷鍵退出到特權模式

rl# show interface serial 0 查看s0信息,如果看到serial和 line protocol都顯示up,說明鏈路兩端都設置成功 注意:如果出現serial down, line down 可能對方的端口沒有打no shutdown或者電纜沒有插好;如果出現serial up, line down 可能是DCE端沒有設置clock rate, 也可能是封裝格式不對

rl# show cdp neighbors 查看CDP鄰居信息

rl# show cdp entry *

rl(configif)# ip add 進入相應的接口,配置相應的IP地址

[!] rl# ping 使用ping命令查看鄰居的連通性

rl# show ip route 查看路由表,可以看到以C打頭的路由 信息,這是直連的路由信息;可以看到 R開頭的路由信息,是從rip學來的路由 信息;可看到以I開頭的路由信息取代 了以R開頭的路由信息,這是因爲igrp 的管理距離是100,小於rip的120

rl(configif)# router rip 啓動RIP路由協議

rl(configrouter)# network 發佈網段(注意network後面是接的網絡號而不是IP地址)

rl# show ip protocol 查看配置的路由協議

rl(config)# router igrp 300 一定要注意在IGRP後面加自治系統號,考試的時候題目會告訴你AS NUMBER, 照敲就是

rl(configrouter)# network

rl(config)# line vty0 4 進入虛擬線程配置模式,在此模式可對telnet功能進行配置

rl(configline)# login

rl(configline)# password cisco 配置telnet密碼,默認的.網絡設備 telnet的 功能是關閉的,配了密碼之後會自動打開

rl(config)# enable password cisco 配置進入enable模式的密碼, 區分大小寫

rl(config)# enable secret ciscocisco 配置進入enable模式的密碼,是加密的密碼,show run是看不見的

rl(config)# line console 0

rl(configline)# login

rl(configline)# password cisco 配置進入用戶模式的密碼

rl(configline)# logging synchronous 輸入同步

rl(configline)# exectimeout 0 0 禁止因爲一段時間沒有輸入而跳出

rl# copy runningconfig startupconfig 保存配置,考試的時候注意題目的要求,如果題目裏要求你保存配置就一定不能少了這一項

r1# copy tftp startupconfig

r1# copy runningconfig tftp

r1# copy tftp flash

交換機實驗:

switch(config)# ip address 與路由器在接口上的配置IP不同,交換機是在全局配置模式配置

switch(config)# ip defaultgateway 給交換機配置一個缺省網關,請注意,不用寫掩碼

switch(config)# vlan2 name cisco 配置一個vlan2並且指定名字叫CISCO

switch# show interfaces 查看端口狀態

switch(config)# interface e0/10 進入端口e0/10

switch(configif)# vlanmembership static 2 將端口放進vlan2裏面

switch(config)# int f0/26 進入快速以太網端口f0/26

switch(configif)# trunk on 啓用trunk,注意:只能在百兆以上端口啓用trunk

switch(configif)# notrunkvlan 51 52 在主幹上關閉VLAN51、52的傳輸