需求:
划分2个zone,接入两个不同业务群集。
环境:
华为光纤交换机SNS2124
IOIO:串口,只用于串口登录 admin/Hawei12#$
有网络图标的口:管理口,管理地址10.77.77.77,http://10.77.77.77 admin/Hawei12#$,连接网线可通过ssh登录。使用ipaddrset命令修改地址。
注意:按照第一步至第六步即可完成配置,如修过别名或zone成员需cfgenable “Zone_Config”
配置:
一般有两种方式进行配置,以端口和WWN为zone成员两种方式,以下按端口方式配置光纤交换机:
一、创建别名(如果接口较少,可以不用创建别名),首先switchshow命令查看DomianID和Index,参见第八步。
alicreate "CunCHu_Master","1,0" #"1,0",1为DomianID,0为Index(也就是端口)
alicreate "CunCHu_Backup","1,1"
alicreate "RenDa_Master","1,2"
alicreate "RenDa_Backup","1,3"
alicreate "DaMeng_Master","1,4"
alicreate "DaMeng_Backup","1,5"
alicreate "SHenTong_Master","1,6"
alicreate "SHenTong_Backup","1,7"
alicreate "Data_Backup1","1,8"
alicreate "Data_Backup2","1,9"
alicreate "Data_Backup3","1,10"
alicreate "Data_Backup4","1,11"
alicreate "Data","1,23;1,22;1,21;1,20;1,19" #也可以一个别名添加多个端口,当然也可以不创建别名。
二、创建zone
已创建别名则可按照"别名;Domain,Index;别名;Domain,Index;",
未创建别名则可按照"Domain,Index;Domain,Index;
zonecreate "My_zone1","CunCHu_Master;1,0;CunCHu_Backup;1,1;RenDa_Master;1,2;RenDa_Backup;1,3;DaMeng_Master;1,4;DaMeng_Backup;1,5;SHenTong_Master;1,6;SHenTong_Backup;1,7"
zoneadd "My_zone1","Data_Backup1;1,8;Data_Backup2;1,9;Data_Backup3;1,10;Data_Backup4;1,11" #新增端口后,需执行cfgenable "Zone_Config"
zonecreate "My_zone2","1,23;1,22;1,21;1,20;1,19" #创建第二个zone,并且直接添加端口。
三、创建zoneconfig
cfgcreate "Zone_Config","My_zone1" #新建一个
cfgcreate "Zone_Config","My_zone1;My_zone2" #新建多个
cfgadd "Zone_Config","My_zone2" #添加zone到zone配置
四、检查是否正确
cfgshow
五、保存配置
cfgsave
六、激活zone config
cfgenable "Zone_Config"
七、查看整体配置
SNS2124:admin> cfgshow
Defined configuration:
cfg: Zone_Config
My_zone1; My_zone2
zone: My_zone1
CunCHu_Master; 1,0; CunCHu_Backup; 1,1; RenDa_Master; 1,2;
RenDa_Backup; 1,3; DaMeng_Master; 1,4; DaMeng_Backup; 1,5;
SHenTong_Master; 1,6; SHenTong_Backup; 1,7; Data_Backup1; 1,8;
Data_Backup2; 1,9; Data_Backup3; 1,10; Data_Backup4; 1,11
zone: My_zone2
1,23; 1,22; 1,21; 1,20; 1,19
alias: CunCHu_Backup
1,1
alias: CunCHu_Master
1,0
alias: DaMeng_Backup
1,5
alias: DaMeng_Master
1,4
alias: Data 1,23; 1,22; 1,21; 1,20; 1,19
alias: Data_Backup1
1,8
alias: Data_Backup2
1,9
alias: Data_Backup3
1,10
alias: Data_Backup4
1,11
alias: RenDa_Backup
1,3
alias: RenDa_Master
1,2
alias: SHenTong_Backup
1,7
alias: SHenTong_Master
1,6
Effective configuration:
cfg: Zone_Config
zone: My_zone1
1,0
1,1
1,2
1,3
1,4
1,5
1,6
1,7
1,8
1,9
1,10
1,11
zone: My_zone2
1,23
1,22
1,21
1,20
1,19
八、查看Domain ID
SNS2124:admin> switchshow
switchName: SNS2124
switchType: 71.2
switchState: Online
switchMode: Native
switchRole: Principal
switchDomain: 1 #Domain号为1。
switchId: fffc01
switchWwn: 10:00:e4:f5:7c:fe:f4:ac
zoning: ON (Zone_Config)
switchBeacon: OFF
HIF Mode: OFF
Index Port Address Media Speed State Proto
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
0 0 010000 id N8 No_Light FC
1 1 010100 id N8 No_Light FC
2 2 010200 id N8 No_Light FC #别名或zone添加端口如“1,2”,1为Domain号,2为Index号(端口号),表示物理设备端口3。
3 3 010300 id N8 No_Light FC
..........
20 20 011400 id N8 No_Light FC
21 21 011500 id N8 No_Light FC
22 22 011600 id N8 No_Light FC
23 23 011700 id N8 No_Light FC
九、官方配置文档参考
十、命令集参考
华为光纤交换机:
默认账户:admin
默认密码:Huawei12#$
查看网络接口配置:ipaddrshow
设置ip地址:ipaddrset
查看id:fabricshow
停用交换机:switchdisable
启用交换机:switchenable
设置域id:configure
设置交换机:switchname
关闭交换机:sysshutdown
启用端口:portenable
停用端口:portdisable
设置端口速率:portcfgspeed 2/3/4
保存配置:cfgsave
查看zone配置:cfgshow
激活zone配置:cfgenable "cfgname"
去激活zone配置:cfgdisable
删除cfg:cfgdelete "cfgname"
还原cfg:cfgtransabort
清楚cfg:cfgclear
创建别名:alicreate "array1","2,32;2,33;2,34;4,4" #只有级联交换机才存在不同Domain ID,其他情况只有一个Domian ID为1。
alicreate "array1","10:00:c4:f5:7c:fc:f4:ac;4,3"
添加别名成员:aliadd "array1","2,1"
添加别名成员:aliremove "array1","2,1"
删除别名:alidelete "array1"
创建zone:zonecreate "zonename","aliasnamepattern[;members]"
zonecreate "zonename","members[;members...]"
添加zone设备:zoneadd "zonename","aliasanmepattern[;members]"
zoneadd "zonename",""members[;members...]"
移除zone设备:zoneremove "zonename","aliasnamepattern[;members]"
zoneremove "zonename","members[;members...]"
删除zone:zonedelete "zonemember"
创建cfg:cfgcreate "NEWcfg","purplezone;bluezone;greenzone"
添加zone到cfg:cfgadd "cfgname","members[;members...]"
删除cfg中zone:cfgremove "cfgnme","members[;members...]"*