Zoning Your Brocade Switches using CLI – Step by Step (when java just won’t work)

By | February 19, 2018

Have you ever needed to log into a web application to manage your hardware and the application stopped working cause you update your Java to a version that is now incompatible with the web application. I can’t think of anyone I know that hasn’t had this problem and needed to resort to CLI to get your job gone.

Below I’m going to cover Step by Step instructions on zoning your Brocade switch when Web Tools and/or Brocade Network Adviser is not available.

Outline of Steps
1. Backup the Switch Configuration
2. Create Aliases
3. Create Zones
4. Add Zones to a New or Existing Zone Configuration
5. Save the Config
6. Enable the New/Updated Zone Configuration

1. Backup the Switch Configuration
The most important step is making a backup of the switches existing configuration in case a roll back is needed. Don’t make changes to the switch configuration without having a backup. It will save your job and a lot of cleanup if you have an issue.
You will either need an FTP site to upload to or a USB stick to save the config on.

FTP Option:
Either use your companies FTP site or you can run FileZilla Server on your desktop. If you use FileZilla, just install with the defaults and create a user with a password.
Download FileZilla Server here: https://filezilla-project.org/

USB Storage Option:
If FTP is not an option, saving the configuration to a USB flash drive is pretty simple. You will need to run a command to enable the USB port on the switch. See below.

To enable an attached USB device (type cmd all lowercase):
switch:admin> usbstorage -e
USB storage enabled
———————————————-
Couple Extra CMD’s to keep handy
———————————————-
To list the contents of the attached USB device:
switch:admin> usbstorage –l

To disable an attached USB device:
switch:admin> usbstorage -d
USB storage disable
————————

Ok, with all that said, to upload the switch configuration interactively from a switch that is not enabled for Virtual Fabrics:

switch:admin> configupload
Protocol (scp, ftp, sftp, local) [ftp]: sftp
Server Name or IP Address [host]: 192.168.38.245
User Name [user]: jdoe
File Name [/config.txt]:
Section (all|chassis|switch [all]):
Password: ******
configUpload complete: All config parameters are uploaded configupload to USB

configupload to USB

2. Create Aliases for your WWN’s
I create aliases for my host and storage WWN’s for when I’m doing “Soft Zoning”, which is zoning host to storage by WWN. When I do “Hard Zoning”, which is zoning by port, I skip this step. It’s totally up to you. For Hard Zoning/Port Zoning I like to name the port instead.

Before I get into the example, you’ll need to know the DID or the Domain ID of the switch (THIS IS ONLY FOR HARD ZONING). To do that you need to run the following “switchshow” or “fabricshow” command.

Creating Aliases for WWN (Soft Zoning)
Fabric A:
switch:admin> alicreate “Host_HBA1”, “50:01:11:22:33:aa:bb:cc”
switch:admin> alicreate “VNX5400_SPA0”, “50:06:01:60:A1:B2:C3:D4”
switch:admin> alicreate “VNX5400_SPB1”, “50:06:01:69:A1:B2:C3:D4”
Fabric B:
switch:admin> alicreate “Host_HBA2”, “50:01:11:22:33:aa:bb:00”
switch:admin> alicreate “VNX5400_SPA1”, “50:06:01:61:A1:B2:C3:D4”
switch:admin> alicreate “VNX5400_SPB0”, “50:06:01:68:A1:B2:C3:D4”

3. Create Zones (Adding the Aliases or Ports as members of a zone)
Now we are going to create zones using the aliases from the WWN’s in step #2 or we are going to add the DID/Port# as members of the zone. This is the part that says only allow these two WWN’s to talk to one another or hosts/devices plugged into specific ports to talk to one another. When were done that commands are saying Host_HBA1 (orange) can talk to VNX5400_SPA0 & VNX5400_SPB1 and Host_HBA2 (blue) can talk to VNX5400_SPA1 & VNX5400_SPB0.

Creating Zones for WWN’s with Aliases (Soft Zoning)
Fabric A:
switch:admin> zonecreate “Host_HBA1_VNX5400_SPA0”, “Host_HBA1; VNX5400_SPA0”
switch:admin> zonecreate “Host_HBA1_VNX5400_SPB1”, “Host_HBA1; VNX5400_SPB1”
Fabric B:
switch:admin> zonecreate “Host_HBA2_VNX5400_SPA1”, “Host_HBA2; VNX5400_SPA1”
switch:admin> zonecreate “Host_HBA2_VNX5400_SPB0”, “Host_HBA2; VNX5400_SPB0”

