华为交换机配置堆叠

 基本配置堆叠

(1)、配置SW1:
[SW1]interface stack-port 0/1                                                                        //创建逻辑堆叠口1
[SW1-stack-port0/1]port interface XGigabitEthernet 0/0/3 enable                   //绑定逻辑端口和物理端口
[SW1]q
[SW1]interface stack-port 0/2
[SW1-stack-port0/2]port interface XGigabitEthernet 0/0/4 enable
[SW1]q
[SW1]stack slot0 priority 200                                                                          //修改主交换机的堆叠优先级为200,默认是100。堆叠ID采用缺省值0。
<SW1>save force                                                                                        //保存配置。然后下电
(2)、配置SW2:
[SW2]interface stack-port 0/1
[SW2-stack-port0/1]port interface XGigabitEthernet 0/0/3 enable
[SW2]q
[SW2]interface stack-port 0/2
[SW2-stack-port0/2]port interface XGigabitEthernet 0/0/4 enable
[SW2]q
[SW2]stack slot0 renumber 1                                                                           //堆叠优先级采用缺省值100。修改堆叠ID为1。
<SW2>save force                                                                                          //保存配置。然后下电

注:与华三交换机不同,华为备交换机是先把逻辑口和堆叠口绑定,然后再改number号。且备交换机创建的逻辑端口与主交换的逻辑端口一致。
(3)、下电,然后连接光纤,sw1的51口连接sw2的52口;sw1的52口连接sw2的51口。
(4)、先给主交换机SW1加电,然后再启动备交换机SW2

display stack // 查看堆叠系统的基本信息


删除堆叠
​[STSW1]interface stack-port 0/1

​[STSW1-stack-port0/1]shutdown i g0/0/28

[STSW1-stack-port0/1]undo port interface GigabitEthernet 0/0/28 enable
 一、搭建堆叠环境

这里以搭建堆叠AGG1为例,AGG2的搭建和配置过程与AGG1相同

a.按照数据规划分别对两台盒式交换机进行配置
<HUAWEI> system-view 
[HUAWEI] sysname Switch1 
[Switch1] interface stack-port 0/1 
[Switch1-stack-port0/1] port interface xgigabitethernet 0/0/3 xgigabitethernet 0/0/4 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......   
[Switch1-stack-port0/1] quit 
[Switch1] stack slot 0 priority 150    //优先级设置为150,使其成为堆叠主
Warning: Do not frequently modify the priority because it will make the stack split. Continue? [Y/N]:y
[Switch1] quit 
<Switch1> save  //堆叠相关的配置不需要保存,会自动写入flash。为防止其他配置丢失,这里建议执行save命令进行保存
The current configuration will be written to flash:/vrpcfg.zip.                                                                     
Are you sure to continue?[Y/N]y                                                                                                     
Now saving the current configuration to the slot 0.......                                                                           
Save the configuration successfully.
<HUAWEI> system-view 
[HUAWEI] sysname Switch2 
[Switch2] interface stack-port 0/2   //逻辑堆叠口1只能和逻辑堆叠口2相连,所以这里需要配置为逻辑堆叠口2
[Switch2-stack-port0/2] port interface xgigabitethernet 0/0/3 xgigabitethernet 0/0/4 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......   
[Switch2-stack-port0/2] quit 
[Switch2] stack slot 0 renumber 1  //设置堆叠ID为1,使用缺省的堆叠优先级100
Warning: All the configurations related to the slot ID will be lost after the slot ID is modified.                                  
Do not frequently modify the 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. 
[Switch2] quit 
<Switch2> save  //堆叠相关的配置不需要保存,会自动写入flash。为防止其他配置丢失,这里建议执行save命令进行保存
The current configuration will be written to flash:/vrpcfg.zip.                                                                     
Are you sure to continue?[Y/N]y                                                                                                     
Now saving the current configuration to the slot 0.......                                                                           
Save the configuration successfully.
b.交换机下电,根据下面连线图连线堆叠线缆和多主检测线缆

 

