Configuring Port-based VLAN


Virtual Local Area Network (VLAN) technology divides a physical LAN into multiple broadcast domains, each of which is called a VLAN. VLAN tagging (IEEE 802.1Q) is a networking standard that defines the VLAN. Hosts within a VLAN can communicate with each other but cannot communicate directly with hosts in other VLANs. Consequently, broadcast packets are confined to within a single VLAN.

You can configure a physical port as either a trunk or an access port. With the native VLAN ID, you can add the port (in trunk mode) to more than one VLAN. Access ports only belong to native VLAN, while trunk ports belong to more than one VLAN, including the native VLAN.

If hosts in different VLANs need to communicate, configure inter-VLAN communication. A VLAN interface is a Layer 3 logical interface and can implement inter-VLAN Layer 3 connectivity. Each VLAN corresponds to a VLAN interface. An IP address can be assigned to each VLAN interface. For details about VLAN interface configuration, see Layer 3 VLAN Interface Configuration.

NOTE:

When configuring VLAN member, use VLAN ID or VLAN range, but NOT other strings.


Configure the Access/Trunk Mode

admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching port-mode access
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching port-mode trunk
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# 

Configure the Native VLAN ID

NOTE:

VLAN IDs (VLAN 1-4094) have been pre-configured in the system from version 4.3.2 and are not user-deletable. Users no longer need to use command set vlans vlan-id <vlan-id> to create VLAN IDs.

The native VLAN ID is the ID of the default VLAN (usually vlan-id 1) in which the port belongs. Every port should be included in at least one VLAN.

admin@XorPlus# set vlans vlan-id 5
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 5
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# run show vlans vlan-id 5
VLAN ID: 5
VLAN Name: default 
Description: 
vlan-interface: 
Routed-interface:
Number of member ports: 1 
Tagged port: None
Untagged port: ge-1/1/1, 
admin@XorPlus# 

 Add a Port to a VLAN with Tagged Packet

admin@XorPlus# set vlans vlan-id 5
admin@XorPlus# set vlans vlan-id 6
admin@XorPlus# set vlans vlan-id 7
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching port-mode trunk
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching vlan members 5
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching vlan members 6
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching vlan members 7
admin@XorPlus# commit 
Commit OK.
Save done.

admin@XorPlus# run show vlans 
VlanID   Tag        Interfaces 
------   --------   ------------------------------------------------------ 
1        untagged   ge-1/1/1, ge-1/1/2, ge-1/1/3, ge-1/1/4, ge-1/1/5                     
		    ge-1/1/6, ge-1/1/7, ge-1/1/8, ge-1/1/9, ge-1/1/10                     
                    ge-1/1/11, ge-1/1/12, ge-1/1/13, ge-1/1/14, ge-1/1/15                     
                    ge-1/1/16, ge-1/1/17, ge-1/1/18, ge-1/1/19, ge-1/1/20                     
                    ge-1/1/21, ge-1/1/22, ge-1/1/23, ge-1/1/24, te-1/1/25                     
                    te-1/1/26, te-1/1/27, te-1/1/28, te-1/1/29, te-1/1/30          
         tagged     
5        untagged             
         tagged     ge-1/1/2
6        untagged             
         tagged     ge-1/1/2
7        untagged             
         tagged     ge-1/1/2

 Add a Port to a VLAN with Untagged Packet 

admin@XorPlus# set vlans vlan-id 5 
admin@XorPlus# set vlans vlan-id 6 
admin@XorPlus# set vlans vlan-id 7 
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching port-mode trunk 
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching vlan members 5 untagged
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching vlan members 6 untagged
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching vlan members 7 untagged
admin@XorPlus# commit 
Commit OK. 
Save done.
admin@XorPlus# run show vlans 
VlanID   Tag        Interfaces 
------   --------   ------------------------------------------------------ 
1        untagged   ge-1/1/1, ge-1/1/2, ge-1/1/3, ge-1/1/4, ge-1/1/5                     
		    ge-1/1/6, ge-1/1/7, ge-1/1/8, ge-1/1/9, ge-1/1/10                     
                    ge-1/1/11, ge-1/1/12, ge-1/1/13, ge-1/1/14, ge-1/1/15                     
                    ge-1/1/16, ge-1/1/17, ge-1/1/18, ge-1/1/19, ge-1/1/20                     
                    ge-1/1/21, ge-1/1/22, ge-1/1/23, ge-1/1/24, te-1/1/25                     
                    te-1/1/26, te-1/1/27, te-1/1/28, te-1/1/29, te-1/1/30          
         tagged      
5        untagged   ge-1/1/2          
         tagged     
6        untagged   ge-1/1/2          
         tagged      
7        untagged   ge-1/1/2          
         tagged     

Configuring the CPU Egress Rate Limit for an VLAN Interface

admin@XorPlus# set l3-interface vlan-interface vlan200 rate-limit 1024
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# 

Creating a VLAN within the VLAN Range

You can create VLANs within the VLAN range, and then add ports to these VLANs. 
admin@XorPlus# set vlans vlan-id 2-4094
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching port-mode trunk
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching vlan members 1-4094
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching vlan members 1-4094
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching vlan members 1-4094
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# 

VLAN Configuration Example

In the following topology, the VLANs are configured for each switch.



