VLAN's: Difference between revisions
Jump to navigation
Jump to search
Created page with " == Creating a VLAN == switch# config t switch(config)# vlan 5 switch(config-vlan)# name engineering switch(config-vlan)# exit == Give ports access to VLAN == ..." |
|||
| Line 18: | Line 18: | ||
If you have two switches connected by a cross over, and there is a VLAN on each switch that you want to go over both switches, create the VLAN with the same name and number on both switches and the setup trunking as follows: | If you have two switches connected by a cross over, and there is a VLAN on each switch that you want to go over both switches, create the VLAN with the same name and number on both switches and the setup trunking as follows: | ||
On Switch 1: | |||
switch# config t | switch# config t | ||
switch(config)# interface FastEthernet0/ | switch(config)# interface FastEthernet0/24 | ||
switch(config-if)# switchport mode trunk | switch(config-if)# switchport mode trunk | ||
switch(config-if)# switchport trunk allowed vlan 5 | switch(config-if)# switchport trunk allowed vlan 5 | ||
This enable trunking on | Do the same on Switch 2 and then connect the switches via a cross-over cable, port 24 to port 24. | ||
This enable trunking on port 24, but then restricts it to just VLAN 5. You may also need to run this command: | |||
switch(config-if)# switchport trunk encapsulation dot1q | switch(config-if)# switchport trunk encapsulation dot1q | ||
Latest revision as of 03:33, 21 September 2010
Creating a VLAN
switch# config t switch(config)# vlan 5 switch(config-vlan)# name engineering switch(config-vlan)# exit
Give ports access to VLAN
switch# config t switch(config)# interface range FastEthernet0/20 - 24 switch(config-if-range)# switchport access vlan 5
Configure VLAN Trunking between two switches
If you have two switches connected by a cross over, and there is a VLAN on each switch that you want to go over both switches, create the VLAN with the same name and number on both switches and the setup trunking as follows:
On Switch 1:
switch# config t switch(config)# interface FastEthernet0/24 switch(config-if)# switchport mode trunk switch(config-if)# switchport trunk allowed vlan 5
Do the same on Switch 2 and then connect the switches via a cross-over cable, port 24 to port 24.
This enable trunking on port 24, but then restricts it to just VLAN 5. You may also need to run this command:
switch(config-if)# switchport trunk encapsulation dot1q