交换机
一、通过web进行基本配置
1.配置实例
我们还以上海机房的布局来讲解,图中核心交换机分别配置了3个网段30.0;60.0;70.0。由防火墙的GE0/0/2口作为trunk口接核心交换机的GE0/0/4口。
目的:在核心交换机上配置,实现各个网段和各网段下PC机能够互通
配置思路:
a. 创建vlan并将接口加入vlan;
b. 创建vlanif接口并配置IP地址,实现相邻设备网络互通;还能保证我用这几个vlanif 的IP可以访问交换机
c. 在各pc上配置缺省网关;
d. 在交换机上配置静态缺省路由,实现不通网段pc之间可以通信。
操作步骤
a.批量创建vlan30;vlan60;vlan70
此处可直接用逗号隔开添加多个vlan
b.将GE0/0/4接口类型调整为trunk,并加入3个vlan。
先将页面切换为经典版
默认是acess类型
这里我们加入全部vlan所以使用默认1-4094。
c.给每个vlan配置接口,在access口中选中所需的接口加入到指定vlan
d.创建vlanif,注意此处的vlanif ip与防火墙上vlanif ip做区别
e.配置缺省静态路由保证交换机能够访问外网(防火墙设置之后这里就无需配置)
目的IP地址与目的IP掩码设置为0.0.0.0,设置下一跳。其他默认
二、交换机堆叠
交换机堆叠的作用
交换机堆叠可应用于多个场景,包括提高可靠性、扩展端口数量、增大带宽、简化组网。
应用实例
如图1所示,根据用户需求,SwitchA、SwitchB和SwitchC三台接入交换机采用环形堆叠组网。我们介绍这里的三台设备堆叠.其中,SwitchA、SwitchB和SwitchC的角色分别为主、备、从,堆叠ID分别为0、1、2,优先级分别为200、100、100。由于组成堆叠的成员交换机在逻辑上是一个整体,所以整个网络在扩展了端口数量的同时也方便了用户对网络的管理和维护。
类似左边的图,注意相邻设备的堆叠口需要交错相接,在平时操作时可能交换机没有配堆叠卡,我们这里介绍使用业务口配置堆叠的方式
配置思路
1.为了能够在堆叠的成员交换机之间转发数据报文,需要配置逻辑堆叠端口,并添加物理成员端口。
2.为方便用户管理,配置成员交换机的堆叠ID和优先级。
3.SwitchA、SwitchB、SwitchC下电。按照图1所示,使用光纤线和堆叠电缆连接各物理成员端口后再上电。
操作步骤
1.配置逻辑堆叠端口并加入物理成员端口
配置SwitchA的业务口GigabitEthernet0/0/27、GigabitEthernet0/0/28为物理成员端口,并加入到相应的逻辑堆叠端口。
system-view
[HUAWEI] sysname SwitchA
[SwitchA] interface stack-port 0/1 创建堆叠口1
[SwitchA-stack-port0/1] port interface gigabitethernet 0/0/27 enable
Warning: Enabling stack function may cause configuration loss on the interface. Continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait.
[SwitchA-stack-port0/1] quit
[SwitchA] interface stack-port 0/2 创建堆叠口2
[SwitchA-stack-port0/2] port interface gigabitethernet 0/0/28 enable
Warning: Enabling stack function may cause configuration loss on the interface. Continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait.
[SwitchA-stack-port0/2] quit
switchB与switchC的配置同A;
2.配置堆叠ID和堆叠优先级
配置SwitchA的堆叠优先级为200。
[SwitchA] stack slot 0 priority 200
Warning: Please do not frequently modify Priority because it will make the stack split. Continue? [Y/N]:y
Switch A的堆叠ID为默认为0。
配置SwitchB的堆叠ID为1。
[SwitchB] stack slot 0 renumber 1
Warning: All the configurations related to the slot ID will be lost after the slot ID is modified.
Please do not frequently modify slot ID because it will make the stack split. Continue? [Y/N]:y
Info: Stack configuration has been changed, and the device needs to restart to make the configuration effective.
配置SwitchC的堆叠ID为2。
[SwitchC] stack slot 0 renumber 2
Warning: All the configurations related to the slot ID will be lost after the slot ID is modified.
Please do not frequently modify slot ID because it will make the stack split. Continue? [Y/N]:y
Info: Stack configuration has been changed, and the device needs to restart to make the configuration effective.
3.SwitchA、SwitchB、SwitchC下电,使用SFP(光口)+电缆连接后再上电。
4.验证配置结果
查看堆叠系统的基本信息。
[SwitchA] display stack
Stack mode: Service-port
Stack topology type : Ring
Stack system MAC: 0018-82d2-2e85
MAC switch delay time: 10 min
Stack reserved vlan : 4093
Slot of the active management port: --
Slot Role Mac address Priority Device type
0 Master 0018-82d2-2e85 200 S5720-28P-LI-AC
1 Standby 0018-82c6-1f44 100 S5720-28P-LI-AC
2 Slave 0018-82c6-1f4c 100 S5720-28P-LI-AC
评论区