Brocade clear port stats

Before you start working with a brocade switch or when trouble shooting it can be useful to clear the port stats.  We will look at how to clear individual ports stats and clear all the stats from the brocade switch.

To view the current stats and errors for a port use the following command:

porterrshow

The following commands will allow us to clear these stats to see if any error counters are increasing.

To clear the stats for a single port:

portstatsclear portindex

For example to clear the stats on port 1

portstatsclear 1

To clear the stats for a range of ports

portstatsclear -i portindex1-portindex2

For example to clear the stats on port 1-5

portstatsclear -i 1-5

To clear all the switch port and diagnostic switch in one go

statsclear

Configuring a Brocade switch in access gateway mode

What is access gateway mode?

Brocade switches enabled in access gateway mode act as an extension of the existing fabric, they have no zoning configuration on themselves and all traffic is transferred over uplink ports to a upstream switch containing the zoning information. This is a way to add more ports to your fabric without the complexity of additional switches containing zone configurations. When you enable access gate way mode a number of ports will automatically be designated as N ports and the rest F ports. You will cable the hosts into the F ports and the N ports will be connected to the upstream switch. That’s the theory, lets walk through the steps to implement access gateway mode.

Example Brocade switch that can be enabled for access gateway mode

Checking upstream switch

Before you start you need to make sure the upstream switch to the access gateway (AG) switch will connect to has NPIV enabled.

1 Check NPIV is enabled.

portcfgshow

2 If necessary enable for NPIV using

portcfgnpivport

Configuring access gateway mode

To put the switch in access gateway mode follow these steps. It is important to note that all zoning information on the switch will be lost.

1 Backup the current config of the Brocade switch

2 Check the switch is in native mode = 0. You can check this by running switchshow and checking the mode

To change it

interopmode 0

3 Disable the switch

switchdisable

4 Enable access gateway mode

ag --modeenable
WARNING: Access Gateway mode changes the standard behavior of the switch. Please check Access Gateway Administrator's Guide before proceeding.

Enabling agmode will remove all the configuration data on the switch

including zoning configuration, FAWWN configuration and security database. Please backup your

configuration using configupload.

This operation will reboot the switch.

Do you want to continue? (yes, y, no, n): [no] y

5 Check access gateway mode is enabled as expected

ag --modeshow
Access Gateway mode is enabled

6 To see how the automatic port mapping has been configured run

ag --mapshow
N_Port Configured_F_Ports     Static_F_Ports Current_F_Ports Failover Failback PG_ID PG_Name

------------------------------------------------------------------------------------------------

0   15;16                   None           None             1       1         0   pg0

17   1;2                     None           None             1      1         0   pg0

18   9;10                   None           None             1       1         0   pg0

19   3;4                     None           None             1       1         0   pg0

20   11;12                   None           None             1       1         0   pg0

21   5;6                     None           None             1       1         0   pg0

22   13;14                   None           None             1       1         0   pg0

23   7;8                    None           None             1       1         0   pg0

------------------------------------------------------------------------------------------------

Amending Access Gateway POrt Mappings

If you are happy with the default port mapping you are good to go. If not you can amend them as follows

1 Before adding into a new port mapping you must remove a port from its existing mapping

ag --mapdel N_Port “f_port1;f_port”

For example

ag --mapdel 0 "15;16"
F_Port to N_Port mapping has been updated successfully

2 Create the new port mappings

--mapadd n_portnumber f_port1;f_port2

For example

ag --mapadd 17 "1;2;9;10"
WARNING: Mapping F_Port(s) to this N_Port may cause the F_Port(s) to be disabled

Do you want to continue? (yes, y, no, n): [no] y

F_Port to N_Port mapping has been updated successfully

Read more in the Brocade admin guide.

More Brocade content

Moving a Brocade Port Licence

Brocade FC Switch Supportsave

Backing up a Brocade switch

 

 

 

 

Move Brocade Port Licence

On a Brocade switch I had the need recently to move the port on demand licence  (POD) from one port to another on the same switch. The procedure to transfer a brocade licence is as follows:

In this example we move the licence  from port 8 to 2:

1 Disable the port you no longer

portcfgpersistentdisable 8

2 Remove the licence  from the port its not required on

licenseport -release 8

3 If the port you wish to use is disabled, enable it

 portenable 2

That’s it job done

You can read more on transferring a licence at Brocade’s site

More Brocade content

Configuring a Brocade switch in access gateway mode

Brocade FC Switch Supportsave

Backing up a Brocade switch