交换机和路由器基本配置精修订

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

交换机和路由器基本配

集团标准化工作小组 #Q8QGGQT-GX8G08Q8-GNQGJ8-MHHGN#

一CISCO交换机和路由器基本配置

交换机的配置

1用户模式

switch >

2进入特权模式

switch > enable

3 进入全局配置模式,全局模式的配置对整个交换机生效. switch # config terminal

switch (config)#

4进入接口模式,配置只对当前的接口生效

switch(config) # interface f0/1

switch(config-if) #

进入line 模式,这个模式主要用来对控制台做相应的配置5 switch(config) # line console 0

switch(config-line)

6配置主机名

switch(config) #hostname 主机名

7配置使能口令

switch(config) # enable password 密码

8 配置加密使能口令

switch(config) # enable secret 密码

9配置ip地址

switch(config) # interface vlan 1

switch(config) # ip add ip地址子网掩码switch(config) # no shutdown

10配置交换机的网关

switch(config) # ip default-gateway ip地址11 保存配置

switch # copy runing-config startup-config switch # write

12清空配置

switch # erase startup-config

13 清空接口配置

switch (config) # interface f0/1

switch (config-if) # default interface f0/1

14清空交换机密码

(1) 关闭电源.

(2) 开启电源, 并且按住交换机的mode键,当交换机进入................................ ................................

flash_init

load_helper

boot

switch:

(3) 在switch 后执行 flash_init命令

switch: flash-init

(4) 在查看flash中的文件

switch: dir flash:/

(5) 把文件后缀名改了就可以,并且重新启动.(交换机重启后不会在读取配置文件了)

switch:rename flash:

switch:boot

(6) 启动后进入特权模式查看flash里面的文件,并且把文件改回来.并且把flash里面的文件复制到内存中

switch # rename flash: flash:

switch # copy startup-config running-config

15创建vlan 2

switch (config) # vlan 2

16删除vlan 2

switch (config) # no vlan 2

17 把端口 f0/5到10 添加到vlan 2

switch (config) # interface range f0/5 - 10

switch (config) # switchport access vlan 2

18将f0/1设置成中 trunk

switch (config) # interface f0/1

switch (config) # switchport mode trunk

19将f0/1 设置成期望型或自动型

switch (config) # switchport dynamic desirable / auto

20如果不需要trunk 传送vlan 2的数据,可以将vlan 2 从trunk中删除. switch (config) # interface f*/* (trunk接口)

switch (cofnig-if) # switchprot trunk allowed vlan remove vlan 2 21也可以添加vlan 2

switch (config) # interface f*/* (trunk接口)

switch (config) # switchprot trunk allowed vlan add vlan 2

二交换机的查看命令

switch # show mac-address-table 查看本机的mac地址表

switch # show cdp neighbors 列出与本设备相连的cisco设备

switch # show running-config 查看交换机的配置

switch # show vlan brief 查看vlan的详细信息

switch # show Internet trunk 可以查看生成树协议

三路由器配置命令

1 配置默认路由

2 配置静态路由

route (config) # ip route 目的ip 子网掩码下一跳

3 对所有密码进行加密

route (config) # enable password-encryption

4 如果要使enable密码也以加密的形式保存在running-config中,中需运行

route (config) # service password-encryption

5 接口

route (config-if) # speed 10/100/auto (配置速率)

route (config-if) # duplex auto/full/half (工作模式,自动/半双工/全双工)

route (config-if) # description 文本 (接口模式为当前接口列出希望跟踪的信息文本)

相关文档
最新文档