Cisco NX-OS Configuring Port Channels

 

This config notes describes how to configure port channels and to apply and configure the Link Aggregation Control Protocol (LACP) for more efficient use of port channels in Cisco NX-OS.

Understanding Port Channels

Using port channels, Cisco NX-OS provides wider bandwidth, redundancy, and load balancing across the channels.
You can collect up to eight ports into a static port channel or you can enable the Link Aggregation Control Protocol (LACP). Configuring port channels with LACP requires slightly different steps than configuring static port channels.

A port channel bundles individual links into a channel group to create a single logical link that provides the aggregate bandwidth of up to eight physical links. If a member port within a port channel fails, traffic previously carried over the failed link switches to the remaining member ports within the port channel.

Each port can be in only one port channel. All the ports in a port channel must be compatible; they must use the same speed and operate in full-duplex mode. When you are running static port channels, without LACP, the individual links are all in the on channel mode; you cannot change this mode without enabling LACP.

You can create a port channel directly by creating the port-channel interface, or you can create a channel group that acts to aggregate individual ports into a bundle. When you associate an interface with a channel group, Cisco NX-OS creates a matching port channel automatically if the port channel does not already exist. You can also create the port channel first. In this instance, Cisco NX-OS creates an empty channel group with the same channel number as the port channel and takes the default configuration.

The port channel is operationally up when at least one of the member ports is up and that port’s status is channeling. The port channel is operationally down when all member ports are operationally down.

Compatibility Requirements

When you add an interface to a channel group, the Cisco NX-OS checks certain interface attributes to ensure that the interface is compatible with the channel group. The Cisco NX-OS also checks a number of operational attributes for an interface before allowing that interface to participate in the port-channel aggregation.

The compatibility check includes the following operational attributes:
– Port mode
– Access VLAN
– Trunk native VLAN
– Allowed VLAN list
– Speed
– 802.3x flow control setting
– MTU
– Broadcast/Unicast/Multicast Storm Control setting
– Priority-Flow-Control
– Untagged CoS

Use the show port-channel compatibility-parameters command to see the full list of compatibility checks that the Cisco NX-OS uses. You can only add interfaces configured with the channel mode set to on to static port channels. You can also only add interfaces configured with the channel mode as active or passive to port channels that are running LACP. You can configure these attributes on an individual member port.

When the interface joins a port channel, some of its individual parameters are replaced with the values on the port channel, as follows:
– Bandwidth
– MAC address
– Spanning Tree Protocol

Many interface parameters remain unaffected with the interface joins a port channel, as follows:
– Description
– CDP
– LACP port priority
– Debounce

Load Balancing Using Port Channels

The Cisco NX-OS load balances traffic across all operational interfaces in a port channel by reducing part of the binary pattern formed from the addresses in the frame to a numerical value that selects one of the links in the channel. Port channels provide load balancing by default and the basic configuration uses the following criteria to select the link:
– For a Layer 2 frame, it uses the source and destination MAC addresses.
– For a Layer 3 frame, it uses the source and destination MAC addresses and the source and destination IP addresses.
– For a Layer 4 frame, it uses the source and destination MAC addresses, the source and destination IP addresses, and the source and destination port number.

You can configure the switch to use one of the following methods to load balance across the port channel:
– Destination MAC address
– Source MAC address
– Source and destination MAC address
– Destination IP address
– Source IP address
– Source and destination IP address
– Destination TCP/UDP port number
– Source TCP/UDP port number
– Source and destination TCP/UDP port number

LACP Overview

Figure above shows how individual links can be combined into LACP port channels and channel groups as well as function as individual.

LACP uses the following parameters:
– LACP system priority—Each system that runs LACP has an LACP system priority value. You can accept the default value of 32768 for this parameter, or you can configure a value between 1 and 65535. LACP uses the system priority with the MAC address to form the system ID and also uses the system priority during negotiation with other devices. A higher system priority value means a lower priority.

– LACP port priority—Each port configured to use LACP has an LACP port priority. You can accept the default value of 32768 for the LACP port priority, or you can configure a value between 1 and 65535. LACP uses the port priority with the port number to form the port identifier. LACP uses the port priority to decide which ports should be put in standby mode when there is a limitation that prevents all compatible ports from aggregating and which ports should be put into active mode. A higher port priority value means a lower priority for LACP. You can configure the port priority so that specified ports have a lower priority for LACP and are most likely to be chosen as active links, rather than hot-standby links.

– LACP administrative key—LACP automatically configures an administrative key value equal to the channel-group number on each port configured to use LACP. The administrative key defines the ability of a port to aggregate with other ports. A port’s ability to aggregate with other ports is determined by these factors:
–– Port physical characteristics, such as the data rate, the duplex capability, and the point-to-point or shared medium state
–– Configuration restrictions that you establish

Port-Channel Modes

passive: LACP mode that places a port into a passive negotiating state, in which the port responds to LACP packets that it receives but does not initiate LACP negotiation.

active: LACP mode that places a port into an active negotiating state, in which the port initiates negotiations with other ports by sending LACP packets.

on: All static port channels, that is, that are not running LACP, remain in this mode. If you attempt to change the channel mode to active or passive before enabling LACP, the device returns an error message.
You enable LACP on each channel by configuring the interface in that channel for the channel mode as either active or passive. When an LACP attempts to negotiate with an interface in the on state, it does not receive any LACP packets and becomes an individual link with that interface; it does not join the LACP channel group.

Configuring Port Channels

Enters configuration mode.
switch# configure terminal

Specifies the port-channel interface to configure, and enters the interface configuration mode. The range is from 1 to 4096. Cisco NX-OS automatically creates the channel group if it does not already exist.
switch(config)# interface port-channel channel-number

