备战2018思科交换机命令归纳总结(实战篇)

编辑: admin           2017-12-07         

    switch> 用户模式

    1:进入特权模式enable

    switch> enable

    switch#

     

    2:进入全局配置模式configure terminal

    switch> enable

    switch#configure terminal

    switch(conf)#

     

    3:交换机命名hostname name 以cisco001 为例

    switch> enable

    switch#c onfigure terminal

    switch(conf)#hostname cisco001

    cisco001(conf)#

     

    4:配置使能口令(未加密)enable password cisco 以cisco 为例

    switch> enable

    switch#configure terminal

    cisco001(conf)# enable password cisco

     

    5:配置使能密码(加密)enable secret ciscolab 以cicsolab 为例

    switch> enable

    switch#configure terminal

    switch(conf)# enable secret ciscolab

     

    6:设置虚拟局域网vlan 1 interface vlan 1

    switch> enable

    switch#configure terminal

    switch(conf)# interface vlan 1

    switch(conf)# ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码

    switch (conf-if)#no shut 激活端口

    switch (conf-if)#exit

    switch (conf)#ip default-gateway 192.168.254 设置网关地址

     

    7:进入交换机某一端口interface fastehernet 0/17 以17 端口为例

    switch> enable

    switch#configure terminal

    switch(conf)# interface fastehernet 0/17

    switch(conf-if)#

     

    8:查看命令show

    switch> enable

    switch# show version 察看系统中的所有版本信息

    show interface vlan 1 查看交换机有关ip 协议的配置信息

    show running-configure 查看交换机当前起作用的配置信息

    show interface fastethernet 0/1 察看交换机1 接口具体配置和统计信息

    show mac-address-table 查看mac 地址表

     

    9:交换机恢复出厂默认恢复命令

    switch> enable

    switch# erase startup-configure

    switch# reload

     

    10:交换机的密码恢复

    拔下交换机电源线。

    用手按着交换机的MODE 键,插上电源线

    在switch:后执行flash_ini 命令:switch: flash_ini

    查看flash 中的文件: switch: dir flash:

    把“config.text”文件改名为“config.old”: switch: rename flash: config.text flash: config.old

    执行boot: switch: boot

    交换机进入是否进入配置的对话,执行no :

    进入特权模式察看flash 里的文件: show flash :

    把“config.old”文件改名为“config.text”: switch: rename flash: config.old flash: config.text

    把“ config.text ” 拷入系统的“ running-configure ”: copy flash: config.text system :

    running-configure

    重新设置密码并保存。

     

    11.交换机telnet 远程登录设置:

    switch>en

    switch#configure terminal

    swich(conf)#enable password cisco 以cisco 为特权模式密码

    swich(conf)#interface vlan 1 以vlan 1端口作为远程登录的接口,其他端口亦可

    swich(conf-if)#ip address 192.168.1.1 255.255.255.0

    swich(conf-if)#no shut

    swich(conf-if)#exit

    swich(conf)line vty 0 4 设置0-4 个用户可以telnet 远程登陆

    swich(conf-line)#login

    swich(conf-line)#password 123456

     

    12.交换机ssh远程登录设置:

     a.设定一个非默认的hostname

    Switch(config)#hostname cisco

     b.配置域名:

    cisco(config)#ip domain-name test

    c.指定加密长度:

    cisco(config)#crypto key generate rsa

    How many bits in the modulus [512]: 1024

    % Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

    d.将vty线路下的登录方式改为 ssh

    cisco(config)#line vty 0 4

    cisco(config-line)#transport in ssh

     

    13.配置vtp同步

    说明:VTP(VLAN Trunking Protocol):是VLAN中继协议,它是思科私有协议。作用是同步各个交换机之间的VLAN信息。

    要使用VTP,首先必须建立一个VTP管理域,在同一个管理域中交换机共享vlan信息,并且一个交换机只能参加一个管理域,交换机之间使用trunk口连接。

    方法/步骤

    1配置实例:

        要求配置switch0、switch1、switch2实现vlan共享,并在switch0上添加、删除vlan,查看switch1、switch2是否同步

    2配置命令参考:

    Switch0:

    switch0(config)#vtp domain test  配置vtp 管理域

    switch0(config)#vtp password 123 配置vtp密码

    Switch0(config)#interface fa0/1   配置接口模式为trunk

    Switch0(config-if)#switchport mode trunk

    switch0(config)#int fa0/2

    switch0(config-if)#switchport mode trunk

     

    switch1:

    switch1(config)#vtp domain test  配置vtp 管理域

    switch1(config)#vtp password 123 配置vtp密码

    Switch1(config)#interface fa0/1   配置接口模式为trunk

    Switch1(config-if)#switchport mode trunk

     

    switch2:

    switch2(config)#vtp domain test  配置vtp 管理域

    switch2(config)#vtp password 123 配置vtp密码

    Switch2(config)#interface fa0/1   配置接口模式为trunk

    Switch2(config-if)#switchport mode trunk

     

    在switch0 上添加vlan2,vlan3 :  

    switch0(config)#vlan 2

    switch0(config-vlan)#exit

    switch0(config)#vlan 3

    switch0(config-vlan)#exit

    switch0(config)#

    经验内容仅供参考,如果您需解决具体问题(尤其法律、医学等领域),建议您详细咨询相关领域专业人士。
  •   4
  • 相关文章

    备战2018怎么判断肉是不是熟了归纳总结(实战篇)
    备战2018怎么连接路由器和电脑归纳总结(实战篇)
    备战2018高清行车记录仪品牌归纳总结(实战篇)
    20173194实用小技巧 iphone固件恢复3194错误解决方法
    备战2018什么是办公室工作归纳总结(实战篇)
    2017衣服翻新实用小技巧 巧手主妇——旧衣巧翻新
    备战2018怎样使用补水面膜归纳总结(实战篇)
    备战2018笔记本无线无法上网归纳总结(实战篇)
    备战2018鼻炎吃什么药好归纳总结(实战篇)
    2017diy美容实用小技巧 最好的DIY美容方法是什么
Copyright ©2009-2021 逆火网训All Rights Reserved.     滇ICP备2023009294号-57