交换机与路由实验常用命令

  • 设置交换机特权密码
  • 在全局模式下:
  • 设置加密密码:switch(config)#enable secret密码

    设置明文密码:switch(config)#enable password 密码

  • 设置交换机控制台密码
  • 在全局模式下
  • switch(config)#line console 0

    switch(config-line)#password 密码

  • switch(config-line)#login

 

  • 设置交换机Telnet密码
  1. 在全局模式下
  2. switch(config)#line vty 0 4

switch(config-line)#password 密码

switch(config-line)#login

  • 交换机工作模式

 1.配置模式切换

 switch>        //普通用户模式

switch>enable        //进入特权用户模式

switch#        //特权用户模式

switch#configure terminal        //进入全局配置模式

switch(config)#        //全局配置模式

switch(config)#interface f0/1        //进入接口配置模式

switch(config-if)#        //接口配置模式

switch(config-if)#  exit        //返回上一级模式

switch(config)# 

switch#disable        //退出特权模式

switch>

switch(config-if)#end         //直接返回特权模式

switch#

2.修改交换机的名字(Hostname)

switch#configure terminal 

switch(config)#hostname switch1        //修改交换机名字为“switch1”

 3.设置交换机端口参数

switch1(config)#interface fastEthernet 0/1
switch1(config-if)#speed100        // 配置端口速率为100Mbps

switch1(config-if)#duplex half         // 配置为半双工模式
switch1(config-if)#no shutdown         //开启端口

 4.配置交换机管理地址

switch1(config-if)#exit
switch1(config)#interface vlan 1         //打开交换机的管理VLAN

switch1(config-if)#ip address 192.168.1.1 255.255.255.0   //配置管理地址为 192.168.1.1/24
switch1(config-if)#no shutdown
switch1(config-if)#exit
switch1(config)#

 5.管理交换机配置信息

switch1#copy running-config startup-config        // 将当前运行的参数保存到启动文件中
switch1#write         //将当前配置信息保存到flash中用于系统初始化

switch1#delete flash:config-text         // 永久删除 flash 中的配置文件

  • 路由器工作模式

 1.路由器配置模式

Router>         // 普通用户模式
Router >enable         //进入特权用户模式
Router #         // 特权用户模式
Router #configure terminal         //进入全局配置模式
Router (config)#         // 全局配置模式
Router (config)#interface f0/1        //进入接口配置模式
Router (config-if)#         // 接口配置模式
Router (config-if)#exit         //返回上一级模式
Router (config)#
Router (config)#exit         // 返回上一级模式
Router #
Router #disable         // 退出特权模式
Router >
Router >enable
Router# configure terminal
Router (config)#interface f0/1
Router (config-if)#end         // 直接返回特权模式 

 2.修改路由器主机名

 Router (config)#hostname Router0          //修改路由器名字为“Router0"

 3.设置路由器端口

Router0(confie)#interface fastEthernet 0/1
Router0(config-if)#speed 100         //配置端口速率为100Mbps
Router0(config-if)# ip address 192.168.1.1 255.255.255.0    //配置接口IP 地址为 192.168.1.1/24
Router0 (contig-if)#no shutdown        //开启端口
Router0 (config-if)#exit
Router0 (config)#

 4.管理路由器配置信息

Router0#copy running-config startup-config        //从将当前运行的参数保在到启动文件中
Router0#write         //将当前配置信息保存到flash中用于系统初始化Router0#delete flash:config-text         // 永久删除flash中的配置文件
Router#show running-config

 

  • 2
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_46244264

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值