锐捷网络实验手册————————————————————————————————作者:————————————————————————————————日期:实验一交换机的基本配置1.基本配置:网络拓扑RG-Switchﻩ实验环境将RG-Switch的其中一以太网口连至PC的以太网口实验配置1.配置交换机主机名Red-Giant>enable(注:从用户模式进入特权模式)Red-Giant#configure terminal(注:从特权模式进入全局配置模式)Red-Giant(config)#hostname SW1(注:将主机名配置为“SW1”)SW1(config)#2.配置交换机远程登陆密码SW1(config)#enable secret level 1 0 star (注:将交换机远程登陆密码配置为“star”)3.配置交换机特权模式口令SW1(config)#enable secret level 15 0 star(注:将交换机特权模式口令配置为“star”)4.为交换机分配管理IP地址SW1(config)#interfacevlan1SW1(config-if)#ip address 10.1.1.1 255.255.255.0SW1(config-if)#no shutdown注:为VLAN 1的管理接口分配IP地址(表示通过VLAN 1来管理交换机),设置交换机的IP地址为10.1.1.1,对应的子网掩码为255.255.255.05.显示交换机MAC地址表的记录SW1#showmac-address-table注:在PC上开一命令行窗口,运行命令:c:\>ping 10.1.1.1能ping通则在交换机上执行show mac-address-table 可查看到PC的MAC地址注:PC的MAC地址可以在命令行下输入: ipconfig /all查看.6.修改交换机MAC地址的老化时间SW1(config)#mac-address-table aging-time注:将交换机MAC地址老化时间设置为10秒SW1(config)#end注:从交换机全局配置模式返回至特权模式SW1#show mac-address-table注:显示交换机MAC地址表的记录测试结果从PC上TELNET到交换机.验证命令show int f0/1show ip intshow runpingtelnet实验二 VLA N配置1.VLA N/802.1Q-本交换机隔离网络拓扑实验项目ﻩVLAN/802.1Q-本交换机隔离测试实验环境ﻩPC1连接在交换机的0/5 口;PC2连接在交换机的0/15 口实验配置S2126G#co nfigu re term inal注:进入交换机全局配置模式S2126G(config )# vlan 10注:创建vlan 10S2126G (co nf ig-vlan)# name t est 10注:将Vlan 10命名为te st 10S2126G(confi g)# vlan 20注:创建vlan 20S 2126G(co nfig -vla n)# n ame test20注:将Vlan 20命名为test 20S 2126G(confi g-if)# int erface fas tether net 0/5 注:进入f astet her net 0/5的接口配置模式S2126G(config-if)# swit ch acc ess vlan 10注:将f ast ethernet 0/5端口加入vl an 10中 S2126G PC 1 PC 2S 2126G (co nfi g-if)# inte rfac e fastet he rn et 0/15注:进入f aste thernet 0/15的接口配置模式S2126G (c onfig-if)# switch acce ss v la n 20注:将faste ther ne t 0/15端口加入vl an 20中实验过程ﻩ清空交换机原有vlan 配置,将fastethern et0/5口加入vlan 10 , 将fast eth ernet0/15口加入vlan 20 。
实验结果ﻩPC 1地址设成192.168.10.0/24的地址, P C2地址设成192.168.20.0/24的地址PC1 与P C 2 不能相互ping 通。
2.VLAN/802.1Q-跨交换机VLAN网络拓扑实验项目ﻩV LAN/802.1Q -跨交换机V LAN测试实验环境ﻩ两台交换机的fast 0/24互联,其中一台交换机的f ast 0/5和fast0/15连接PC1和PC2,另一台交换机的fast0/5接P C3实验配置ﻩ交换机S3550-24: S2126G PC 1 vlan PC3 vlan S3550-24 PC 2 vlanSWITCH#configure terminal注:进入交换机全局配置模式SWITCH(config)# vlan 10注:创建vlan 10SWITCH(config-vlan)# name test10注:将Vlan 10命名为test10SWITCH(config)# vlan 20注:创建vlan20SWITCH(config-vlan)#name test20注:将Vlan 20命名为test20SWITCH(config-if)# interface fastethernet 0/5注:进入fastethernet 0/5的接口配置模式SWITCH(config-if)# switch access vlan 10注:将fastethernet 0/5端口加入vlan 10中SWITCH(config-if)# interface fastethernet 0/15注:进入fastethernet 0/15的接口配置模式SWITCH(config-if)# switch access vlan 20注:将fastethernet 0/15端口加入vlan 20中SWITCH(config-if)# interface fastethernet0/24注:进入fastethernet 0/24的接口配置模式SWITCH(config-if)# switchport mode trunk注:将fastethernet 0/24设为tag vlan模式交换机S2126G:SWITCH#configureterminal注:进入交换机全局配置模式SWITCH(config)# vlan 10注:创建vlan 10SWITCH(config-vlan)# nametest10注:将Vlan 10命名为test10SWITCH(config-if)# interface fastethernet 0/5注:进入fastethernet0/5的接口配置模式SWITCH(config-if)# switch access vlan 10注:将fastethernet 0/5端口加入vlan 10中SWITCH(config-if)# interface fastethernet 0/24 注:进入fastethernet 0/24的接口配置模式SWITCH(config-if)# switchportmode trunk注:将fastethernet 0/24设为tag vlan模式实验过程ﻩ分别在两台交换机上做如上配置验证命令:show vlans how int f0/24 switchport实验结果P C1与PC3地址都设成192.168.10.0/24的地址.P C2地址都设成192.168.20.0/24的地址.当PC1与PC3都分别接在两台交换机的fas t 0/5 时,即在同一V lan 中,可互相p in g 通,当PC2与PC1,P C3不在同一vlan 中则不通。
ﻬ实验三 生成树协议1.生成树-802.1D网络拓扑实验项目ﻩ生成树协议802.1D 测试实验环境ﻩ用两台支持802.1d 的交换机用两条双绞线互联。
实验配置S2126G#configure te rminal注:进入全局配置模式 STAR-S2126GSTAR-S2126GS2126G(config)#spanning-tree注:启用交换机生成树协议S2126G(config)#spanning-tree mode stp注:将交换机生成树模式设置为802.1dS2126G(config)#end注:返回特权模式S2126G#show spanning-tree注:显示交换机生成树协议的状态S2126G#show spanning-tree interface fastethernet 0/2注:显示交换机fastethernet 0/2端口的生成树状态实验过程在一台非根S2126上执行上述命令后过1分钟,用show spanning-tree inter face fast0/2 ,show spanning-treeinterface fast 0/4查看,并查看S2126G的相应端口,这四个端口中应有一个端口处于discarding状态,其余端口处于forwarding状态实验结果ﻩ当有两个端口都连在一个共享介质上,交换机会选择一个高优先级(数值小)的端口进入forwarding状态,低优先级(数值大)的端口进入discarding状态。
如果两个端口的优先级一样,就选端口号小的那个进入forwarding状态。
辅助命令1.S2126G(config)#spanning-tree priority <0-61440>注:配置交换机优先级,“0”或“4096”的倍数(RSTPBPDU该值后12bit全0)2.S2126G(config-if)#spanning-tree port-priority <0-240>注:配置交换机端口优先级,“0”或“16”的倍数(RSTP BPDU该值后4bit全0)2.生成树-802.1W网络拓扑STAR-S2126G STAR-S2126Gﻩ实验项目ﻩ快速生成树802.1W测试实验环境ﻩ用一台支持802.1w的交换机与STAR-S2126G交换机用两条双绞线互联(这里用两台STAR-S2126G为例,分别连接在0/2、0/4口)实验配置S2126G#configure terminal注:进入全局配置模式S2126G(config)#spanning-tree注:启用交换机生成树协议S2126G(config)#spanning-tree mode rstp注:将交换机生成树模式设置为802.1wS2126G(config)#end注:返回特权模式S2126G#show spanning-tree注:显示交换机生成树协议的状态S2126G#show spanning-tree interface fastethernet 0/2注:显示交换机fastethernet 0/2端口的生成树状态实验过程在一台非根S2126G上执行上述命令后过5秒,用show spanning-tree interfac e fast 0/2 ,show spanning-tree interface fast 0/4查看,应为一个端口StpPortState应处于discarding,另一端口StpPortState应处于fo rwarding状态实验结果当有两个端口都连在一个共享介质上,交换机会选择一个高优先级(数值小)的端口进入forwarding状态,低优先级(数值大)的端口进入discarding状态。