New User’s Guide to Configuring Cisco MDS Zones via CLI

I’m a bit new to the Cisco MDS family of Fibre Channel switches, so I’m sure that this information is “old hat” to the storage pros out there who’ve done it a million times. Hence, I’m labeling this one as a “new user” article. The topic of this post is how to use the command-line interface (CLI) to configure zones on a Cisco MDS 9000 series Fibre Channel switch.

I won’t go into great detail on the purpose of zones and that sort of thing; I’m sure it’s been covered in excruciating detail elsewhere. (Knowledgeable readers with any links to that sort of information are encouraged to share those links in the comments.) Instead, I’ll just focus on the mechanics of how it’s done.

First, create some aliases for your own use instead of having to remember the Fibre Channel World Wide Port Names (WWPNs). This will make life a lot easier, in my opinion. You create aliases using the fcalias command, like this (where applicable in this command and all other commands in this post, replace XXX with the appropriate VSAN number):

switch(config)# fcalias name stor-array-processor-a vsan XXX
switch(config-fcalias)# member pwwn AA:BB:CC:DD:EE:FF:00:11
switch(config-fclias)# exit

Obviously, you’ll replace the fake WWPN I used in the command above with the correct WWPN for that device. Repeat this process for all the storage processor ports, server HBAs, etc. From this point forward, you can use the alias in place of the WWPN when creating zones. See, isn’t that easier?

Next, create zones. Each zone should have a single initiator and (ideally) a single target, although multiple targets is usually acceptable. To create a zone, use the zone and member commands like this:

switch(config)# zone name first-new-zone vsan XXX
switch(config-zone)# member fcalias stor-array-processor-a
switch(config-zone)# member fcalias server-hba
switch(config-zone)# exit

Since each zone contains only a single initiator, you’ll need to repeat this process for each initiator.

Once you have all the zones created, next create a zoneset. You can create a new zoneset just using the zoneset command, or you can clone an existing zoneset with the zoneset clone command. In this case, I’ll clone an existing zoneset:

switch(config)# zoneset clone existing-zoneset new-zoneset vsan XXX

From here, you have a copy of the existing zoneset, which already had all the previously defined zones as members. Add the new zones you’ve defined to the zoneset like this:

switch(config)# zoneset new-zoneset vsan XXX
switch(config-zoneset)# member first-new-zone
switch(config-zoneset)# member second-new-zone
switch(config-zoneset)# exit

Finally, activate the zoneset:

switch(config)# zoneset activate name new-zoneset vsan XXX

Then save the configuration with copy runn start and you should be good to go! All you need to do now is configure and present storage from the storage array to the initiators. But that’s another topic for another post…

UPDATE: I’ve posted a follow-up to this article on managing zones via the CLI.

Tags: , , ,

  1. Dominik’s avatar

    Hi Scott,

    In a “pure” MDS9k environment I’d recommend to use (enhanced) device-alias instead of fcaliases.
    It makes life a lot easier if you’re going to use other MDS9k features (i.e. DMM)



  2. cgb’s avatar

    Hi Scott,

    I think you’ve made a typo in your two references to vlan’s in the last section of examples – it should be:

    switch(config)# zoneset new-zoneset vsan XXX
    zoneset activate name new-zoneset vsan XXX

    understandably easy to mistype :)


    Chris Bennett (cgb)

  3. slowe’s avatar


    Indeed! Thanks for pointing that out. It has been corrected!

  4. Brandon’s avatar

    Hi Scott,

    Dominik I think you and Scott are both correct depending on your fabric. If you are in a multi-switch/multi-vsan fabric it is best to use the device-alias database to store all your device alias. This will allow you to add in your device-aliases once distribute them to all MDS switches and use them for any vsan. if you are in single-switch/single-vsan fabric using the fcalias command should be sufficient. Scott thanks for the tip on the zoneset clone command I will be using that one.



  5. PhilPill’s avatar

    Heya Scott,
    Thought you might want to include the chance for new users who’ve made mistakes to backout and use the “no member” command

    switch(config)# zoneset new-zoneset vsan XXX
    switch(config-zoneset)# member first-new-zone

    to backout use
    switch(config-zoneset)# no member mistake-zone

    Loved the simplicity of your blog. Good work and thanks

  6. tazer’s avatar

    hi, just came across your blog here on this. i am new to this entirely. is there a cisco fiber cli simulator of some sort to practice this on?

  7. Raviteja’s avatar

    Hi Scott,

    I’m new of this Storage, i’m able to understand this Configuring the Zone and Managing the Zones topics , do u have any related documents of Zoning for Cisco CLI Commands and is there a cisco fiber cli simulator of some sort to practice this on?

  8. JC’s avatar

    Hello Scott,

    This is good information. May I ask why you chose port membership using pwwn as oppose to swwn? Is it because fcalias can only be assigned to pwwn?

    Also, is there an advantage and/or disadvantage using one over the other?


  9. aj fernandez’s avatar

    hi Scott, what is the command to backup the mds 9148 fabric configurations like zones and ports settings? I would like to backup those every month and whenever I want to restore previous settings I can able to run directly the backup copy.


  10. KWohlgemuth’s avatar

    AJ, you can use the copy command to make a backup. Just use copy ? to see the list of options. I usually have a tftp server (solarwinds) that I backup to whenever I make a change.

    copy run start
    copy run tftp:///


Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>