Configuring VLAN
Summary: Networking › Switching › Edge › Synapse
Overview of VLAN
A VLAN is a switched network that is logically segmented by function, project team, or application, without regard to the physical locations of the users. VLANs have the same attributes as physical LANs, but you can group end stations even if they are not physically located on the same LAN segment. Any switch port can belong to a VLAN, and unicast, broadcast, and multicast packets are forwarded and flooded only to end stations in the VLAN. Each VLAN is considered a logical network, and packets destined for stations that do not belong to the VLAN must be forwarded through a router or a switch supporting fallback bridging. The port link types of Ethernet switches can be divided into three types:Access, Trunk, and Hybrid. These three ports will be processed differently when they join VLAN and forward packets. Access:An access port can belong to one VLAN and is manually assigned to that VLAN. Trunk:A trunk port is a member of all VLANs by default, but membership can be limited by configuring the allowed-VLAN list. A trunk port have a native vlan, the switch forwards untagged traffic in the native VLAN configured for the port. The native VLAN is VLAN 1 by default. Hybrid:A hybrid port is a member of all VLANs by default, but membership can be limited by configuring the allowed-VLAN list. A hybrid port allow users to configure traffic of a vlan forwards tagged or untagged. A trunk port has a hybrid vlan, The hybrid VLAN is VLAN 1 by default.
Configuring
- Creating VLAN
SWITCH(config)#vlan (<vlan-id> | <vlan-range>)
SWITCH(config)#no vlan (<vlan-id> | <vlan-range>)
Create a VLAN, vlan-id 1-4094, vlan-range example: 2-10.
SWITCH(config)#interface IFNAME
SWITCH(config-if)#switchport mode access
Configure the interface port mode access.
SWITCH(config-if)#switchport access vlan VLANID
SWITCH(config-if)#no switchport access vlan
Specify the default VLAN of the interface, which is used if the interface is access mode. Default vlan is 1.
SWITCH(config)#interface IFNAME
SWITCH(config-if)#switchport mode trunk
Configure the interface port mode trunk.
SWITCH(config-if)#switchport trunk allowed vlan { all | VLAN_LIST | none}
SWITCH(config-if)#no switchport trunk allowed vlan VLAN_LIST
Configure the list of VLANs allowed on the trunk, which is used if the interface is trunk mode. All: Adds all VLANs in available in the VLAN table, New VLANs added to the VLAN table are added automatically. None: Removes all VLANs. VLAN_LIST: It will manually set the Allowed VLAN list, if it belongs to ALL, the Allowed VLAN list will be cleared first, and then the new VLAN list will be added; vlan-list parameter is either a single VLAN number from 1 to 4094 or a range of VLANs described by two VLAN numbers, the lower one first, separated by a hyphen. Do not enter any spaces between comma-separated VLAN parameters or in hyphen-specified ranges. Only created VLANs can be added to the Allowed VLAN list; when a VLAN is deleted, the corresponding VLAN in the Allowed VLAN list will be automatically deleted. All VLANs are allowed by default.
SWITCH(config-if)#switchport trunk native vlan VLANID
SWITCH(config-if)#no switchport trunk native vlan
Configure the VLAN that is sending and receiving untagged traffic on the trunk port. For VLANID, the range is 1 to 4094. Native VLAN has nothing to do with whether the Allowed VLAN contains this VLAN, or even whether the VLAN is created. Default vlan is 1. Note: ✦ The default VLAN ID of the trunk port of the local device must be the same as the default VLAN ID of the trunk port of the connected device, otherwise the packets of the default VLAN will not be transmitted correctly.
SWITCH(config)#interface IFNAME
SWITCH(config-if)#switchport mode hybrid
Configure the interface port mode hybrid.
SWITCH(config-if)#switchport hybrid allowed vlan { all | VLAN_LIST | none}
SWITCH(config-if)#no switchport hybrid allowed vlan VLAN_LIST
Configure the list of VLANs allowed on the trunk, which is used if the interface is hybrid mode. All: Adds all VLANs in available in the VLAN table, New VLANs added to the VLAN table are added automatically. None: Removes all VLANs. VLAN_LIST: It will manually set the Allowed VLAN list, If it belongs to ALL , the Allowed VLAN list will be cleared first, and then the new VLAN list will be added; vlan-list parameter is either a single VLAN number from 1 to 4094 or a range of VLANs described by two VLAN numbers, the lower one first, separated by a hyphen. Do not enter any spaces between comma-separated VLAN parameters or in hyphen-specified ranges. Only created VLANs can be added to the Allowed VLAN list; when a VLAN is deleted, the corresponding VLAN in the Allowed VLAN list will be automatically deleted. All VLANs are allowed by default.
SWITCH(config-if)#switchport hybrid vlan VLANID
SWITCH(config-if)#no switchport hybrid vlan
Configure the default VLAN that is sending and receiving untagged traffic on the hybrid port. For VLANID, the range is 1 to 4094. Native VLAN has nothing to do with whether the Allowed VLAN contains this VLAN, or even whether the VLAN is created. Default vlan is 1.
SWITCH(config-if)#switchport hybrid untagged vlan VLAN_LIST
SWITCH(config-if)#no switchport hybrid untagged vlan VLAN_LIST
Configure the list of untagged VLANs, which is used if the interface is hybrid mode. The default VLAN must be untagged output, therefore, it is not maintained by the untagged VLAN list. By default the untagged VLAN list is empty. The Untagged VLAN list must be in the Allowed VLAN list of the Hybird port, Therefore, when a VLAN is deleted from the Allowed VLAN, it will also be deleted from the Untagged VLAN list. Since the untagged VLAN list does not maintain the default VLAN, if a VLAN in the previous list is set as the default VLAN, it will be deleted from the untagged VLAN list.
Note
✦ The default VLAN ID of the hybrid port of the local device must be the same as the default VLAN ID of the hybrid port of the connected device, otherwise the packets of the default VLAN will not be transmitted correctly.
Display Information
Displays the VLAN table, includes VLAN VID, VLAN status, VLAN member ports, and VLAN configuration information.
- Display VLAN Information
VLAN ID Name State H/W Status Member ports (u)-Untagged, (t)-Tagged ======= ============ ======= =========== ============================ 1 default ACTIVE Up gigabitEthernet0/2(u) gigabitEthernet0/3(u)