c.交换机重启后,查看堆叠是否组建成功
<Switch1> display stack  //堆叠组建成功,switch1是堆叠主 
Stack mode: Service-port 
Stack topology type : Ring 
Stack system MAC: 00e0-fc12-2355 
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      00e0-fc12-2355   150        S5720-56C-HI-AC     
   1     Standby     00e0-fc12-2356   100        S5720-56C-HI-AC 
<Switch1> system-view 
[Switch1] sysname AGG1   //为便于记忆,修改堆叠系统的设备名
d.堆叠组建完成,配置多主检测

堆叠组建完成后,为防止堆叠故障分裂导致多主影响业务,在两台交换机直接连接一条线缆,用于多主检测。线缆对应的接口分别为GE0/0/10和GE1/0/10

[AGG1] interface gigabitethernet 0/0/10 
[AGG1-GigabitEthernet0/0/10] mad detect mode direct 
Warning: This command will block the port, and no other configuration running on this port is recommended. Continue?[Y/N]:y 
[AGG1-GigabitEthernet0/0/10] quit
[AGG1] interface gigabitethernet 1/0/10 
[AGG1-GigabitEtherne/1/0/10] mad detect mode direct 
Warning: This command will block the port, and no other configuration running on this port is recommended. Continue?[Y/N]:y 
[AGG1-GigabitEthernet1/0/10] return
<AGG1> display mad verbose   //查看多主检测配置
Current MAD domain: 0               
Current MAD status: Detect             
Mad direct detect interfaces configured:        
 GigabitEthernet0/0/10                
 GigabitEthernet1/0/10               
Mad relay detect interfaces configured:          
Excluded ports(configurable):                 
Excluded ports(can not be configured):
二、配置集群和堆叠之间的Eth-Trunk接口,以及堆叠和接入层交换机之间的Eth-Trunk接口
a.在堆叠AGG1上配置Eth-Trunk接口
<AGG1> system-view 
[AGG1] interface eth-trunk 10  //创建与集群相连的Eth-Trunk接口
[AGG1-Eth-Trunk10] mode lacp
[AGG1-Eth-Trunk10] quit 
[AGG1] interface xgigabitethernet 0/0/1 
[AGG1-XGigabitEthernet0/0/1] eth-trunk 10 
[AGG1-XGigabitEthernet0/0/1] quit 
[AGG1] interface xgigabitethernet 1/0/1 
[AGG1-XGigabitEthernet1/0/1] eth-trunk 10 
[AGG1-XGigabitEthernet1/0/1] quit
[AGG1] interface eth-trunk 30  //创建与接入层交换机ACC1相连的Eth-Trunk接口
[AGG1-Eth-Trunk30] mode lacp
[AGG1-Eth-Trunk30] quit 
[AGG1] interface gigabitethernet 0/0/3 
[AGG1-GigabitEthernet0/0/3] eth-trunk 30 
[AGG1-GigabitEthernet0/0/3] quit 
[AGG1] interface gigabitethernet 1/0/3 
[AGG1-GigabitEthernet1/0/3] eth-trunk 30 
[AGG1-GigabitEthernet1/0/3] quit
b.在堆叠AGG2上配置Eth-Trunk接口
<AGG2> system-view 
[AGG2] interface eth-trunk 20  //创建与集群相连的Eth-Trunk接口
[AGG2-Eth-Trunk20] mode lacp
[AGG2-Eth-Trunk20] quit 
[AGG2] interface xgigabitethernet 0/0/1 
[AGG2-XGigabitEthernet0/0/1] eth-trunk 20 
[AGG2-XGigabitEthernet0/0/1] quit 
[AGG2] interface xgigabitethernet 1/0/1 
[AGG2-XGigabitEthernet1/0/1] eth-trunk 20 
[AGG2-XGigabitEthernet1/0/1] quit
[AGG2] interface eth-trunk 40  //创建与接入层交换机ACC2相连的Eth-Trunk接口
[AGG2-Eth-Trunk40] mode lacp
[AGG2-Eth-Trunk40] quit 
[AGG2] interface gigabitethernet 0/0/3 
[AGG2-GigabitEthernet0/0/3] eth-trunk 40 
[AGG2-GigabitEthernet0/0/3] quit 
[AGG2] interface gigabitethernet 1/0/3 
[AGG2-GigabitEthernet1/0/3] eth-trunk 40 
[AGG2-GigabitEthernet1/0/3] quit
c.在接入层交换机ACC1上配置Eth-Trunk接口
<ACC1> system-view 
[ACC1] interface eth-trunk 30  //创建与堆叠AGG1相连的Eth-Trunk接口
[ACC1-Eth-Trunk30] mode lacp
[ACC1-Eth-Trunk30] quit 
[ACC1] interface gigabitethernet 0/0/1 
[ACC1-GigabitEthernet0/0/1] eth-trunk 30 
[ACC1-GigabitEthernet0/0/1] quit 
[ACC1] interface gigabitethernet 0/0/2 
[ACC1-GigabitEthernet0/0/2] eth-trunk 30 
[ACC1-GigabitEthernet0/0/2] quit
d.在接入层交换机ACC2上配置Eth-Trunk接口
<ACC2> system-view 
[ACC2] interface eth-trunk 40  //创建与堆叠AGG2相连的Eth-Trunk接口
[ACC2-Eth-Trunk40] mode lacp
[ACC2-Eth-Trunk40] quit 
[ACC2] interface gigabitethernet 0/0/1 
[ACC2-GigabitEthernet0/0/1] eth-trunk 40 
[ACC2-GigabitEthernet0/0/1] quit 
[ACC2] interface gigabitethernet 0/0/2 
[ACC2-GigabitEthernet0/0/2] eth-trunk 40 
[ACC2-GigabitEthernet0/0/2] quit
三、配置文件 

