Configure Stack Settings on a Switch through the Command Line Interface (CLI)

Document

Fri, 04/28/2017 - 11:00
Apr 27th, 2017
User Badges:

Cisco Support Community

Article ID: 5555

Objective

Stacking allows you to expand your network capacity without the hassle of managing multiple devices. Stackable switches can be added or removed from a stack as needed without affecting the overall performance of the stack. Depending on its topology, a stack can continue to transfer data even if a link or unit within the stack fails. This makes stacking an effective, flexible, and scalable solution to expand network capacity.

By default, a switch is always stackable, but has no port configured as a stack port. All the ports in the devices are configured as network ports by default. A device without any stack port can be thought of as the master device in a stack of only itself or as a standalone device. To stack two or more switches, you can reconfigure the desired network ports as stack ports in the switches and connect them with the resulting stack ports in a ring or chain topology.

The units or switches in a stack are connected through stack ports. Stacked switches are then collectively managed as a single logical device. In some cases, stack ports can become members in a stack of Link Aggregation Groups (LAGs) increasing the bandwidth of the stack interfaces.

A stack provides the following benefits:

  • Network capacity can be expanded or reduced dynamically. By adding a unit, the administrator can dynamically increase the number of ports in the stack while maintaining a single point of management. Similarly, units can be removed to decrease network capacity.
  • The stacked system supports redundancy in the following ways:

- The backup unit becomes the master of the stack if the original master fails.

- The stack system supports two types of topologies: Chain and Ring. Ring topology is more reliable than a chain topology. The failure of one link in a ring does not affect the function of the stack, whereas the failure of one link in a chain connection might cause the stack to be split.

This article provides instructions on how to configure stack settings through the Command Line Interface (CLI) of your switch.

Note: To know how to configure the stack settings of your SG350X or Sx550X switch through the web-based utility, click here for instructions. For Sx500 switches, click here. For SG350XG or SG550XG switches, click here.

Applicable Devices

  • Sx350 Series
  • SG350X Series
  • Sx500 Series
  • Sx550X Series

Software Version

  • 1.4.7.05 — Sx500
  • 2.2.8.4 — Sx350, SG350X, Sx550X

Configure Stack Settings on a Switch

Connect the Switches

Step 1. Determine the stack mode that you would want to configure. The options are:

  • Chain — Each unit is connected to the neighboring unit, but there is no cable connection between the first and last unit. This is the default stack mode. The image below shows a chain topology of a four-unit stack:

ijgm_04282017_configure-stack-settings-connect-switches_step1.png

  • Ring — Each unit is connected to the neighboring unit. The last unit is connected to the first unit. The image below shows a ring topology of a four-unit stack:

ijgm_04282017_configure-stack-settings-connect-switches_step1a.png

Step 2. Connect one end of the Small Form-Factor Pluggable (SFP) cable that came with your device into the SFP+, XG3, or XG4 port of your switch.

ijgm_04282017_configure-stack-settings-connect-switches_step2.png

Note: In this example, the cable is connected to XG3 port of the switch.

ijgm_04282017_configure-stack-settings-connect-switches_step2a.png

Step 3. Connect the other end of the SFP+ cable into the SFP+, XG3 or XG4 port of your switch.

ijgm_04282017_configure-stack-settings-connect-switches_step3.png

Note: In this example, the cable is connected to XG3 port of the switch.

Step 4. Repeat Steps 2 to 3 to the remaining switches.

In this scenario, two switches are being configured for stacking and the SFP cables are connected to ports 3 and 4 on both switches.

ijgm_04282017_configure-stack-settings-connect-switches_step4.png

You should now have connected your switches according to your desired topology.

Configure Stack Settings on the Master Switch

Master Selection Process

The master unit is selected from the master-enabled units (1 or 2). The factors in selecting the master unit are taken into account in the following priority:

  • System Up Time — The master-enabled units exchange up-time, which is measured in segments of 10 minutes. The unit with the higher number of segments is selected. If both units have the same number of time segments, and the unit ID of one of the units was set manually while the unit ID of the other was set automatically, the unit with the manually-defined unit ID is selected; otherwise the unit with the lowest unit ID is selected. If both units IDs are the same, the unit with the lowest Media Access Control (MAC) address is chosen.

Note: The up time of the backup unit is retained when it is selected as master in the switch failover process.

  • Unit ID — If both units have the same number of time segments, the unit with the lowest unit ID is selected.
  • MAC Address — If both units IDs are the same, the unit with the lowest MAC address is chosen.

Note: For a stack to operate, it must have a master unit. A master unit is defined as the active unit that assumes the master role. The stack must contain a Unit 1 and/or Unit 2 after the master selection process. Otherwise, the stack and all its units are partially shut down, not as a complete power-off, but with traffic-passing capabilities halted.

Follow these steps to configure stack settings on the Master switch:

Step 1. Log in to the console of the first switch. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.

ijgm_04282017_configure-stack-settings-master-selection_step1.png

Note: The available commands may vary depending on the exact model of your device. In this example, SG350X-48MP switch is used.The hostname of the backup switch is SG350X-2.

Step 2. Enter the Global Configuration mode of the switch by entering the following:

Step 3. To enter the context of the specified stack unit or all stack units, enter the stack unit command in the Global Configuration mode by entering the following:

Note: In this example, stack unit 1 is used.

ijgm_04282017_configure-stack-settings-master-selection_step3a.png

Step 4. Enter the stack configuration command to configure the stack ports and unit ID after reboot by entering the following:

The options are:

  • ports-list — a list of one or more stack ports separated by comma, or a range of sequential ports marked by dash.
  • links — Choose port list to be used as stack links after reload.
  • unit-id — Choose the unit ID to be used after reload. The range is 1 to 4. You can use auto to enable stack auto numbering feature.

