综合练习二
题目:
范图
实现各网段的主机之间互通
且走最优路径
配置思路:
实现此案例按照如下配置:
1)配置PC的IP地址和网关
2) 配置SW4/5的vlan为10/20/30/40/100/200,交换机之间的链路为Trunk,与PC间为Access
3)配置RSW1/2/3的vlan为10/20/30/40/100/200,交换机之间的链路为Trunk,与PC间为Access
rsw1:
[rsw1]interfaceGigabitEthernet0/0/1[rsw1-GigabitEthernet0/0/1]portlink-typeaccess[rsw1-GigabitEthernet0/0/1]portdefaultvlan10[rsw1-GigabitEthernet0/0/1]q连接交换机的端口模式设置:[rsw1]port-groupgroup-memberg0/0/12g0/0/21[rsw1-port-group]portlink-typetrunk[rsw1-GigabitEthernet0/0/12]portlink-typetrunk[rsw1-GigabitEthernet0/0/21]portlink-typetrunk[rsw1-port-group]q[rsw1]port-groupgroup-memberg0/0/12g0/0/21[rsw1-port-group]portlink-typetrunk[rsw1-GigabitEthernet0/0/12]portlink-typetrunk[rsw1-GigabitEthernet0/0/21]portlink-typetrunk[rsw1-port-group]porttrunkallow-passvlanall[rsw1-GigabitEthernet0/0/12]porttrunkallow-passvlanall[rsw1-GigabitEthernet0/0/21]porttrunkallow-passvlanall[rsw1-port-group]q
rsw2:
[rsw2]port-groupgroup-memberg0/0/12g0/0/22g0/0/23[rsw2-port-group]portlink-typetrunk[rsw2-GigabitEthernet0/0/12]portlink-typetrunk[rsw2-GigabitEthernet0/0/22]portlink-typetrunk[rsw2-GigabitEthernet0/0/23]portlink-typetrunk[rsw2-port-group]porttrunkallow-passvlanall[rsw2-GigabitEthernet0/0/12]porttrunkallow-passvlanall[rsw2-GigabitEthernet0/0/22]porttrunkallow-passvlanall[rsw2-GigabitEthernet0/0/23]porttrunkallow-passvlanall[rsw2-port-group]q
rsw3:
[rsw3]intg0/0/5[rsw3-GigabitEthernet0/0/5]portlink-typeaccess[rsw3-GigabitEthernet0/0/5]portdefaultvlan40[rsw3-GigabitEthernet0/0/5]q[rsw3]port-groupgroup-memberg0/0/23g0/0/1[rsw3-port-group]portlink-typetrunk[rsw3-GigabitEthernet0/0/23]portlink-typetrunk[rsw3-GigabitEthernet0/0/1]portlink-typetrunk[rsw3-port-group]porttrunkallow-passvlanall[rsw3-GigabitEthernet0/0/23]porttrunkallow-passvlanall[rsw3-GigabitEthernet0/0/1]porttrunkallow-passvlanall[rsw3-port-group]q
5)配置RSW1/2/3的vlanif接口IP地址及静态路由
rsw1:
[rsw1]intvlanif10[rsw1-Vlanif10]ipaddress192.168.10.25424//设置网关ip[rsw1-Vlanif10]intvlanif100[rsw1-Vlanif100]ipaddress192.168.12.124
rsw2:
[rsw2]intvlanif100[rsw2-Vlanif100]ipaddress192.168.12.224[rsw2-Vlanif100]intvlanif200[rsw2-Vlanif200]ipaddress192.168.23.124[rsw2-Vlanif200]intvlanif20[rsw2-Vlanif20]ipaddress192.168.20.25424[rsw2-Vlanif20]q[rsw2]iproute-static192.168.10.024192.168.12.1[rsw2]iproute-static192.168.30.024192.168.23.2[rsw2]iproute-static192.168.40.024192.168.23.2
rsw3:
[rsw3]intvlanif30[rsw3-Vlanif30]ipaddress192.168.30.25424[rsw3-Vlanif30]intvlanif40[rsw3-Vlanif40]ipaddress192.168.40.25424[rsw3-Vlanif40]intvlanif200[rsw3-Vlanif200]ipadd192.168.23.224[rsw3-Vlanif200]q
6)配置 mstp 及对应的根交换机
rsw1:
[rsw1]stpmodemstp//设置模式为mstp[rsw1]stpregion-configuration//进入设置域[rsw1-mst-region]region-namezh//设置域名[rsw1-mst-region]instance10vlan10//设置实例,并加入对应vlan[rsw1-mst-region]instance20vlan20[rsw1-mst-region]instance30vlan30[rsw1-mst-region]instance40vlan40[rsw1-mst-region]activeregion-configuration//激活实例名[rsw1]stpinstance10priority0//设置实例10 的优先级,为根交换机
rsw2:
[rsw2]stpmodemstp[rsw2]stpregion-configuration[rsw2-mst-region]region-namezh[rsw2-mst-region]instance10vlan10[rsw2-mst-region]instance20vlan20[rsw2-mst-region]instance30vlan30[rsw2-mst-region]instance40vlan40[rsw2-mst-region]activeregion-configuration[rsw2]stpinstance20priority0
rsw3:
[rsw3]stpmodemstp[rsw3]stpregion-configuration[rsw3-mst-region]region-namezh[rsw3-mst-region]instance10vlan10[rsw3-mst-region]instance20vlan20[rsw3-mst-region]instance30vlan30[rsw3-mst-region]instance40vlan40[rsw3-mst-region]activeregion-configuration[rsw3]stpinstance30priority0[rsw3]stpinstance40priority0
7)测试不同网段的PC连通性
8)查看命令
[rsw1]displaycurrent-configuration//查看设备所有配置[rsw1]displaystp//查看stp所有配置[rsw1]displaystpbrief//查看stp简要配置[rsw1]dispalystpinstance10brief//查看实例10 的简要配置[rsw1]dismac-address//查看Mac地址[rsw1]displaythis//查看当前有效配置<rsw1>saversw1.zip//保存当前配置为rsw1.zip文件<rsw1>dir//查看当前的文件