AGG1堆叠配置文件

# 
sysname AGG1
# 
interface Eth-Trunk10 
 mode lacp
# 
interface Eth-Trunk30
 mode lacp
# 
interface GigabitEthernet0/0/3 
 eth-trunk 30 
# 
interface GigabitEthernet0/0/10 
 mad detect mode direct 
# 
interface GigabitEthernet1/0/3 
 eth-trunk 30 
# 
interface GigabitEthernet1/0/10 
 mad detect mode direct 
# 
interface XGigabitEthernet0/0/1 
 eth-trunk 10 
# 
interface XGigabitEthernet1/0/1 
 eth-trunk 10 
# 
return

AGG2堆叠配置文件

# 
sysname AGG2
# 
interface Eth-Trunk20 
 mode lacp
# 
interface Eth-Trunk40
 mode lacp
# 
interface GigabitEthernet0/0/3 
 eth-trunk 40  
# 
interface GigabitEthernet0/0/10 
 mad detect mode direct 
# 
interface GigabitEthernet1/0/3 
 eth-trunk 40 
# 
interface GigabitEthernet1/0/10 
 mad detect mode direct 
# 
interface XGigabitEthernet0/0/1 
 eth-trunk 20 
# 
interface XGigabitEthernet1/0/1 
 eth-trunk 20 
# 
return

ACC1配置文件

# 
sysname ACC1
# 
interface Eth-Trunk30
 mode lacp
# 
interface GigabitEthernet0/0/1 
 eth-trunk 30 
# 
interface GigabitEthernet0/0/2 
 eth-trunk 30 
# 
return

ACC2配置文件

# 
sysname ACC2
# 
interface Eth-Trunk40
 mode lacp
# 
interface GigabitEthernet0/0/1 
 eth-trunk 40 
# 
interface GigabitEthernet0/0/2 
 eth-trunk 40 
# 
return

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值