Cisco CLI 快捷键

  • 快捷键 ↑显示history buffer输入最近的一条命令
  • 快捷键 ↓显示由↑调出的在history buffer中的下一条命令
  • Ctrl + P 同↑
  • Ctrl + N 同 ↓
  • Ctrl + A 输入符移动至行首
  • Tab 补全部分输入的命令项
  • Backspace 初除先标左边的字符
  • Ctrl + D 初除先标所在的字符
  • Ctrl + K 初除从先标到命令行尾的所有字符
  • Esc D 初除从先标到词尾的所有字符
  • Ctrl + U 或 Ctrl + X 初除从先标到命令行首的所有字符
  • Ctrl + W 初除先标左边的单字
  • Ctrl + A 将先标移至行首
  • 左键 或 Ctrl + B 将先标左移一个字符
  • Esc F 将先标左移一个单词
  • 右键 或 Ctrl + F 将先标右移一个字符
  • Ctrl + E 将先标移至行尾
  • 向上箭头 或 Ctrl + P 调出历史记录缓冲区的命令,从最近输入的命令开始
  • Ctrl-R, Ctrl-I, 或Ctrl + L 收到控制台命令后重新显示系统提示符和命令行
  • Ctrl + C 在任何配置模式下,结束该配置模式并返回特权执行模式。在设置模式下,放弃并返回命令提示符
  • Ctrl + Z 处于任何配置模式下,结束配置模式返回到特权EXEC模式
  • Ctrl + Shift + 6 全能终止命令序列。用于终止DNS lookups, traceroutes, ping命令
  • Ctrl + H 删除光标左侧的一个字符

英文版

  • Ctrl + P Previous Command
  • Ctrl + U Clear Line and Put in Buffer
  • Ctrl + W Delete Word Backwards and Put in Buffer
  • Ctrl + Y Paste Buffer Contents
  • Ctrl + E End Line
  • Ctrl + A Beginning Line
  • Ctrl + X Clear Line to the Left and Put in Buffer
  • Ctrl + T Flip Last 2 Characters
  • Ctrl + F Forward Character
  • Ctrl + B Backward Character
  • Ctrl + J Return
  • Ctrl + L Refresh Line
  • Ctrl + I Refresh Line and Goto End
  • Ctrl + K Delete everything on the Right of cursor
  • Ctrl + V Allows to type control character
  • Ctrl + M Return
  • Ctrl + H Backspace Character to the Left
  • Ctrl + R Refresh Line
  • Ctrl + D Delete Character to the Right
  • Ctrl + C Clear line
  • Ctrl + N Next Command

路由器实验:

  • router> enable 从用户模式进入特权模式
  • router# disable or exit     从特权模式退出到用户模式
  • router# show sessions      查看本机上的TELNET会话
  • router# show interface gigabitethernet 0/0
  • router# disconnect       关闭所有的TELNET会话
  • router# show users       查看本机上的用户
  • router# erase startup-config  删除NVRAM中的配置
  • router# reload         重启路由器 
  • router# config terminal    从用户模式进入特权模式
  • router# copy running-config startup-config 保存配置,考试的时候注意题目的要求,如果题目里要求你保存配置就一定不能少了这一项 
  • router# copy tftp startup-config 将tftp保存到本地
  • router# copy running-config tftp 将本地的保存到tftp
  • router# copy tftp flash
  • router# show controllers serial0 查看串口0的物理层信息,主要是查看DTE/DCE 
  • router# show ip interface   查看端口的IP配置信息
  • router# show ip interface brief
  • router# show ipv6 interface brief
  • router# show ip route 显示路由表信息
  • router# sh ip nat tra 显示NAT转换表
  • router# clear ip nat tra * 删除NAT转换表,不太好使
  • router(config-if)#no ip nat out/in 删除NAT转换表,不太好使
  • router# show interface serial 0/0/0 查看具体端口的信息
  • router# show hosts      查看主机表 
  • router# show interface serial 0   查看s0信息,如果看到serial和line protocol都显示up,说明链路两端都设置成功
  • 注意:如果出现serial down, line down 可能对方的端口没有打开;no shutdown 或者电缆没有插好;如果出现serial up, line down 可能是DCE端没有设置clock rate, 也可能是封装格式不对。
  • router# show cdp neighbors          查看CDP邻居信息
  • router# ping 10.0.0.2            使用ping命令查看邻居的连通性 
  • router# show ip route       查看路由表,可以看到以C打头的路由信息,这是直连的路由信息;可以看到R开头的路由信息,是从rip学来的路由信息;可看到以I开头的路由信息取代了以R开头的路由信息,这是因为igrp的管理距离是100,小于rip的120
  • router# show ip protocol      查看配置的路由协议
  • router# ipv6config /all 查看IPv6的信息
  • router# copy tftp running-config 从 TFTP 服务器传输配置
  • router(config)# router igrp 300  一定要注意在IGRP后面加自治系统号,考试的时候题目会告诉你AS NUMBER,照敲就是    
  • router(config)# enable password cisco 配置进入enable模式的密码,区分大小写  
  • router(config)# enable secret cisco 配置进入enable模式的密码,是加密的密码,show run是看不见的  
  • router(config)# security passwords min-length 10 以后新设置的密码的最小长度是10


  • router(config-router)# network 10.0.0.0发布网段。注意network后面是接的网络号,而不是IP地址

  • router(config-router)# network 10.0.0.0 