Note: In this example, stack configuration links unit-id 1 is entered.

ijgm_04282017_configure-stack-settings-master-selection_step4a.png

Step 5. (Optional) To remove stack configuration settings on the switch, use the no stack configuration command by entering the following:

Step 6. Enter the end command to go back to the Privileged EXEC mode of the switch.

ijgm_04282017_configure-stack-settings-master-selection_step6a.png

Step 7. (Optional) To display the stack configuration settings, enter the following:

ijgm_04282017_configure-stack-settings-master-selection_step7a.png

Note: In this example, the Master (Unit 1) switch now uses te3-4 as stack links. These settings will take effect after the switch reboots.

Step 8. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file, by entering the following:

ijgm_04282017_configure-stack-settings-master-selection_step8a.png

Step 9. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]… prompt appears.

ijgm_04282017_configure-stack-settings-master-selection_step9.png

Note: In this example, Y is pressed.

Step 10. Reload the switch to apply the configured stack settings by entering the following:

ijgm_04282017_configure-stack-settings-master-selection_step10a.png

Important: When a switch is reloaded, the running configuration file is deleted. Before proceeding with the reload instructions, make sure to save all the running configuration settings to avoid data loss.

Step 11. Press Y for Yes or N for No on your keyboard once the Do you want to continue prompt appears.

ijgm_04282017_configure-stack-settings-master-selection_step11.png

Note: In this example, Y is pressed.

The Master unit will now reboot. You should now have configured the stack settings of your Master unit.

Configure Stack Settings on the Backup or Slave Switch

Step 1. Log in to the console of the second switch. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.

ijgm_04282017_configure-stack-settings-back-up-slave-settings_step1.png

Note: The available commands may vary depending on the exact model of your device. In this example, SG350X-48MP switch is used.The hostname of the backup switch is SG350X-2.

Step 2. Enter the Global Configuration mode of the switch by entering the following:

Step 3. To enter the context of the specified stack unit or all stack units, enter the stack unit command in the Global Configuration mode by entering the following:

Note: In this example, stack unit 1 is used.

ijgm_04282017_configure-stack-settings-back-up-slave-settings_step3a.png

Step 4. Enter the stack configuration command to configure the stack ports and unit ID after reboot by entering the following:

The options are:

  • ports-list — a list of one or more stack ports separated by comma, or a range of sequential ports marked by dash.
  • Links — Choose port list to be used as stack links after reload.
  • unit-id — Choose the unit ID to be used after reload. The range is 1 to 4. You can use auto to enable stack auto numbering feature.

Note: In this example, stack configuration links unit-id 2 is entered.

ijgm_04282017_configure-stack-settings-back-up-slave-settings_step4a.png

Step 5. (Optional) To remove stack configuration settings on the switch, use the no stack configuration command by entering the following:

Step 6. Enter the end command to go back to the Privileged EXEC mode of the switch.

ijgm_04282017_configure-stack-settings-back-up-slave-settings_step6.png

Step 7. (Optional) To display the stack configuration settings, enter the following:

ijgm_04282017_configure-stack-settings-back-up-slave-settings_step7a.png

Note: In this example, the Unit 2 switch now uses te3-4 as stack links. These settings will take effect after the switch reboots.

Step 8. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file, by entering the following:

ijgm_04282017_configure-stack-settings-back-up-slave-settings_step8a.png

Step 9. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]… prompt appears.

ijgm_04282017_configure-stack-settings-back-up-slave-settings_step9.png

Note: In this example, Y is pressed.

Step 10. Reload the switch to apply the configured stack settings by entering the following:

ijgm_04282017_configure-stack-settings-back-up-slave-settings_step10a.png

Important: When a switch is reloaded, the running configuration file is deleted. Before proceeding with the reload instructions, make sure to save all the running configuration settings to avoid data loss.

Step 11. Press Y for Yes or N for No on your keyboard once the Do you want to continue prompt appears.

ijgm_04282017_configure-stack-settings-back-up-slave-settings_step11.png

After the switch reboots, the backup switch will no longer be a standalone device and will only be accessible through the Master switch.

Step 12. Repeat steps 1 to 11 for the configuration of the slave switch or switches.

You should now have configured the stack settings on your backup and/or slave switches.

Show Stack Configuration Settings on the Switch

Step 1. Log back in to the console of the Master unit.

ijgm_04282017_configure-stack-settings-show_step1.png

Quick Tip: Access the Master unit while configuring the backup and/or slave switches to monitor the progress. Once the backup or slave switch reboots, the Master switch will be notified with the stacking activities.

ijgm_04282017_configure-stack-settings-show_step1a.png

Step 2. In the Privileged EXEC mode of the switch, use the show stack command to show the stack settings on the switch by entering the following:

ijgm_04282017_configure-stack-settings-show_step2a.png

Note: In this example, the configured unit 2 is now known as the backup switch of the stack.

Step 3. Enter the show stack links command to show the stack links on the switch by entering the following:

The options are:

  • stack links — Displays the stack links information for an entire stack.

ijgm_04282017_configure-stack-settings-show_step3a.png

  • stack links details — Displays the stack links information for an entire stack with details.

ijgm_04282017_configure-stack-settings-show_step3b.png

Step 4. (Optional) To access the backup switch, enter the stack unit ID of the switch in the Global Configuration context by entering the following:

ijgm_04282017_configure-stack-settings-show_step4.png

Note: In this example, the configured backup switch is now accessible as unit 2.

You should now have configured the stack settings on your switches.

Loading.

Actions

This Document