switch3560的简单配置

1、访问设备的方式

 

   管理从用户与设备交互的特点来分,访问设备的方式可以分为命令行方式和Web方式。

 

    (1) 命令行方式:包括从Console口登录进行访问和通过Telnet登录进行访问;

 

    (2) Web方式:包括通过HTTP进行的普通Web访问。
2、查看CISCO 设备的简单运行状态

 

    (1)Switch> 开机时自动进入

 

    特权模式 配置系统参数,升级IOS软件,备份配置文件 Switch#

 

    在非特权模式下键入ENABLE 使用quit返回非特权模式全局模式 CISCO交换机大部分配置都是在这个模式下进行 Switch(config)# 

 

    在特权模式下键入configure terminal 使用quit返回特权模式监控模式

 

    升级IOS系统软件 Switch: 开机时摁住面板上的MODE键约5秒钟
  (2) 基本设置命令
  全局设置 config terminal

 

    设置访问用户及密码 Username username password password

 

    设置特权密码 enable secret password

 

    设置路由器名 Hostname name

 

       置静态路由 ip route destination subnet-mask next-hop

 

    启动IP路由 ip routing 启动IPX路由 ipx routing

 

    端口设置 interface type slot/number

 

    设置IP地址 ip address address subnet-mask

 

    设置IPX网络 ipx network network

 

    激活端口 no shutdown

 

    物理线路设置 line type number

 

    启动登录进程 login [local|tacacs server]

 

    设置登录密码 Password password

 

    显示命令任务 命令 查看版本及引导信息 show version

 

    查看运行设置 show running-config

 

    查看开机设置 show startup-config

 

    显示端口信息 show interface type slot/number

 

    显示路由信息 show ip route

 

3、Catalyst 3560接口说明

 

    FE电接口:符合100Base-TX物理层规范 GE电接口:1000Base-TX物理层规范工作速率 FE电 接口可以选择10Mbit/s、100Mbit/s两种速率 GE电接口可以选择10Mbit/s、100Mbit/s、1000Mbit/s三种速率工作模式 自动协商模式

 

4、Catalyst 3560接口配置

 

    3560的所有端口缺省的端口都是二层口,如果此端口已经配置成三层端口的话,则需要用switchport来使其成为二层端口

 

    (4.1) 配置端口速率及双工模式

 

    可以配置快速以太口的速率为10/100Mbps及千兆以太口的速率为10/100/1000-Mbps; 但对于SFP端口则不能配置速率及双工模式,有时可以配置nonegotiate,当需要联接不支持自适应的其它千兆端口时。

 

    Step 1 configure terminal 进入配置状态.

 

    Step 2 interface interface-id 进入端口配置状态.

 

    Step 3 speed {10 | 100 | 1000 | auto | nonegotiate} 设置端口速率 注 1000 只工作在千兆口. GBIC模块只工作在1000 Mbps下. nonegotiate 只能在这些GBIC上用 1000BASE-SX, -LX, and -ZX GBIC

 

    Step 4 duplex {auto | full | half} 设置全双工或半双工.

 

    Step 5 end 退出

 

    Step 6 show interfaces interface-id 显示有关配置情况

 

    Step 7 copy running-config startup-config 保存

 

    Switch# configure terminal

 

    Switch(config)# interface fastethernet0/3

 

    Switch(config-if)# speed 10

 

    Switch(config-if)# duplex half

 

    (4.2)配置一组端口

 

    Step 1 configure terminal 进入配置状态

 

    Step 2 interface range {port-range}

 

    Switch(config)# interface range fastethernet0/1 - 5    进入组配置状态

 

    Switch(config-if-range)# no shutdown      启用端口

 

    Step 3 end 退回

 

    Step 4 show interfaces [interface-id] 验证配置

 

    Step 5 copy running-config startup-config 保存

 

    (4.3)配置不同类型端口的组:

 

    Switch# configure terminal

 

    Switch(config)# interface range fastethernet0/1 - 3,

 

    Switch(config)#gigabitethernet0/1 - 2

 

    Switch(config-if-range)# no shutdown

 

    (4.4)配置三层口

 

    Catalyst 3560支持三种类型的三层端口:  SVIs: 即interface vlan Note 当生成一个interface Vlan时,只有当把某一物理端口分配给它时才能被激活

 

    · 三层以太网通道口(EtherChannel): 以太通道由被路由端口组成。以太通道端口接口在“配置以太通道”中被描述。

 

    .路由口:路由口是指某一物理端口在端口配置状态下用no switchport命令生成的端口所有的三层都需要IP地址以实现路由交换配置步骤如下: Step 1 configure terminal 进入配置状态

 

    Step 2 interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-channel port-channel-number} 进入端口配置状态

 

    Step 3 no switchport 把物理端口变成三层口

 

    Step 4 ip address ip_address subnet_mask 配置IP地址和掩码

 

    Step 5 no shutdown 激活端口

 

    Step 6 End 退出

 

    Step 7 show interfaces [interface-id]

 

    show ip interface [interface-id]

 

    show running-config interface [interface-id] 验证配置

 

    Step 8 copy running-config startup-config

 

    (4.5)监控及维护端口

 

    监控端口和控制器的状态主要命令见下表

 

    show interfaces [interface-id] 显示所有端口或某一端口的状态和配置. show interfaces interface-id status [err-disabled] 显示一系列端口的状态或错误-关闭的状态

 

    show interfaces [interface-id] switchport 显示二层端口的状态,可以用来决定此口是否为二层或三层口。

 

    show interfaces [interface-id] description 显示端口描述 show ip interface [interface-id] 显示所有或某一端口的IP可用性状态

 

    show running-config interface [interface-id] 显示当前配置中的端口配置情况

 

    show version 显示软硬件等情况

 

    (4.6)刷新、重置端口及计数器 Clear命令

 

    clear counters [interface-id] 清除端口计数器.

 

    clear interface interface-id 重置某一端口的硬件逻辑

 

    clear line [number | console 0 | vty number] 重置异步串口的硬件逻辑

 

    Note clear counters 命令只清除用

 

    show interface所显示的计数,不影响用snmp得到的计数

 