Normal Config

  • router# conf t
  • router(config)# h rl 配置用户名为rl
  • router(config)# se p 密码加密显示
  • router(config)# ba m “fsdfdsf” 配置开机话语
  • router(config)# ba m #fsdfdsf# 配置开机话语
  • router(config)# no ip domain-lookup 关闭动态域名解析 
  • router(config)# ip domain-lookup  打开动态域名解析
  • router(config)# ip name-server 202.106.0.20 打开动态域名解析之后便可以指定DNS服务
  • router(config)# ip domain-n RTA.com 设置域名,SSH会用到

Route Table

  • router(config)# ip route 192.168.100.0 255.255.255.224 GigabitEthernet 0/0 配置直接路由
  • router(config)# ip route 192.168.0.0 255.255.255.0 192.168.1.1 添加间接路由表

Line Config

  • router(config)# line console 0
  • router(config)# line vty 0 4 进入虚拟线程配置模式,在这个模式里可对telnet功能进行配置,默认vty只开了0到4,可以用sh r查看, 也可以只对vty 0进行配置
  • router(config-line)# password cisco 配置telnet密码,默认的网络设备telnet的功能是关闭的,配了密码之后会自动打开 
  • router(config-line)# logging synchronous 输入同步  
  • router(config-line)# exec-timeout 0 0 禁止因为一段时间没有输入而跳出
  • router(config-line)# login console口默认没有login,要这句话,vty默认打开,不用,但最好看一下 sh r

IPv4 Interface Config & Interface Normal Config

  • F G S 端口是不用设置密码的
  • router(config)# int v 1
  • router(config-if)# ip add 10.0.0.1 255.0.0.0 进入相应的接口,配置相应的IP地址 
  • router(config-if)# no ip add 192.168.16.16 清楚指定端口的IP地址
  • router(config-if)# description LAN connection to S1 为每个接口配置描述,以帮助记录网络信息。 配置接口描述,以指明其连接的设备 在show interface中查看
  • router(config-if)# no shu 这个一定要加,路由器出厂默认所有端口关闭,使用此命令使它们打开
  • 只有一台设备能够访问快速以太网端口 0/1 和 0/2
  • router(config-if)# encapsulation ppp 封装pp 
  • router(config-if)# clockrate 64000 如果是DCE使需要设置时钟速率 如果是DTE就不必设置
  • router(config-if)# bandwidth 64 设置端口带宽为64K      
  • router(config-if)# router rip 启动RIP路由协议

IPv6 Interface Config

  • router(config)# in v 1
  • router(config-if)# ipv6 address 2001:DB8:1:1::1/64 配置IPv6地址
  • router(config-if)# ipv6 address FE80::1 link-local 配置本地链路 IPv6 地址,对于Host来说就是网关,在no shutdown 之前和之后配置都可以
  • router(config-if)# no shu
  • router(config)# ipv6 unicast-routing 使路由器转发ipv6报文

Telnet Config

  • 第一次必须通过Console来配置,配置好Telnet后通过网线来配置
  • S1(config)# line vty 0 4 配置0到4,也可以只配置0
  • S1(config-line)# pas cisco 默认的网络设备telnet的功能是关闭的,配了密码之后会自动打开
  • S1(config-line)# login