Figure 4-1.VLAN configuration.

Configuring Switch A

For Switch A, you should configure ge-1/1/1 through ge-1/1/4 as access ports and te-1/1/49 as the trunk port because the 10Gbit link will trunk the traffic of VLAN-2 and VLAN-3.

admin@XorPlus# set vlans vlan-id 2
admin@XorPlus# set vlans vlan-id 3
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching port-mode access
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 2
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching port-mode access
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 2
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching port-mode access
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching native-vlan-id 3
admin@XorPlus# set interface gigabit-ethernet ge-1/1/4 family ethernet-switching port-mode access
admin@XorPlus# set interface gigabit-ethernet ge-1/1/4 family ethernet-switching native-vlan-id 3
admin@XorPlus#set interface gigabit-ethernet te-1/1/49 family ethernet-switching port-mode trunk
admin@XorPlus#set interface gigabit-ethernet te-1/1/49 family ethernet-switching vlan members 2
admin@XorPlus#set interface gigabit-ethernet te-1/1/49 family ethernet-switching vlan members 3
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus#
admin@XorPlus# run show vlans 
VlanID   Tag                    Interfaces
------ -------- ------------------------------------------------------
1 tagged
  untagged 	ge-1/1/5, ge-1/1/6, ge-1/1/7, ge-1/1/8, ge-1/1/9, 
		ge-1/1/10, ge-1/1/11, ge-1/1/12, ge-1/1/13, ge-1/1/14, 
		ge-1/1/15, ge-1/1/16, ge-1/1/17, ge-1/1/18, ge-1/1/19, 
		ge-1/1/20, ge-1/1/21, ge-1/1/22, ge-1/1/23, ge-1/1/24, 
		ge-1/1/25, ge-1/1/26, ge-1/1/27, ge-1/1/28, ge-1/1/29, 
		ge-1/1/30, ge-1/1/31, ge-1/1/32, ge-1/1/33, ge-1/1/34, 
		ge-1/1/35, ge-1/1/36, ge-1/1/37, ge-1/1/38, ge-1/1/39, 
		ge-1/1/40, ge-1/1/41, ge-1/1/42, ge-1/1/43, ge-1/1/44, 
		ge-1/1/45, ge-1/1/46, ge-1/1/47, ge-1/1/48, te-1/1/49, 
		te-1/1/50, te-1/1/51, te-1/1/52, 
2 tagged 	te-1/1/49, 
  untagged 	ge-1/1/1, ge-1/1/2, 
3 tagged 	te-1/1/49, 
  untagged      ge-1/1/3, ge-1/1/4, 
admin@XorPlus# 

Configuring Switch B

For Switch B, configure ge-1/1/1 through ge-1/1/4 as access ports and te-1/1/49 as the trunk port because the 10 Gbit link will trunk the traffic of VLAN-2 and VLAN-3.

admin@XorPlus# set vlans vlan-id 2
admin@XorPlus# set vlans vlan-id 3
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching port-mode access
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 2
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching port-mode access
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 2
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching port-mode access
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching native-vlan-id 3
admin@XorPlus# set interface gigabit-ethernet ge-1/1/4 family ethernet-switching port-mode access
admin@XorPlus# set interface gigabit-ethernet ge-1/1/4 family ethernet-switching native-vlan-id 3
admin@XorPlus#set interface gigabit-ethernet te-1/1/49 family ethernet-switching port-mode trunk
admin@XorPlus#set interface gigabit-ethernet te-1/1/49 family ethernet-switching vlan members 2
admin@XorPlus#set interface gigabit-ethernet te-1/1/49 family ethernet-switching vlan members 3
admin@XorPlus# commit 
Waiting for merging configuration.
Commit OK.
Save done.
admin@XorPlus#
admin@XorPlus# run show vlans 
VlanID 	Tag                   Interfaces
------ -------- ------------------------------------------------------
1 tagged 
  untagged 	ge-1/1/5, ge-1/1/6, ge-1/1/7, ge-1/1/8, ge-1/1/9, 
		ge-1/1/10, ge-1/1/11, ge-1/1/12, ge-1/1/13, ge-1/1/14, 
		ge-1/1/15, ge-1/1/16, ge-1/1/17, ge-1/1/18, ge-1/1/19, 
		ge-1/1/20, ge-1/1/21, ge-1/1/22, ge-1/1/23, ge-1/1/24, 
		ge-1/1/25, ge-1/1/26, ge-1/1/27, ge-1/1/28, ge-1/1/29, 
		ge-1/1/30, ge-1/1/31, ge-1/1/32, ge-1/1/33, ge-1/1/34, 
		ge-1/1/35, ge-1/1/36, ge-1/1/37, ge-1/1/38, ge-1/1/39, 
		ge-1/1/40, ge-1/1/41, ge-1/1/42, ge-1/1/43, ge-1/1/44, 
		ge-1/1/45, ge-1/1/46, ge-1/1/47, ge-1/1/48, te-1/1/49, 
		te-1/1/50, te-1/1/51, te-1/1/52, 
2 tagged 	te-1/1/49, 
  untagged      ge-1/1/1, ge-1/1/2, 
3 tagged        te-1/1/49, 
  untagged      ge-1/1/3, ge-1/1/4,



Copyright © 2024 Pica8 Inc. All Rights Reserved.