思科交换机学习111

  • 格式:docx
  • 大小:25.43 KB
  • 文档页数:6

设置交换机名字为yzhSwitch> 进入超级终端控制台Switch>enable 进入交换机特权模式Switch#Switch#configure terminal 进入交换机全局配置模式Switch(configure)#hostname yzh 改变名字为XXXyzh(configure)# 显示改名成功yzh(configure)#exit 退回上级操作模式,即返回特权模式yzh#yzh#exit 返回到用户模式 yzh>参看交换机有关信息yzh#yzh#configure terminal 进入全局配置模式yzh#show version 查看交换机的版本信息yzh#show vlan 查看VLAN的信息yzh#show running-config 查看交换机当前生效的配置信息show interfaces [interface-id]show interfaces[interface-id]statusshow interfaces [interface-id] switchportshow interfaces [interface-id] description配置交换机接口f0/2yzh#configure terminalyzh(config)#interface fastethernet0/2yzh(config-if)#yzh(config-if)#speed 100 可选的速度有10/100/1000/auto/nonegotiateyzh(config-if)#duplex half 可选的模式有half/full/autoyzh(config-if)#no shutdownyzh(config-if)#exityzh(config)#exityzh#yzh#show interface fastethernet0/2设置交换机Enable特权密码为adminyzh#configure terminal 进入交换机配置模式yzh(config)#enable secret admin 设置Enable密码为admin保存配置信息yzh#write 保存设置配置,把配置指令写入对到系统文件夹中yzh#dir 查看系统文件删除配置,恢复初始配置yzh#dir 查看系统文件yzh#delete? 输入“?”号,获得帮助yzh#delete flash:config.txt 删除配置文件,系统就恢复了出厂配置为接口加入描述yzh#configure terminal 进入交换机配置模式yzh(config)#int fa0/1 进入快速接口0/1yzh(config-if)#description 好好学习描述为“好好学习”yzh(config-if)#no description 好好学习删除“好好学习”的描述为交换机配置默认网关yzh(config)#ip default-gateway 192.168.155.254配置三层交换机的名称为SW3,enable密码为admin,并且配置与远程登陆相关的选项。

Switch>enable 进入交换机特权模式Switch#configure terminal 进入交换机全局模式Swirch(config)#hostname yzh 修改交换机名称Yzh(config)#enable password admin 设置交换机enable密码为admin配置VLAN1Yzh(config)#interface vlan1 进入vlan1Yzh(config-if-VLAN1)#ip address 192.168.1.1 255.255.255.0 配置IP地址yzh(config-if-VLAN1)#exit 退出配置vlan1yzh(config)#username admin password admin 配置登陆交换机的用户名与密码yzh(config)#line vty 0 4 进入vty端口配置yzh(config-line)#login local 配置vty端口使用本地数据库验证yzh(config-line)#exit 退出vty端口配置yzh(config)# 配置OK保存三层交换机配置SW3#write配置三层交换机名称与VLANyzh>enable 进入交换机特权模式yzh#configure terminal 进入交换机全局模式yzh(config)#hostname YZH 修改交换机名称为YZHYZH(config)#vlan10 创建vlan10YZH(config-vlan)#vlan20 创建vlan20YZH(config-vlan)#exitYZH(config)#interface range fastEthernet 0/1-10 进入fa/1-10端口YZH(config-if-range)#switchport access vlan10 划分fa/1-10端口为vlan10YZH(config-if-range)exitYZH(config)#interface range fastEthernet 0/11-20 进入fa/11-20端口YZH(config-if-range)#switchport access vlan20 划分fa/11-20端口为vlan20YZH(config-if-range)#exit查看vlan配置信息YZH#show vlan配置vlan10YZH(config)#interface vlan10 进入vlan10YZH(config-vlan10)#ip address 192.168.1.1 255.255.255.0 配置vlan10的IP地址YZH(config-vlan10)#exit聚合端口yzh(config)#interface range fasrEthernet 0/1-2 进入fa0/1、fa0/2端口yzh(config-if-range)#port-group 1 把fa0/1、fa0/2端口聚合为端口组1配置三层交换机SW1的生成树协议YZH(config)#spanning-tree 配置生成树VLAN的划分YZH (config)#int fa0/1YZH (config-if)#switchport access vlan20 将端口Fa0/1划分为VLAN20 YZH (config-if)#switchport mode access 强制端口模式为accessYZH (config-if)# ip helper-address 192.168.101.254 指定DHCP服务器地址范围内的所有接口必须是同一种类型;就是说,所有快速以太端口,所有千兆以太端口,所有以太通道端口,或所有交换虚拟端口。

这个例子展示怎样定义一个选择了GBT端口1-4,名为enet_list的接口范围宏,确认宏配置如下:Switch# configure terminalSwitch(config)# define interface-range enet_list gigabitethernet0/1 -4Switch(config)# endSwitch# show running-config | include definedefine interface-range enet_list GigabitEthernet0/1 -4Switch#这个例子展示怎样创建一个名为macrol的多接口宏:Switch# configure terminalSwitch(config)# define interface-range macro1 gigabitethernet0/1 -2, fastethernet0/5 -7Switch(config)# endSwitch#这个例子展示怎样把接口宏enet_list输入到接口范围配置模式:Switch# configure terminalSwitch(config)# interface range macro enet_listSwitch(config-if-range)#这个例子展示怎样删除接口范围宏enet_list,并且确认他确实已被删除。

Switch# configure terminalSwitch(config)# no define interface-range enet_listSwitch# show run | include defineSwitch#配置IEEE802.3X流控制流控制在直连的以太端口上启用,在拥塞期间允许另一端拥塞的节点暂停链路运作来控制流量速率。

如果一个端口发生拥塞并且不能接收任何更多的流量,他将通知对端端口停止发送直到这种拥塞情况消失。

当本地设备在他本地检测到了任何拥塞,他能够发送一个暂停帧通知链路伙伴或者远程设备已发生拥塞。

紧随收到暂停帧之后,远程设备停止发送任何数据包,这样防止在拥塞期间丢弃任何一个数据包注意:你不能在一个交换机上即配置IEEE802.3X流控制又配置QoS。

在一个接口上配置流控制之前,用命令禁用交换机上的QoS。

流控制可以用两种方式设计,对称和不对称。

对称设计适合于点到点的链路,而不对称设计适合于辐射型节点连接。

辐射型节点中中心路由器可以中断末端系统,而反之就不行。

用命令设置接口的发送或接收暂停帧为on,off或desired。

(interface) flowcontrol {receive | send}{on | off | desired}缺省快速以太端口是receive off和send off。

注意:在Catalyst3550交换机上,GBT端口能够接收和发送暂停帧;快速以太端口只能够接收暂停帧。

因此,对快速以太端口来说,只能用send off来描述其状态。

这些规则应用于设备上的流控制:receive on (or desired) 和send on:流控制运行在两个方向;本地和远程设备都能够发送暂停帧来显示链路拥塞。

receive on (or desired) 和send desired:如果连接设备支持流控制,那么该端口就能接收暂停帧和发送暂停帧receive on (or desired) 和send off:该端口不能发送暂停帧但是能够和一个期望或能够发送暂停帧的连接设备一起运作;该端口可以接收暂停帧。

receive off 和send on:如果远程设备支持流控制,该端口就发送暂停帧;但是该端口不支持来自于远程设备的暂停帧。