SSH V5.1 English Version 11.2.4.5 Packet Tracer - Configuring Secure Passwords and SSH

  • SHH through vty
  • router(config)# ip domain-name RTA.com Set the domain name to RTA.com (case-sensitive for scoring in PT)
  • router(config)# cr k g r Generate 1024-bit RSA keys.
  • router(config)# u any_user password any_pa Create a user of your choosing with a strong password
  • router(config)# u netadmin privilege 15 pa Cisco_CCNA5 管理员权限
  • router(config)# no username netadmin 删除用户
  • router(config)# login block-for 180 attempts 4 within 120 Block anyone for three minutes who fails to log in after four attempts within a two-minute period.
  • router(config)# li vty 0 4 Configure the VTY lines for SSH access and use the local user profiles for authentication.
  • router(config-line)# t i s | transport input ssh
  • router(config-line)# login l | login local 到这里就已经完整配置好SSH了,下面删除密码没有要求就不用进行
  • router(config-line)# no password 删除vty现有密码
  • PC> ssh -l administrator 10.10.10.2 在PC上登陆
  • PC> telnet 10.10.10.2 这里输入的是VLAN 1的IP地址

loopback

  • router(config)# int loopback ? 查看有多少loopback端口
  • router(config)# int loopback 1
  • router(config)# do show ip in b

路由器初始化

  • router# erase startup-config
  • router# reload

交换机初始化

  • switch# delete vlan.dat
  • switch# erase startup-config
  • switch# reload

配置路由器子接口 单臂路由器,路由VLAN CCNA2 5.1.3.6

  • 单臂时,交换机那端的接口要设置程trunk
  • 双臂传统路由,一个交换机上的两个端口都设置为access
  • router(config)# in g0/0.10 这里的子接口号自定义,最好和vlan的号码相同
  • router(config-subif)# encapsulation dot1Q 10 使之在特定的VLAN上运行
  • router(config-subif)# ip address 172.17.10.1 255.255.255.0
  • router(config-subif)# no shu
  • router(config-subif)# in g0/0.30
  • router(config-subif)# encapsulation dot1Q 30
  • router(config-subif)# ip add 172.17.30.1 255.255.255.0
  • router(config-subif)# no shu
  • router(config-subif)# in g0/0
  • router(config-subif)# no shu 子接口up以后,主接口也要up

Config Interface Secutity 和 交换机端口也可以用

  • router(config)# in f 0/1
  • router(config-if)# sw m a | switchport mode access 将接口模式设置为access
  • router(config-if)# sw po | switchport port-security 启用端口安全
  • router(config-if)# sw po max 50 | switchport port-security maximun 50 设置最大值,以便只有一台设备能够访问快速以太网端口 0/1
  • router(config-if)# sw po mac s | switchport port-security mac-address sticky 保护端口安全,以便动态获取设备的 MAC 地址并将其添加到运行配置
  • router(config-if)# sw port-security violation restrict 保护接口,使其在出现违规时发出通知,但不禁用端口
  • router# sh po in f 0/1 查看端口安全信息

交换机实验:

  • switch# show interfaces     查看端口状态
  • switch# show ip interfaces 查看VLAN端口状态
  • switch# show ip interfaces brief 查看端口简要信息
  • show int trunk
  • switch# show mac-address-table 查看mac表
  • 没有switch# show interfaces brief
  • switch(config)# ip address 192.168.0.177 255.255.255.0 与路由器在接口上的配置IP不同,交换机是在全局配置模式配置
  • switch(config)# ip default-gateway 192.158.0.1 给交换机配置一个缺省网关,请注意,不用写掩码
  • switch(config)# vlan2 name cisco 配置一个vlan2并且指定名字叫CISCO
  • switch(config)# interface e0/10 进入端口e0/10
  • switch(config)# ip default-gateway 10.10.11.1 配置交换机的默认网关
  • switch(config)# int f0/26    进入快速以太网端口f0/26
  • switch(config-if)# vlan-membership static 2 将端口放进vlan2里面
  • switch(config-if)# trunk on  启用trunk,注意:只能在百兆以上端口启用trunk
  • switch(config-if)# notrunk-vlan 51 52 在主干上关闭VLAN51、52的传输
  • switch(config-if)# no switchport 将端口改为路由模式

VLAN Config 单臂路由或单臂交换机中对应的二层汇聚交换机 CCNA2 5.1.3.6

  • VLAN刚划好,里面没有活动端口的时候无法up
  • switch(config)# vlan 10 创建vlan 10 配置Vlan前要先创建
  • switch(config-vlan)# vlan 30 创建vlan 30
  • switch(config-vlan)# exit
  • switch(config)# in f0/11
  • switch(config-if)# switchport mode access 交换机和主机之间的配置access
  • switch(config-if)# switchport access vlan 10 划分到vlan 10,不用no shutdown交换机本来就up的
  • switch(config)# in f0/12
  • switch(config-if)# switchport mode access
  • switch(config-if)# switchport access vlan 30
  • switch(config-if)# in f0/6
  • switch(config-if)# switchport mode trunk 交换机和交换机,交换机和路由器之间的trunk
  • 下面是查看的命令
  • switch# show int f0/11 switchport

