Task:
- Divide one physical network (1 switch and 6 PCs) in two separate virtual LANs
- Ports 1 to 10, 21 and 23 should be in LAN 2
- Ports 11 to 20 and 22 should be in LAN 2
- Port 24 should remain in LAN 1
- VLAN 2: PC1 – IP 192.168.0.1/24, Port 1; PC2 – IP 192.168.0.2/24, Port 3; PC3 – IP 192.168.0.3/24, Port 21
- VLAN 3: PC4 – IP 192.168.0.4/24, Port 11; PC5 – IP 192.168.0.5/24, Port 13; PC6 – IP 192.168.0.6/24, Port 22
Creating VLAN 2 and VLAN 3
Switch(config)#interface vlan 2 Switch(config-if)#exit Switch(config)#interface vlan 3 Switch(config-if)#exit
If you skip this step, VLANs will be later automaticaly created.
Adding ports 1 to 10 in VLAN 2
Switch(config)#interface range FastEthernet 0/1 - FastEthernet 0/10 Switch(config-if-range)#switchport mode access Switch(config-if-range)#switchport access vlan 2 % Access VLAN does not exist. Creating vlan 2 Switch(config-if-range)#exit
Example how to configure range of ports, from portX to portY
Adding ports 21 and 23 in VLAN 2
Switch(config)#interface range FastEthernet 0/1 - FastEthernet 0/10 Switch(config-if-range)#switchport mode access Switch(config-if-range)#switchport access vlan 2 % Access VLAN does not exist. Creating vlan 2 Switch(config-if-range)#exit
Example how to configure range of ports, listing all individually.
Adding ports 11 to 20 in VLAN 3
Switch(config)#interface range fa0/11 - fa0/20 Switch(config-if-range)#switchport mode access Switch(config-if-range)#switchport access VLAN 3 % Access VLAN does not exist. Creating vlan 3 Switch(config-if-range)# %LINK-5-CHANGED: Interface Vlan3, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to up exit
Adding port 22 in VLAN 3
Switch(config)#interface fa0/22 Switch(config-if)#switchport mode access Switch(config-if)#switchport access VLAN 3 Switch(config-if)#exit
Example how to ad single port in VLAN
Splitting one network in two VLANs
One thought on “VLAN”
Comments are closed.