Introduction to Flex Links on Cisco Nexus 9000 Devices

Today I am going to talk about Flex Links used in Cisco Nexus 9000 series switches. Now the question is what is these Flex links are? Well Flex links are the alternative solution to the Spanning Tree Protocol (STP), permitting operators to turn off STP and deliver basic link redundancy. 

We usually configure Flex Links in networks where consumers do not want to run STP on the switch. When we configure STP on the switch, it is not necessary to configure Flex Links because STP already provides link-level redundancy or backup.

How Flex links works in the Switched environment?
We can configure the Flex Links on one Layer 2 interface by allotting alternative Layer 2 interface as the Flex Link or backup link. When one of the links is up and forwarding traffic, the other link is in standby mode, prepared to start forwarding traffic if the other link shuts down. 

Only one of the interfaces is in the linkup state and forwarding traffic. If the primary link shuts down, the standby link starts forwarding traffic. When the active link comes back up, it goes into standby mode and does not forward traffic. STP is disabled on Flex Link interfaces.

Which platforms supported Flex Links?
Flex links are supported on the following platforms
Cisco Nexus 9300-EX switches.
Cisco Nexus 9300-FX switches.
Cisco Nexus 9300-FX2 switches.
Cisco Nexus C9364C switches.

Fig 1.1- Flex Links
Here in the above example shown where ports 1 and 2 on switch 1 are connected to uplink switches 2 and 3. Because they are configured as Flex Links, only one of the interfaces is forwarding traffic and the other is in standby mode. 

If port 1 is the active link, it begins forwarding traffic between port 1 and switch 2 and the link between port 2 (the backup link) and switch 3 is not forwarding traffic. If port 1 goes down, port 2 comes up and starts forwarding traffic to switch 3. 

When port 1 comes back up, it goes into standby mode and does not forward traffic; port 2 continues forwarding traffic.We can also select to configure a preemption mechanism, specifying the preferred port for forwarding traffic. 

As a reference, you can configure the Flex Link pair with preemption mode so that after port 1 comes back up in the scenario, if it has greater bandwidth than port 2, port 1 begins forwarding after pre-empt delay and port 2 becomes the standby. 

We do this by entering the interface configuration switchport backup interface preemption mode bandwidth and switchport backup interface preemption delay commands.

If a main (forwarding) link or the standby link goes down, a trap alerts the network management stations. Flex Links are supported only on Layer 2 ports and port channels in either trunk or access mode. They are not supported on VLANs or Layer 3 ports.

Basic Configuration for Flex links as a reference 
Below is the configuration of an Ethernet switchport backup pair: Ethernet 1/2 is active interface, Ethernet 1/3 is the backup interface
CloudsXP_SW (config) # feature flexlink
CloudsXP_SW (config) # interface ethernet 1/3
CloudsXP_SW (config-if) # switchport backup interface ethernet 1/4
CloudsXP_SW (config-if) # exit
CloudsXP_SW (config) # interface port-channel 100
CloudsXP_SW (config-if) # switchport backup interface port-channel 101

Basic Configuration which sets the preemption mode to force with delay 40
CloudsXP_SW (config) # configure terminal
CloudsXP_SW (config) # interface ethernet 1/10
CloudsXP_SW (config-if) # switchport backup interface ethernet 1/6 preemption mode forced
CloudsXP_SW (config-if) # switchport backup interface ethernet 1/6 preemption delay 40
CloudsXP_SW (config-if) # end

For Verification Commands
CloudsXP_SW (config) # show interface switchport backup
CloudsXP_SW (config) # show interface switchport backup detail
CloudsXP_SW (config) # show running-config backup
CloudsXP_SW (config) # show running-config flexlink