三层交换机2960 将上面CCNA2 5.1.3.6的单臂路由器改为单臂三层交换机 via SVI

  • switch(config)# vlan 10
  • switch(config-vlan)# vlan 30
  • switch(config-vlan)# exit
  • switch(config)# int vl 10
  • switch(config-if)# ip add 192.17.10.1 255.255.255.0
  • switch(config)# int vl 30
  • switch(config-if)# ip add 192.17.30.1 255.255.255.0
  • switch(config)# ip routing 打开三层交换机的路由功能

三层交换机 将上面CCNA2 5.1.3.6的单臂路由器改为三层交换机 via 路由

  • switch(config-if)# no switchport 从交换机接口转到路由口
  • switch(config-if)# switchport 切换会交换机端口

分配块端口

  • switch(config)# interface range fastEthernet 0/7-12

配置VLAN和中继 使用 VLAN 99 作为 TRUNK 端口的本征 VLAN 3.4.1.2

vlan 99
name Native
exit

int g 0/1
sw mode trunk
switchport nonegotiate 将本征 VLAN 99 分配到 TRUNK 端口并禁用 DTP
sw trunk Native vlan 99
sw trunk allowed vlan 10,20,30,88,99
show int trunk 两边端口都执行一下对比

S3(config)#int range f 0/6, f 0/11, f0/18

关闭端口

int range f 0/1-24
shutdown
int range f 0/6, f 0/11, f0/18
no shutdown

PC

  • ipv6config
  • ipconfig

CCNA实验练习

  • Ctrl + Z 返回特权EXEC模式
  • S1# clo set 15:00:00 31 Jan 2035 设置日期
  • S1# sh clo 显示日期
  • Switch# sh r 检查当前交换机或路由器配置
  • Switch(config)# h S1 更改名字
  • S1(config)# enable password c1$c0 保护特权模式访问
  • S1(config)# ena s itsasecret 改密码
  • S1(config-line)# password letmein
  • S1(config-line)# login 保护对控制台线路的访问
  • ASw-1(config)#li c 0
  • ASw-1(config-line)#pas letmein
  • ASw-1(config-line)#login 使用 Cisco IOS 命令指定或限制对设备配置的访问。
  • ASw-1(config)# ena pas class 特权访问口令
  • ASw-1(config)# ena s class 特权访问加密口令
  • ASw-1(config)#se p (service password-encryption) 加密所有明文口令。
  • S1(config)# banner motd “This is a secure system.Authorized Access Only!” 在当日消息 (MOTD) 标语中包含
  • 空格 翻一页
  • 特权EXEC模式
  • 全局配置模式
  • 在特权模式下,您可以使用全部交换机命令。不过,由于许多特权命令会配置操作参数,因此应使用口令对特权访问加以保护,防止未授权使用。
  • 特权 EXEC 命令集包括用户 EXEC 模式中包含的命令和用于访问其余命令模式的 configure 命令。

注意事项

  • con 0 vty 0 -> login
  • G 0/0 -> no shutdown
  • line vty 0 4 配置0到4,允许5个人登陆,也可以只配置0,只允许1个用户登陆
  • transport input all 允许多种登陆
  • 配置IPv4地址
  • 配置IPv6端口是,要配置IPv6地址和本地链路地址
  • 默认的网络设备telnet的功能是关闭的,配了密码之后会自动打开
  • 路由器的端口默认是关闭的,交换机的端口默认是打开的,用一根直通线连接交换机和路由器时,指示灯不会亮,但是路由器端口no shudown后两边的指示灯都会亮
  • 用一根Straight-Through线连接路由器和交换机,交换机的端口会自动up,路由器要no shutdown
  • show vlan 查看交换机的端口是在哪个VLAN中
  • show run 可以显示当前交换机和路由器的状态
  • SVI 实现 VLAN 之间的通信

实验室机器

2901R1&R2
2801R3

协议端口

  • HTTPS 443
    *