Creating Zones for Port Zoning (Hard Zoning)
Refer to the beginning paragraph of step #3 to know how to find the Domain ID.
Fabric A:
switch:admin> zonecreate “Host_HBA1_VNX5400_SPA0”, “2,10; 2,20”
(2 is the domain ID of the SW, 10 is the port # of HBA1, 20 is the port # of storage controller A0)
switch:admin> zonecreate “Host_HBA1_VNX5400_SPB1”, “2,10; 2,21”
(2 is the domain ID of the SW, 10 is the port # of HBA1, 21 is the port # of storage controller B1)
Fabric B:
switch:admin> zonecreate “Host_HBA2_VNX5400_SPA1”, “3,11; 3,22”
(3 is the domain ID of the SW, 11 is the port # of HBA2, 22 is the port # of storage controller A1)
switch:admin> zonecreate “Host_HBA2_VNX5400_SPB0”, “3,11; 3,23”
(3 is the domain ID of the SW, 11 is the port # of HBA2, 23 is the port # of storage controller B0)

4. Add Zones to a New or Existing Zone Configuration
Adding Zones to a new of existing zone configuration is pretty straight forward. If you are creating a brand new configuration to add your zones you just created then you use the cfgcreate command. If you have an existing configuration that you just want to add additional zones to you will use the cfgadd command.

Adding New Zones to a Brand New Configuration
switch:admin> cfgcreate “Brand_New_CFG”, “Host_HBA1_VNX5400_SPA0; Host_HBA1_VNX5400_SPB1; Host_HBA2_VNX5400_SPA1; Host_HBA2_VNX5400_SPB0”

Adding New Zones to an EXISTING Effictive (Enabled) Configuration
switch:admin> cfgadd “Name_of_Existing_CFG”, “Host_HBA1_VNX5400_SPA0; Host_HBA1_VNX5400_SPB1; Host_HBA2_VNX5400_SPA1; Host_HBA2_VNX5400_SPB0”

If you are not sure what the configuration name is run cfgshow. The Effective Configuration will be at the end of the list of Defined Configurations which are all the configurations that have been created and saved.

5. Save your Configuration
For the description of this step/command, I’m going to quote from the Brocade Command Line Reference because I just couldn’t say it better.

“Use this command to save the current zone configuration. This command writes the defined configuration and the name of the effective configuration to nonvolatile memory in all switches in the fabric.
The saved configuration is automatically reloaded at power on, and, if a configuration was in effect at the time it was saved, the same configuration is reinstalled with an automatic cfgEnable command.
Because the saved configuration is reloaded at power on, only valid configurations are saved. The cfgSave command validates the effective configuration by performing the same tests as the cfgEnable command. If the tests fail, an error message is displayed and the configuration is not saved.
This command ends and commits the current transaction. If a transaction is open on a different switch in the fabric when this command is run, the transaction on the other switch is automatically aborted. A message displays on the other switches to indicate that the transaction was aborted.
If there are open transactions in the fabric, only single transaction can be saved. Use the cfgtransshow –opentrans command to view the list of all the domains in the fabric with open transactions.” – Fabric OS Command Reference, 7.4.1

Saving Your Work
switch:admin> cfgsave

6. Save your Configuration
Again, I’m going to quote from the Brocade Command Line Reference for the description of running the command Configuration Enable (cfgenable).

“Use this command to enable a zone configuration. The command builds the specified zone configuration.
It checks for undefined zone names, zone alias names, or other inconsistencies, by expanding zone aliases, removing duplicate entries, and then installing the effective configuration.
If the build fails, the previous state is preserved (zoning remains disabled, or the previous effective configuration remains in effect). If the build succeeds, the new configuration replaces the previous configuration. Refer to the cfgShow command for a description of the defined and effective configurations.” – Fabric OS Command Reference, 7.4.1

Enabling the Configuration that You Want Running
switch:admin> cfgenable “Brand_New_CFG”
OR
switch:admin> cfgenable “Name_of_Existing_CFG”

Summary
Well there you have it! You just created a new enabled switch configuration or you updated and existing configuration with additional aliases and zones. Great job!

So what does this look like all glued together without all my commentary? Below is a sample of commands for the switch for Fabric A in consecutive order.

NOTE: This is for a brand new configuration.
Fabric A: SOFT ZONING
switch:admin> alicreate “Host_HBA1”, “50:01:11:22:33:aa:bb:cc”
switch:admin> alicreate “VNX5400_SPA0”, “50:06:01:60:A1:B2:C3:D4”
switch:admin> alicreate “VNX5400_SPB1”, “50:06:01:69:A1:B2:C3:D4”
switch:admin> zonecreate “Host_HBA1_VNX5400_SPA0”, “Host_HBA1; VNX5400_SPA0”
switch:admin> zonecreate “Host_HBA1_VNX5400_SPB1”, “Host_HBA1; VNX5400_SPB1”
switch:admin> cfgcreate “Brand_New_CFG”, “Host_HBA1_VNX5400_SPA0; Host_HBA1_VNX5400_SPB1; Host_HBA2_VNX5400_SPA1; Host_HBA2_VNX5400_SPB0”
switch:admin> cfgsave
switch:admin> cfgenable “Brand_New_CFG”

Fabric A: HARD ZONING
switch:admin> zonecreate “Host_HBA1_VNX5400_SPA0”, “2,10; 2,20”
switch:admin> zonecreate “Host_HBA1_VNX5400_SPB1”, “2,10; 2,21”
switch:admin> cfgcreate “Brand_New_CFG”, “Host_HBA1_VNX5400_SPA0; Host_HBA1_VNX5400_SPB1; Host_HBA2_VNX5400_SPA1; Host_HBA2_VNX5400_SPB0”
switch:admin> cfgsave
switch:admin> cfgenable “Brand_New_CFG”

I hope you have found this helpful. Let me know if you have questions or saw an error in this tutorial.

2 thoughts on “Zoning Your Brocade Switches using CLI – Step by Step (when java just won’t work)

  1. Deccan Ninja

    Very effectively written steps, I’ve worked on Brocade for a while now but no pages have described zoning this close. TY.

  2. Arefat Mohammed

    how to configure zoning in brocade 6505 step by step

Comments are closed.