First, go to switch 1 into configuration mode
Switch1#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#
Then open the interface Gig0/1 and enable trunk mode with the VLAN you want. (you can change the vlan number from 0 / 1005)
Switch1(config)#interface gigabitEthernet 0/1 Switch1(config-if)#switchport mode trunk Switch1(config-if)#switchport trunk allowed vlan add 10(add the VLAN you want!) Switch1(config-if)#no shutdown
When message:
Command rejected: An interface whose trunk encapsulation is “Auto” can not be configured to “trunk” mode.
Solution:
You have to specify the encapsulation with the follow command: “switchport encapsulation dot1q” (without quote’s!)
Verify that the port is set correctly for the trunk:
Switch1>show interfaces trunk Port Mode Encapsulation Status Native vlan Gig0/1 on 802.1q trunking 1 Port Vlans allowed on trunk Gig0/1 1-1005 Port Vlans allowed and active in management domain Gig0/1 1 Port Vlans in spanning tree forwarding state and not pruned Gig0/1 1 Switch1>
Then do the exact same things, written above, to switch2!