Two switches interlinked via ports 22 and 23.
Switch 1 Initial Configs:
For switch 1, define the vlans and the two ethernet interfaces. Then bind them together with a port channel.
conf t
! the vlan are defined:
vlan 801
name tmp1
vlan 802
name tmp2
vlan 803
name tmp3
!
! The two interfaces are defined, and put in Po3
interface GigabitEthernet0/22
description test uplink 1
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,801-802
switchport mode trunk
logging event trunk-status
carrier-delay msec 0
no keepalive
channel-group 3 mode active
interface GigabitEthernet0/23
description test uplink 2
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,801-802
switchport mode trunk
logging event trunk-status
carrier-delay msec 0
no keepalive
channel-group 3 mode active
!
! And the port channel is defined.
interface Port-channel3
description Uplink: test portchannel 3
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,801-802
switchport mode trunk
logging event trunk-status
spanning-tree cost 20
end
Switch 2 Initial Configs:
For switch 1, define the vlans and the two ethernet interfaces. Then bind them together with a port channel.
conf t
! the vlan are defined:
vlan 801
name tmp1
vlan 802
name tmp2
vlan 803
name tmp3
!
! The two interfaces are defined, and put in Po3
interface GigabitEthernet0/22
description test uplink 1
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,801-802
switchport mode trunk
logging event trunk-status
carrier-delay msec 0
no keepalive
channel-group 3 mode active
interface GigabitEthernet0/23
description test uplink 2
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,801-802
switchport mode trunk
logging event trunk-status
carrier-delay msec 0
no keepalive
channel-group 3 mode active
!
! And the port channel is defined.
interface Port-channel3
description Uplink: test portchannel 3
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,801-802
switchport mode trunk
logging event trunk-status
spanning-tree cost 20
end
Testing the Status of the Link:
We can see the status of the link with the following two commands:
! confirm link is up:
sh int statu | in Gi0/2[23]
sh int po3 | in protocol
The results show that the link is up and connected:
netlab-sw1#sh int statu | in Gi0/2[23]
Gi0/22 test uplink 1 connected trunk a-full a-1000 10/100/1000BaseTX
Gi0/23 test uplink 2 connected trunk a-full a-1000 10/100/1000BaseTX
netlab-sw1#sh int po3 | in protocol
Port-channel3 is up, line protocol is up (connected)
netlab-sw1#
Add VLANs to the port channel.
If we want to add vlans to the channel, we don't want to make that change to each of the interfaces on their own, otherwise the channel will break. The way to do this is to only make the change to the channel, and the change will be automatically distributed to the interfaces.
To make the change, we will enter in the following commands:
! make change
conf t
interface Port-channel3
switchport trunk allowed vlan 3,801-803
end
Then to confirm the changes worked, we will issue the following checks:
! confirm link is up:
sh int statu | in Gi0/2[23]
sh int po3 | in protocol
sh run int g0/22
sh run int g0/23
sh run int po3
Finally we show that the changes above actually worked and the interfaces have automatically been updated with the port-channels configs.
! confirm the interfaces are up:
netlab-sw1#sh int statu | in Gi0/2[23]
Gi0/22 test uplink 1 connected trunk a-full a-1000 10/100/1000BaseTX
Gi0/23 test uplink 2 connected trunk a-full a-1000 10/100/1000BaseTX
netlab-sw1#sh int po3 | in protocol
Port-channel3 is up, line protocol is up (connected)
!
! confirm interface took the update:
netlab-sw1#sh run int g0/22
Building configuration...
Current configuration : 317 bytes
!
interface GigabitEthernet0/22
description test uplink 1
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,801-803
switchport mode trunk
logging event trunk-status
carrier-delay msec 0
no keepalive
channel-group 3 mode active
end
!
! confirm other interface took the update:
netlab-sw1#sh run int g0/23
Building configuration...
Current configuration : 317 bytes
!
interface GigabitEthernet0/23
description test uplink 2
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,801-803
switchport mode trunk
logging event trunk-status
carrier-delay msec 0
no keepalive
channel-group 3 mode active
end
!
! confirm port channel took the update:
netlab-sw1#sh run int po3
Building configuration...
Current configuration : 283 bytes
!
interface Port-channel3
description Uplink: test portchannel 3
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,801-803
switchport mode trunk
logging event trunk-status
spanning-tree cost 20
end
netlab-sw1#