举例如下:

 

    Switch# clear counters fastethernet0/5 Clear ``show interface`` counters on this interface [confirm] y Switch# *Sep 30 08:42:55: %CLEAR-5-COUNTERS: Clear counter on interface FastEthernet0/5 by vty1 (171.69.115.10)

 

    可使用clear interface 或 clear line 命令来清除或重置某一端口或串口,在大部分情况下并不需要这样做: Switch# clear interface fastethernet0/5

 

    关闭和打开端口命令Step 1 configure terminal

 

    进入配置状态 Step 2 interface {vlan vlan-id} | {{fastethernet | gigabitethernet} interface-id} | {port-channel port-channel-number} 选择要关闭的端口

 

    Step 3 Shutdown 关闭

 

    Step 4 End 退出

 

    Step 5 show running-config 验证使用 no shutdown 命令重新打开端口.

 

    (4.7)交换机端口镜像配置

 

    『端口镜像的数据流程』基于端口的镜像是把被镜像端口的进出数据报文完全拷贝一份到镜像端口,这样来进行流量观测或者故障定位。

 

4.7.1通过交换机的第2号口监控第1号口的流量

 

    Switch(config)# monitor session 1 source interface gigabitethernet0/1

 

    Switch(config)# monitor session 1 destination interface gigabitethernet0/2

 

    Switch(config)# end

 

    删除一个span会话: Switch(config)# no monitor session 1 source interface gigabitethernet0/1

 

    witch(config)# end

 

4.7.2以太通道端口组(Ethernet Port Groups)以太通道端口组提供把多个交换机端口像一个交换端口对待。这些端口组为交换机之间或交换机和服务器之间提供一条单独的高带宽连接的逻辑端口。以太通道在一个通道中提供穿越链路的负载平衡。如果以太通道中的一个链路失效,流量会自动从失效链路转移到被用链路。你可以把多干道端口加到一个逻辑的干道端口;把多访问端口加到一个逻辑访问端口;或者多隧道端口加到一个逻辑的隧道接口。绝大多数的协议能够在单独或是集合的接口上运行,并且不会意识到在端口组中的物理端口。除了DTP、CDP和PAgP,这些协议只能在物理接口上运行。当你配置一个以太通道,你创建一个端口通道逻辑接口,并且指派一个接口给以太通道。对于三层接口,你人工创建该逻辑接口: Figure

 

    案例:把交换机A,B的1,2号口添加到同一个组5里面

 

    SwitchA# configure terminal SwitchA (config)# interface range gigabitethernet0/1 -2

 

    SwitchA (config-if-range)# switchport mode access

 

    SwitchA (config-if-range)# switchport access vlan 10

 

    SwitchA (config-if-range)# channel-group 5 mode ON

 

    Switch(config-if-range)# end SwitchB# configure terminal

 

    SwitchB(config)# interface range gigabitethernet0/1 -2

 

    SwitchB(config-if-range)# switchport mode access

 

    SwitchB(config-if-range)# switchport access vlan 10

 

    SwitchB(config-if-range)# channel-group 5 mode ON

 

    SwitchB(config-if-range)# end

 

5、交换机的启动及基本配置案例:
3560交换机上配置:

 

    sw3560#erase nvram-------------------------全部清除交换机的所有配置

 

    sw3560#reload--------------------------重新启动交换机(初始提示符为 )

 

    sw3560(config)#hostname sw3560-------------------设置交换机的主机名sw3560(config)#enable

 

    secret cisco---------------------设置加密密码

 

    sw3560(config)#enable password level 1 cisco1---设置等级密码(1最低)

 

    sw3560(config)#enable password level 15 cisco15设置等级密码(15最高)

 

    sw3560(config)#ip address 192.168.1.1 255.255.255.0--------设置交换机的管理IP地址

 

    sw3560(config)#ip default-gateway 192.168.1.254----------设置交换机的网关地址

 

    sw3560(config)#ip domain-name antaitel.com----设置交换机所连域的域名

 

    sw3560(config)#ip name-server 218.30.19.40--------------设置交换机所连域的域名服务器IP

 

    sw3560#show ip-------------------------------------查看上述设置环境

 

    sw3560#show version--------------------------查看交换机的版本等信息

 

    sw3560#show running-config-------查看交换机的当前运行配置等全部信息


 

    sw3560#show int e0/1---------------------查看交换机的第1个端口信息

 

猜你喜欢

转载自blog.csdn.net/qq_42793064/article/details/81204263