CCNA Command相关推荐

  1. CCNA(Stand-ALONE)Lab 12-Static Routes

    Objective: configure Routers 1, 2, and 4 with IP addresses, and then add static routes for all route ...

  2. CCNA专业英文词汇全集

    CCNA为思科最基础的入门认证,其中,考试偏重网络概念和理论,对于初学者来说,不少专业英文术语难以理解,导致学员学习进度维难.CISCO系列认证的原版教材,专业词汇出现频率积高,考生只要熟悉本文,相信 ...

  3. CCNA 认证学习(二)

    一.设备管理 管理设备: 也就是管理文件,定期备份,冗余备份, 灾难恢复 需要备份的文件: FLASH :    IOS 镜像文件 NVRAM :  startup-config  启动配置文件 RA ...

  4. CCNA考试情况及心得体会

    试题情况(2015/12/16,南京) 选择题全出自题库但选项顺序有改变. 拖图题全出资题库. 实验题考了题库中的ACL-1,ACL-3,OSPF,全原题,题目顺序,选项顺序均与题库相同,另外有一个E ...

  5. 《趣学CCNA——路由与交换》一6.2 Cisco设备的管理与配置

    本节书摘来自异步社区<趣学CCNA--路由与交换>一书中的第6章,第6.2节,作者 田果 , 彭定学,更多章节内容可以访问云栖社区"异步社区"公众号查看 6.2 Cis ...

  6. 《趣学CCNA——路由与交换》——6.1节Cisco设备的管理与配置

    本节书摘来自异步社区<趣学CCNA--路由与交换>一书中的第6章,第6.1节Cisco设备的管理与配置,作者 田果 , 彭定学,更多章节内容可以访问云栖社区"异步社区" ...

  7. 网络基础知识(CCNA)

    网络基础知识(CCNA) 基础的基础 默认时,路由器用来分隔广播域,也分隔冲突域 交换机用来分隔冲突域(广播域内的冲突),本质上交换机是多端口的网桥,集线器啥都不分隔,连接他的设备只有一个广播域和冲突 ...

  8. 思科认证CCNA专业英文词汇全集

    CCNA为思科最基础的入门认证,其中,考试偏重网络概念和理论,对于初学者来说,不少专业英文术语难以理解,导致学员学习进度维难.CISCO系列认证的原版教材,专业词汇出现频率积高,考生只要熟悉本文,相信 ...

  9. CCNA 认证学前准备(一)

    一.CCNA 认证学前准备 思科认证助理网络工程师CCNA学前准备 (1)网络行业生态链了解 了解网络行业的生态圈分布. 包括甲方.集成商/代理商.厂商以及所涉及的岗位. 录音链接:http://pa ...

最新文章

  1. java中原生方法_java中原生(native)函数的用法
  2. 把毛选和鲁迅全集喂给AI后,写出来的高考作文太对味了
  3. Android权限处理分类
  4. 使用IB_DESIGNABLE与IBInspectable特性实现可在视图编辑器的功能栏中设置
  5. 在Linux上编写并运行Python文件
  6. 营销心理学:如何挣女人的钱?
  7. EZGUI下的动态图片的处理
  8. 小学计算机纸牌教案,小学信息技术《玩好纸牌》教案
  9. SQL还原数据库剔除占用
  10. Windows: VC编程操作注册表键值
  11. 宝塔面板mysql命令_宝塔面板常用命令
  12. 热烈祝贺方正璞华两款产品入选2021年度江苏省工业软件优秀产品和应用解决方案拟推广名单
  13. 「硬刚Doris系列」Apache Doris的向量化和Roaring BitMap
  14. 班级网站java_基于jsp的班级网站-JavaEE实现班级网站 - java项目源码
  15. springbootBBS问答社区系统的设计与实现毕业设计源码121007
  16. 计算机无法ping打印机,打印机故障:测试页打印失败是否参阅打印疑难解答已或得帮助...
  17. 19、控件使用之图标旋转指示仪表盘显示
  18. 【一篇文章告诉你网格策略从理论到实盘的所有内容(python实现)】
  19. Web 2.0网站流行使用的颜色元素
  20. ui设计发展到底好不好?为什么越来越多的人开始学习UI设计?

热门文章

  1. CSS的2D与3D变换
  2. jQuery 插件(26)
  3. 树莓派4B使用UEFI引导 树莓派4B UEFI引导
  4. 【数据结构-栈】栈的基本操作
  5. 怎样才能让计算机发出钢琴的按键声,这篇文章教你如何弹出钢琴好音色
  6. 使用 OpenCV 和 Python 识别数字
  7. pb网络编程_可在家中建立三个区域聆听空间,Integra DRX3.3 9.2声道网络影音接收机...
  8. 一款轻量级Linux工具箱
  9. python-opencv-寻找不同颜色圆形以及连线、标记轮廓和圆心
  10. 2018年全国计算机二级高级office35个高频考点