A virtual LAN (VLAN) is a logical LAN, or a logical subnet.Vlan defines a broadcast domain. A physical subnet is a group of devices that shares the same physical wire. A logical subnet is a group of switch ports assigned to the same VLAN.
· Logically divide a switch into multiple, independent switches at L2
· Create separate broadcast domains in a switch, increasing the number of broadcast domains
· Span multiple switches using trunks
· Allow logical grouping of users by function
· Simplify adding, moving, and changing hosts in the network
· Enhance security
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfJFUCoQqtcR0sTNZZX-i_xhX0R5IO2Qxr7voy919LvTAxEDzOzmDyayugkhcE8Ew4Wu58t_izz8R7oj5Bc5K0QKOTVr2MbaP94CqQ9_d60KeuLQII1_GGYaP32O821iHKHS4zjQGQh_g/s320/vlan.jpg)
VLAN configuration steps:
1. The VLAN must be created.
2. The VLAN may be named.
3. The desired ports must be added to the new VLAN.
Note: Routing between VLANs requires a router or Layer 3 switch.
Creating Static VLANs
There are 2 ways of create Vlans:
• Using the VLAN configuration mode, which is the recommended way to create VLANs
• Using the VLAN database mode (which should not be used but is still available)
Using VLAN Configuration Mode
Switch(config)#vlan 2----->Creates VLAN 3 and enters VLAN configuration mode for further definitions.
Switch(config-vlan)#name Marketing-----> Assigns a name to the VLAN.
Switch(config-vlan)#exit
Switch(config)#
Using VLAN Database Mode
Switch#vlan database ----->Enters VLAN database mode.
Switch(vlan)#vlan 5 name Engineering ----->Creates VLAN 5 and names it Engineering.
Switch(vlan)#vlan 10 ----->Creates VLAN 10 and gives it a name of VLAN0010 as a default.
Switch(vlan)#apply----->Applies changes to the VLAN database and increases the revision number by 1.
Switch(vlan)#exit
Switch#
Assigning Ports to VLANs
Switch(config)#interface fastethernet 0/0-----> Moves to interface configuration mode
Switch(config-if)#switchport mode access ----->Sets the port to access mode
Switch(config-if)#switchport access vlan 2-----> Assigns this port to VLAN 2
Using the range Command
Switch(config)#interface range fastethernet 0/1 – 8----->Enables you to set the same configuration parameters on multiple ports at the same time.
Switch(config-if-range)#switchport mode-----> Access Sets ports 1–9 as access ports.
Switch(config-if-range)#switchport access vlan 5-----> Assigns ports 1–9 to VLAN 5.
Verifying VLAN Information
Switch#show vlan-----> Displays VLAN information
Switch#show vlan brief ----->Displays VLAN information in brief
Switch#show vlan id 5-----> Only displays information about VLAN 5
Switch#show vlan name sales ----->Only displays information about VLAN named sales
Switch#show interfaces vlan x ----->Displays interface characteristics for the specified VLAN
Erasing VLANs
Switch#delete flash:vlan.dat-----> Removes the entire VLAN database from flash
Switch(config)#interface fastethernet 0/0
Switch(config-if)#no switchport access vlan 2
Switch(config-if)#exit
Switch(config)#no vlan 2
Or
Switch#vlan database
Switch(vlan)#no vlan 2
Switch(vlan)#exit
Hiç yorum yok:
Yorum Gönder