Lab requirements:
Hosts connected to two vswitches can access hosts with the same VLAN
Experiment Configuration:
Switch (SW1 ):
Switch>
Switch> enable
Switch # configure terminal
Switch (config) # host SW1
SW1 (config) # interface vlan 2 (create vlan2)
SW1 (config-vlan) # exit
SW1 (config) # int f0/2
SW1 (config-if) # switchport access vlan 2 (add Port f0/2 to vlan 2)
SW1 (config-if) # exit
SW1 (config) # int f0/10
SW1 (config-if) # switchport mode trunk (specify port f0/10 as the trunk port)
SW1 (config-if) # switchport trunk encapsulation dot1q (encapsulate port f0/10 as 802.1q. This command is optional. This command is required for some switches and is not applicable to some switches, for example, this command is not required for vswitches of the 2960 type)
SW1 (config-if) # exit
SW1 (config) # exit
SW1 #
Switch (SW2 ):
Switch>
Switch> enable
Switch # configure terminal
Switch (config) # host SW2
SW2 (config) # interface vlan 2 (create vlan2)
SW2 (config-vlan) # exit
SW2 (config) # int f0/2
SW2 (config-if) # switchport access vlan 2 (add Port f0/2 to vlan 2)
SW2 (config-if) # exit
SW2 (config) # int f0/10
SW2 (config-if) # switchport mode trunk (specify port f0/10 as the trunk port)
SW2 (config-if) # switchport trunk encapsulation dot1q (encapsulate port f0/10 as 802.1q. This command is optional. This command is required for some switches and is not applicable to some switches, for example, this command is not required for vswitches of the 2960 type)
SW2 (config-if) # exit
SW2 (config) # exit
SW2 #
Note: pc0 address 192.168.2.2/24, pc1 address 192.168.2.3/24
Test:
This article is from the blog "do not understand real people-blog"