Switch(config)#line 0 4 设置telnet密码
Switch(config-line)#password Admin@123
Switch(config)#enable password Admin@123
Switch(config)#hostname WEB-sw 设置交换机用户名
DCRS-5526S>enab 启动生成树协议命令:在全局模式下:(默认是开启的)
DCRS-5526S#confi
DCRS-5526S(Config)#spanning-tree
MSTP is starting now, please wait...........
MSTP is enabled successfully.
DCRS-5526S(Config)#
Switch(Config)#interface ethernet 0/0/2 在端口0/0/2 设置优先级为32.(端口优先级值越小,优先级越高)
WEB-sw(config-if)#spanning-tree port-priority 32
switchport trunk native vlan 是做什么用的!
相当于一个tag标志的vlan
1、如果进入该端口的包不带该vlan,则直接通过;如果进入该端口的包带native vlan,则剥离native vlan并允许通过;
2、如果出该端口的包不带该vlan,则直接通过;如出该端口的包带native vlan,则剥离native vlan并允许通过;
Switch(config)# interface range fastethernet0/23 -24 加入VLAN
Switch(config-if-range)# switchport mode trunk
Switch(config-if-range)# switchport access vlan 1
为第三层接口配置IP地址
为第三层接口配置IP地址借助Cisco IOS IP和IP路由协议,Cisco Catalyst 4000/4500/6500系列交换机支持三层接口,用于实现企业内部网络内各逻辑网络之间的数据交换。Cisco三层交换机提供两种类型的三层接口,即逻辑三层VLAN接口和物理三层接口。逻辑三层VLAN接口整合了路由和桥接功能,用于实现VLAN之间的线速路由;借助于物理三层接口,可以在三层交换机上实现类似传统路由的功能,实现端口间的路由。1.配置逻辑三层接口在配置逻辑三层接口前,必须在交换机上已经创建并配置VLAN,并将VLAN成员指定到二层接口。另外,还必须启用IP路由,并指定IP路由协议。
第一步:进入全局配置模式。Switch# configure terminal
第二步:指定欲配置的VLAN。Switch(config)# vlan vlan_id
第三步:为该VLAN指定IP地址信息。该VLAN中的计算机,将使用该IP地址作为默认网关。Switch(config-if)# ip address ip_address subnet_mask
第四步:启用该逻辑三层接口。Switch(config-if)# no shutdown
第五步:退出配置模式。Switch(config-if)# end
第六步:将配置保存至NVRAM。Switch# copy running-config startup-config
第七步:校验配置。Switch# show interfaces [type slot/interface]Switch# show ip interfaces [type slot/interface]Switch# show running-config interfaces [type slot/interface]Switch# show running-config interfaces vlan vlan_ID2.配置物理三层接口在配置物理三层接口之前,必须先启用IP路由,并指定IP路由协议。
第一步:进入全局配置模式。Switch# configure terminal
第二步:启用IP路由。Switch(config)#ip routing
第三步:指定欲配置的接口。可以是物理接口,也可以是EtherChannel。Switch(config)# interface interface-id
第四步:将物理二层接口转换为物理三层接口。Switch(config-if)#no switchport
第五步:为该接口配置IP地址信息。Switch(config-if)# ip address ip_address subnet_mask
第六步:启用该物理三层接口。Switch(config-if)# no shutdown
第七步:退出配置模式。Switch(config-if)# end
第八步:将配置保存至NVRAM。Switch# copy running-config startup-config
第九步:校验配置。Switch# show interfaces [type slot/interface]Switch# show ip interfaces [type slot/interface]Switch# show running-config interfaces [type slot/interface]
交换机名(config)# interface fastethernet 0/1 /*进入接口0/1的配置模式
交换机名(config-if)# speed 10 /*设置该端口的速率为10Mb/s
交换机名(config-if)# duplex full /*设置该端口为全双工
评论专区