How to trunk two Cisco switches
This guide will show you how to trunk two Cisco switches together so that they are connected using 2 x Ethernet or 2 x SFP ports each. The trunk can be established using either Ethernet on both switches (the RJ45 ports) or SFP on both switches (the port where you insert the Small Form-factor Pluggable) fiber connector, but you cannot mix the technologies, so you either use Ethernet or Fiber
For our example we'll be using Ethernet ports, but the commands are exactly the same if you want to trunk fiber ports
Let's say you have a Cisco C2960-X network switch in our floor in your building, called "SW_Floor_A", and you want to connected to another Cisco C2960-X network switch that is located in another area of the building, let's call this last switch "SW_Floor_B", how do you do it? Let's start
Configure IP addresses
1- Configure IP addresses
Decide which VLAN you want to use as the Management VLAN for your switches, for example VLAN 132, and execute the following on each of the switches
- (config)# vlan 132
- (config-vlan)# name Management
- (config-vlan)# exit
- (config)# int vlan 132
- (config-int)# ip address 192.168.132.254 255.255.255.0
The above commands 1 to 3 will create vlan 132 on the switch, while commands 4 and 5 will give it an IP address
You can check that the switch has the right IP address by issue the command "sh ip int brief"
2- Clear the Configuration in the ports
Let's say you want to trunk ports 23 and 24 in each one of the switches, the first thing to do is to clear the configuration for each one of the ports, as follows:
- (config)#int range g1/0/23 -24
- (config-range)#no switchport mode
- (config-range)#no switchport access vlan
Verify the each of the 4 ports you want to trunk is clear of any config (having PRTG netflow config is okay thou) by running "do sh run int" in each of the ports
Ensure that you have removed, specially the "bpdu guard" configuration, which will prevent the switch from talking to one another
3- Create the port-channel
The port channel is a virtual interface with a unique number that will be use by each switch to bound the 2 physical ports.
In each of the switches do as follows
- (config)#int po 10
- (config-if)#name To_SW_Floor_A
- (config-if)#switchport mode trunk
The above commands create a port-channel with the number 10, and set it to be a trunk port
4- Add the ports to the port-channel
Now select the two ports that you want to configure, and add it to the port channel, like this:
- (config)#int range g1/0/23 - 34
- (config-range)#channel-group 10 mode active
- (config-range)#switchport mode trunk
Now you are ready to connect one cable at a time in between switches, see if the port-channel goes up