This example shows how to create a port channel:

switch# configure terminal 
switch (config)# interface port-channel 1
Adding a Port to a Port Channel

Enters configuration mode.
switch# configure terminal

Specifies the interface that you want to add to a channel group and enters the interface configuration mode.
switch(config)# interface type slot / port

(Optional) Configures the interface as a trunk port.
switch(config-if)# switchport mode trunk

(Optional) Configures necessary parameters for a trunk port.
switch(config-if)# switchport trunk { allowed vlan vlan-id | native vlan vlan-id }

Configures the port in a channel group and sets the mode. The channel-number range is from 1 to 4096. Cisco NX-OS creates the port channel associated with this channel group if the port channel does not already exist.
switch(config-if)# channel-group channel-number

To remove the port from the channel group, perform this task:
switch(config)# no channel-group

This example shows how to add an Ethernet interface 1/4 to channel group 1:

switch# configure terminal
switch (config)# interface ethernet 1/4
switch(config-if)# switchport mode trunk
switch(config-if)# channel-group 1
Configuring Load Balancing Using Port Channels

You can configure the load-balancing algorithm for port channels that applies to the entire device. Enable LACP if you want LACP-based port channels.

Enters configuration mode.
switch# configure terminal

Specifies the load-balancing algorithm for the device. The range depends on the device. The default is source-dest-mac.
switch(config)# port-channel load-balance ethernet { destination-ip | destination-mac | destination-port | source-dest-ip | source-dest-mac | source-dest-port | source-ip | source-mac | source-port }

(Optional) Displays the port-channel load-balancing algorithm.
switch(config-router)# show port-channel load-balance

This example shows how to configure source IP load balancing for port channels:

switch# configure terminal 
switch (config)# port-channel load-balance ethernet source-ip

Restores the default load-balancing algorithm.
switch(config)# no port-channel load-balance ethernet

Enabling LACP

LACP is disabled by default; you must enable LACP before you begin LACP configuration. You cannot disable LACP while any LACP configuration is present.

LACP learns the capabilities of LAN port groups dynamically and informs the other LAN ports. Once LACP identifies correctly matched Ethernet links, it facilitates grouping the links into a port channel. The port channel is then added to the spanning tree as a single bridge port.

To enable LACP, perform this task:

switch# configure terminal
switch(config)# feature lacp
switch(config)# show system internal clis feature
Configuring Port-Channel Port Modes

After you enable LACP, you can configure the channel mode for each individual link in the LACP port channel as active or passive. This channel configuration mode allows the link to operate with LACP.

When you configure port channels with no associated protocol, all interfaces on both sides of the link remain in the on channel mode.

To configure the LACP link mode, perform this task:
Enters configuration mode.
switch# configure terminal

Specifies the interface to configure, and enters the interface configuration mode.
switch(config)# interface type slot / port

Specifies the port mode for the link in a port channel. After LACP is enabled, you configure each link or the entire channel as active or passive. When you run port channels with no associated protocol, the port-channel mode is always on. The default port-channel mode is on.
switch(config-if)# channel-group number mode { active | on | passive }

Returns the port mode to on for the specified interface.
switch(config-if)# no channel-group number mode

This example shows how to set the LACP-enabled interface to active port-channel mode for Ethernet interface 1/4 in channel group 5:

switch# configure terminal 
switch (config)# interface ethernet 1/4 
switch(config-if)# channel-group 5 mode active
Configuring the LACP System Priority and System ID

The LACP system ID is the combination of the LACP system priority value and the MAC address.

To configure the LACP system priority, perform this task:

Enters configuration mode.
switch# configure terminal

Configures the system priority for use with LACP. Valid values are 1 through 65535, and higher numbers have lower priority. The default value is 32768.
switch(config)# lacp system-priority priority

Displays the LACP system identifier.
switch(config-if)# show lacp system-identifier

This example shows how to set the LACP system priority to 2500:

switch# configure terminal 
switch(config)# lacp system-priority 2500
Configuring the LACP Port Priority

When you enable LACP, you can configure each link in the LACP port channel for the port priority.

To configure the LACP link mode and port priority, perform this task:

Enters configuration mode.
switch# configure terminal

Specifies the interface to configure, and enters the interface configuration mode.
switch(config)# interface type slot / port

Configures the port priority for use with LACP. Valid values are 1 through 65535, and higher numbers have lower priority. The default value is 32768.
switch(config-if)# lacp port-priority priority

This example shows how to set the LACP port priority for Ethernet interface 1/4 to 40000:

switch# configure terminal 
switch (config)# interface ethernet 1/4 
switch(config-if)# lacp port priority 40000
Verifying Port-Channel Configuration

To display port-channel configuration information, perform one of the following tasks:

Displays the status of a port-channel interface.
switch# show interface port-channel channel-number

Displays enabled features.
switch# show system internal clis feature

Displays LACP information.
switch# show lacp { counters | interface type slot / port | neighbor | port-channel | system-identifier }

Displays the parameters that must be the same among the member ports in order to join a port channel.
switch# show port-channel compatibility-parameters

Displays the aggregation state for one or more port-channel interfaces.
switch# show port-channel database [ interface port-channel channel-number]

Displays the type of load balancing in use for port channels.
switch# show port-channel load-balance

Displays a summary for the port-channel interfaces.
switch# show port-channel summary

Displays the traffic statistics for port channels.
switch# show port-channel traffic

Displays the range of used and unused channel numbers.
switch# show port-channel usage

Displays information on current running of the port-channel feature.
switch# show port-channel database