02-VLAN Configuration

Download

Table of Contents

Chapter 1 VLAN Configuration. 1-1

1.1 Introduction to VLAN. 1-1

1.1.1 VLAN Overview. 1-1

1.1.2 VLAN Fundamental 1-2

1.1.3 VLAN Classification. 1-4

1.2 Configuring Basic VLAN Attributes. 1-4

1.3 Basic VLAN Interface Configuration. 1-5

1.4 Port-Based VLAN Configuration. 1-6

1.4.1 Introduction to Port-Based VLAN. 1-6

1.4.2 Configuring an Access-Port-Based VLAN. 1-8

1.4.3 Configuring a Trunk-Port-Based VLAN. 1-9

1.4.4 Configuring a Hybrid-Port-Based VLAN. 1-10

1.5 MAC Address-Based VLAN Configuration. 1-11

1.5.1 Introduction to MAC Address-Based VLAN. 1-11

1.5.2 Configuring a MAC Address-Based VLAN. 1-12

1.6 Protocol-Based VLAN Configuration. 1-13

1.6.1 Introduction to Protocol-Based VLAN. 1-13

1.6.2 Configuring a Protocol-Based VLAN. 1-13

1.7 Configuring IP-Subnet-Based VLAN. 1-15

1.7.1 Introduction. 1-15

1.7.2 Configuring an IP-Subnet-Based VLAN. 1-15

1.8 Displaying and Maintaining VLAN. 1-16

1.9 VLAN Configuration Example. 1-17

Chapter 2 Voice VLAN Configuration. 2-1

2.1 Introduction to Voice VLAN. 2-1

2.1.1 Voice VLAN Modes on a Port 2-2

2.1.2 Security Mode and Normal Mode for the Voice VLAN. 2-4

2.2 Configuring Voice VLAN. 2-5

2.2.1 Configuration Prerequisites. 2-5

2.2.2 Configuring Voice VLAN Mode on a Port to Automatic Mode. 2-5

2.2.3 Configuring Voice VLAN Mode on a Port to Manual Mode. 2-6

2.3 Displaying and Maintaining Voice VLAN. 2-7

2.4 Voice VLAN Configuration Examples. 2-8

2.4.1 Automatic Voice VLAN Mode Configuration Example. 2-8

2.4.2 Manual Voice VLAN Mode Configuration Example. 2-10

Chapter 3 GVRP Configuration. 3-1

3.1 Introduction to GVRP. 3-1

3.1.1 GARP. 3-1

3.1.2 GVRP. 3-4

3.1.3 Protocols and Standards. 3-5

3.2 GVRP Configuration Task List 3-5

3.3 Configuring GVRP. 3-5

3.3.1 Enabling GVRP. 3-5

3.3.2 Configuring GARP Timers. 3-6

3.4 Displaying and Maintaining GVRP. 3-7

3.5 GVRP Configuration Examples. 3-8

3.5.1 GVRP Configuration Example I 3-8

3.5.2 GVRP Configuration Example II 3-9

3.5.3 GVRP Configuration Example III 3-10

 


Chapter 1  VLAN Configuration

When configuring VLAN, go to these sections for information you are interested in:

l           Introduction to VLAN

l           Configuring Basic VLAN Attributes

l           Basic VLAN Interface Configuration

l           Port-Based VLAN Configuration

l           MAC Address-Based VLAN Configuration

l           Protocol-Based VLAN Configuration

l           Configuring IP-Subnet-Based VLAN

l           Displaying and Maintaining VLAN

l           VLAN Configuration Example

1.1  Introduction to VLAN

1.1.1  VLAN Overview

Ethernet is a network technology based on the Carrier Sense Multiple Access/Collision Detect (CSMA/CD) mechanism. As the medium is shared in an Ethernet, network performance may degrade as the number of hosts on the network is increasing. If the number of the hosts in the network reaches a certain level, problems caused by collisions, broadcasts, and so on emerge, which may cause the network operating improperly. In addition to the function that suppresses collisions (which can also be achieved by interconnecting LANs), virtual LAN (VLAN) can also isolate broadcast packets. VLAN divides a LAN into multiple logical LANs with each being a broadcast domain. Hosts in the same VLAN can communicate with each other like in a LAN. However, hosts from different VLANs cannot communicate directly. In this way, broadcast packets are confined to a single VLAN, as illustrated in the following figure.

Figure 1-1 A VLAN diagram

A VLAN is not restricted by physical factors, that is to say, hosts that reside in different network segments may belong to the same VLAN, users in a VLAN can be connected to the same switch, or span across multiple switches or routers.

VLAN technology has the following advantages:

1)         Broadcast traffic is confined to each VLAN, reducing bandwidth utilization and improving network performance.

2)         LAN security is improved. Packets in different VLANs are isolated at Layer 2. That is, users in a VLAN cannot communicate with users in other VLANs directly, unless routers or Layer 3 switches are used.

3)         A more flexible way to establish virtual workgroups. With VLAN technology, a virtual workgroup can be created spanning physical network segments. That is, users from the same workgroup do not have to be within the same physical area, making network construction and maintenance much easier and more flexible.

1.1.2  VLAN Fundamental

To enable packets being distinguished by the VLANs they belong to, The VLAN tag fields used to identify VLANs are added to packets. As common switches operate on the data link layer of the OSI model, they only process data link layer encapsulation information and the VLAN tag thus needs to be inserted to the data link layer encapsulation.

The format of the packets carrying the VLAN tag fields is defined in IEEE 802.1Q, which is issued by IEEE in 1999.

In the header of a traditional Ethernet data frame, the field following the destination MAC address and the source MAC address is the Type field, which indicates the upper layer protocol type. Figure 1-2 illustrates the format of a traditional Ethernet frame, where DA stands for destination MAC address, SA stands for source MAC address, and Type stands for the upper layer protocol type of the frame.

Figure 1-2 The format of a traditional Ethernet frame

IEEE802.1Q defines a four-byte VLAN Tag between the DA&SA field and the Type field to carry VLAN-related information, as shown in Figure 1-3.

Figure 1-3 The position and the format of the VLAN Tag

The VLAN Tag comprises four fields: the tag protocol identifier (TPID) field, the Priority field, the canonical format indicator (CFI) field, and the VLAN ID field.

l           The TPID field, 16 bits in length and with a value of 0x8100, indicates that a packet carries a VLAN tag with it.

l           The Priority field, three bits in length, indicates the 802.1p priority of a packet. For information about packet priority, refer to the QoS part of the manual.

l           The CFI field, one bit in length, specifies whether or not the MAC addresses are encapsulated in standard format when packets are transmitted across different medium. With the field set to 0, MAC addresses are encapsulated in standard format; with the field set to 1, MAC addresses are encapsulated in non-standard format. The filed is 0 by default.

l           The VLAN ID field, 12 bits in length and with its value ranging from 0 to 4095, identifies the ID of the VLAN a packet belongs to. As VLAN IDs of 0 and 4095 are reserved by the protocol, the value of this field actually ranges from 1 to 4094.

A network device determines the VLAN to which a packet belongs to by the VLAN ID field the packet carries. The VLAN Tag determines the way a packet is processed. For more information, refer to section Introduction to Port-Based VLAN.

 

&  Note:

The frame format mentioned here is that of Ethernet II. Besides Ethernet II encapsulation, other types of encapsulation, including 802.2 LLC, 802.2 SNAP, and 802.3 raw are also supported by Ethernet. The VLAN tag fields are also added to packets adopting these encapsulation formats for VLAN identification.

 

1.1.3  VLAN Classification

Based on how VLANs are established, VLANs fall into different categories. The following types are the most commonly used:

l           Port-based

l           MAC address-based

l           Protocol-based

l           IP-subnet-based

l           Policy-based

l           Other types

The S5500-EI series Ethernet switches support port-based VLAN, MAC address-based VLAN, protocol-based VLAN, and IP-subnet-based VLAN.

1.2  Configuring Basic VLAN Attributes

Follow these steps to configure basic VLAN attributes:

To do…

Use the command…

Remarks

Enter system view

system-view

Create VLANs

vlan { vlan-id1 [ to vlan-id2 ] | all }

Optional

Using this command can create multiple VLANs in a bulk.

Enter VLAN view

vlan vlan-id

Required

If the specified VLAN does not exist, the command creates the VLAN and then enters its view.

By default, only the default VLAN (that is, VLAN 1) exists in the system.

Specify a descriptive string for the VLAN

description text

Optional

VLAN ID used by default, for example, “VLAN 0001”

 

&  Note:

l      As the default VLAN, VLAN 1 cannot be created or removed.

l      You cannot manually create or remove reserved VLANs, which are reserved for specific functions.

l      Dynamic VLANs cannot be removed using the undo vlan command.

l      If a VLAN has a QoS policy configured, the VLAN cannot be removed.

l      If a VLAN is configured as a remote-probe VLAN for remote port mirroring, it cannot be removed using the undo vlan command unless its remote-probe VLAN configuration is removed.

 

1.3  Basic VLAN Interface Configuration

Hosts of different VLANs cannot communicate directly. That is, routers or Layer 3 switches are needed for packets to travel across different VLANs. VLAN interfaces are used to forward VLAN packets on Layer 3.

VLAN interfaces are Layer 3 virtual interfaces (which do not exist physically on devices) used for Layer 3 interoperability between different VLANs. Each VLAN can have one VLAN interface. Packets of a VLAN can be forwarded on network layer through the corresponding VLAN interface. As each VLAN forms a broadcast domain, a VLAN can be an IP network segment and the VLAN interface can be the gateway to enable IP address-based Layer 3 forwarding.

Follow these steps to configure VLAN interface basic attributes:

To do…

Use the command…

Remarks

Enter system view

system-view

Create a VLAN interface or enter VLAN interface view

interface Vlan-interface vlan-interface-id

Required

This command leads you to VLAN interface view if the VLAN interface already exists.

Configure an IP address for the VLAN interface

ip address ip-address { mask | mask-length } [ sub ]

Optional

Not configured by default

Specify the descriptive string for the VLAN interface

description text

Optional

VLAN interface name is used by default, for example, “Vlan-interface1 Interface”.

Bring up the VLAN interface

undo shutdown

Optional

By default, a VLAN interface is up. The state of a VLAN interface also depends on the states of the ports in the VLAN. If all the ports in the VLAN are down, the VLAN interface is down; if one or more ports in the VLAN are up, the VLAN interface is up.

If a VLAN interface is manually shut down, the VLAN interface is always down regardless of the states of ports in the VLAN.

 

&  Note:

Before creating a VLAN interface, ensure that the corresponding VLAN already exists. Otherwise, the specified VLAN interface will not be created.

 

1.4  Port-Based VLAN Configuration

1.4.1  Introduction to Port-Based VLAN

This is the simplest and yet the most effective way of classifying VLANs. It groups VLAN members by port. After added to a VLAN, a port can forward the packets of the VLAN.

I. Port link type

Based on the tag handling mode, a port’s link type can be one of the following three:

l           Access port: the port only belongs to one VLAN, normally used to connect user device;

l           Trunk port: the port can belong to multiple VLANs, can receive/send packets for multiple VLANs, normally used to connect network devices;

l           Hybrid port: the port can belong to multiple VLANs, can receive or send packets for multiple VLANs, used to connect either user or network devices;

The differences between Hybrid and Trunk port:

l           A Hybrid port allows packets of multiple VLANs to be sent without the Tag label;

l           A Trunk port only allows packets from the default VLAN to be sent without the Tag label.

II. Default VLAN

You can configure the default VLAN for a port. By default, VLAN 1 is the default VLAN for all ports. However, this can be changed as needed.

l           An Access port only belongs to one VLAN. Therefore, its default VLAN is the VLAN it resides in and cannot be configured.

l           You can configure the default VLAN for the Trunk port or the Hybrid port as they can both belong to multiple VLANs.

l           After deletion of the default VLAN using the undo vlan command, the default VLAN for an Access port will revert to VLAN 1, whereas that for the Trunk or Hybrid port remains, meaning the port can use a nonexistent VLAN as the default VLAN.

 

&  Note:

For a port in automatic voice VLAN mode, do not set the voice VLAN as the default VLAN of the port. Otherwise, the system prompts error information. For information about voice VLAN, refer to Voice VLAN Configuration.

 

Configured with the default VLAN, a port handles packets in the following ways:

Port type

Inbound packets handling

Outbound packets handling

If no tag is carried in the packet

If a tag is carried in the packet

Access Port

Tag the packet with the default VLAN ID

l      Receive the packet if its VLAN ID is the same as the default VLAN ID

l      Discard the packet if its VLAN ID is different from the default VLAN ID

Strip the Tag and send the packet as the VLAN ID is the same with the default VLAN ID

Trunk port

Check whether the default VLAN ID of the port is in the list of VLANs allowed to pass through the port, if yes, tag the packet with the default VLAN ID; if no, discard the packet

l      Receive the packet if the VLAN ID is in the list of VLANs allowed to pass through the port

l      Discard the packet if the VLAN ID is not in the list of VLANs allowed to pass through the port

l      Strip the tag and send the packet if the VLAN ID is the same as the default VLAN ID

l      Keep the tag and send the packet if the VLAN ID is not the same as the default VLAN ID but allowed to pass through the port

Hybrid port

Send the packet if the VLAN ID is allowed to pass through the port. Use the port hybrid vlan command to configure whether the port keeps or strips the tags when sending packets of a VLAN (including the default VLAN).

 

1.4.2  Configuring an Access-Port-Based VLAN

There are two ways to configure Access-port-based VLAN: one way is to configure in VLAN view, the other way is to configure in Ethernet port view/port group view.

Follow these steps to configure the Access-port-based VLAN in VLAN view:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter VLAN view

vlan vlan-id

Required

If the specified VLAN does not exist, this command be created first creates the VLAN before entering its view.

Add an Access port to the current VLAN

port interface-list

Required

By default, system will add all ports to VLAN 1.

 

Follow these steps to configure the Access-port-based VLAN in Ethernet port view/port group view:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter Ethernet port view or port group view

Enter Ethernet port view

interface interface-type interface-number

Use either command

In Ethernet port view, the subsequent configurations only apply to the current port; In port group view, the subsequent configurations apply to all ports in the port group.

Enter port group view

port-group { manual port-group-name | aggregation agg-id }

Configure the port link type as Access

port link-type access

Optional

The link type of a port is Access by default.

Add the current Access port to a specified VLAN

port access vlan vlan-id

Optional

By default, all Access ports belong to VLAN 1.

 

&  Note:

To add an Access port to a VLAN, make sure the VLAN already exists.

 

1.4.3  Configuring a Trunk-Port-Based VLAN

A Trunk port may belong to multiple VLANs, and you can only perform this configuration in Ethernet port view or port group view.

Follow these steps to configure the Trunk-port-based VLAN:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter Ethernet port view or port group view

Enter Ethernet port view

interface interface-type interface-number

Use either command

In Ethernet port view, the subsequent configurations only apply to the current port; in port group view, the subsequent configurations apply to all ports in the port group.

Enter port group view

port-group { manual port-group-name | aggregation agg-id }

Configure the port link type as Trunk

port link-type trunk

Required

Allow the specified VLANs to pass through the current Trunk port

port trunk permit vlan { vlan-id-list | all }

Required

By default, all Trunk ports only allow packets of VLAN 1 to pass.

Configure the default VLAN for the Trunk port

port trunk pvid vlan vlan-id

Optional

VLAN 1 is the default by default.

 

&  Note:

l      To convert a Trunk port into a Hybrid port (or vice versa), you need to use the Access port as a medium. For example, the Trunk port has to be configured as an Access port first and then a Hybrid port.

l      The default VLAN IDs of the Trunk ports on the local and peer devices must be the same. Otherwise, packets cannot be transmitted properly.

 

1.4.4  Configuring a Hybrid-Port-Based VLAN

A Hybrid port may belong to multiple VLANs, and this configuration can only be performed in Ethernet port view or port group view.

Follow these steps to configure the Hybrid-port-based VLAN:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter Ethernet port view or port group view

Enter Ethernet port view

interface interface-type interface-number

Use either command;

In Ethernet port view, the subsequent configurations only apply to the current port; in port group view, the subsequent configurations apply to all ports in the port group

Enter port group view

port-group { manual port-group-name | aggregation agg-id }

Configure the port link type as Hybrid

port link-type hybrid

Required

Allow the specified VLANs to pass through the current Hybrid port

port hybrid vlan vlan-id-list { tagged | untagged }

Required

By default, all Hybrid ports only allow packets of VLAN 1 to pass.

Configure the default VLAN of the Hybrid port

port hybrid pvid vlan vlan-id

Optional

VLAN 1 is the default by default

 

&  Note:

l      To configure a Trunk port into a Hybrid port (or vice versa), you need to use the Access port as a medium. For example, the Trunk port has to be configured as an Access port first and then a Hybrid port.

l      Ensure that the VLANs already exist before configuring them to pass through a Hybrid port.

l      The default VLAN IDs of the Hybrid ports on the local and the peer devices must be the same. Otherwise, packets cannot be transmitted properly.

 

1.5  MAC Address-Based VLAN Configuration

1.5.1  Introduction to MAC Address-Based VLAN

With MAC address-based VLANs created, the VLAN to which a packet belongs is determined by its source MAC address, and packets in a MAC address-based VLAN are forwarded after being tagged with the tag of the VLAN. This function is usually coupled with the security technologies (such as 802.1X) to provide secure and flexible network accesses for terminal devices.

I. MAC address-based VLAN implementation

With MAC address-based VLANs created on a port, the port operates as follows:

l           If an untagged packet is received, the port checks its MAC address VLAN entries for the one that matches the source MAC address of the packet. If the entry exists, the packet is forwarded based on the matched VLAN ID and the precedence value; otherwise, the packet is forwarded based on other match rules.

l           If a tagged packet is received, the port processes the packet in the same way as it processes port-based VLAN packets, that is, forwards the packet if the VLAN corresponding to the VLAN tag is permitted by the port or drops the packet if the VLAN corresponding to the VLAN tag is not permitted by the port.

II. The ways to create MAC address-based VLANs

A MAC address-based VLAN can be created in one of the following two ways.

l           Static configuration (through CLI)

You can associate MAC addresses and VLANs by using corresponding commands.

l           Auto configuration though the authentication server (that is, VLAN issuing)

The device associates MAC addresses and VLANs dynamically based on the information provided by the authentication server. If a user goes offline, the corresponding MAC address-to-VLAN association is removed automatically. Auto configuration requires MAC address-to–VLAN mapping relationship be configured on the authentication server. For detailed information, refer to 802.1x Configuration.

The two configuration methods can be used at the same time, that is, you can configure a MAC address-to-VLAN entry on both the local device and the authentication serer at the same time. Note that the MAC address-to-VLAN entry configuration takes effect only when the configuration on the local device is consistent with that on the authentication server.

1.5.2  Configuring a MAC Address-Based VLAN

 

&  Note:

MAC address-based VLANs are available only on Hybrid ports.

 

Follow these steps to configure a MAC address-based VLAN:

To do...

Use the  command...

Remarks

Enter system view

system-view

Associate MAC addresses with a VLAN

mac-vlan mac-address mac-addr [ mask mac-mask ] vlan vlan-id [ priority priority ]

Required

Enter Ethernet interface view or port group view

Enter Ethernet interface view

interface interface-type interface-number

Use either command.

The configuration performed in Ethernet interface view applies to the current port only; the configuration performed in port group view applies to all the ports in the port group.

Enter port group view

port-group { manual port-group-name | aggregation agg-id }

Configure the link type of the port(s) as hybrid

port link-type hybrid

Required

Configure the current hybrid port(s) to permit packets of specific MAC address-based VLANs

port hybrid vlan vlan-id-list { tagged | untagged }

Required

By default, a hybrid port only permits the packets of VLAN 1.

Enable MAC address-based VLAN

mac-vlan enable

Required

Disabled by default

Configure VLAN matching precedence

vlan precedence { mac-vlan | ip-subnet-vlan }

Optional

By default, VLANs are preferentially matched based on MAC addresses.

 

1.6  Protocol-Based VLAN Configuration

1.6.1  Introduction to Protocol-Based VLAN

 

&  Note:

Protocol-based VLANs are only applicable to Hybrid ports.

 

In this approach, inbound packets are assigned with different VLAN IDs based on their protocol type and encapsulation format. The protocols that can be used to categorize VLANs include: IP, IPX, and AppleTalk (AT). The encapsulation formats include: Ethernet II, 802.3 raw, 802.2 LLC, and 802.2 SNAP.

A protocol-based VLAN can be defined by a protocol template, which is determined by encapsulation format and protocol type. A port can be associated to multiple protocol templates. An untagged packet (that is, packet carrying no VLAN tag) reaching a port associated with a protocol-based VLAN will be processed as follows.

l           If the packet matches a protocol template, the packet will be tagged with the VLAN ID of the protocol-based VLAN defined by the protocol template.

l           If the packet matches no protocol template, the packet will be tagged with the default VLAN ID of the port.

The port processes a tagged packet (that is, a packet carrying a VLAN tag) in the same way as it processes packets of a port-based VLAN.

l           If the port is configured to permit the VLAN identified by this VLAN tag, the port forwards the packet.

l           If the port is configured to deny the VLAN identified by this VLAN tag, the port discards the packet.

This feature is mainly used to bind the service type with VLAN for ease of management and maintenance.

1.6.2  Configuring a Protocol-Based VLAN

Follow these steps to configure a protocol-based VLAN:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter VLAN view

vlan vlan-id

Required

If the specified VLAN does not exist, this command creates the VLAN and then enters its view.  

Configure the protocol-based VLAN and specify the protocol template

protocol-vlan [ protocol-index ] { at | ipv4 | ipv6 | ipx { ethernetii | llc | raw | snap } | mode { ethernetii etype etype-id | llc { dsap dsap-id [ ssap ssap-id ] | ssap ssap-id } | snap etype etype-id } }

Required

Exit the VLAN view

quit

Required

Enter Ethernet port view or port group view

Enter Ethernet port view

interface interface-type interface-number

Use either command

In Ethernet port view, the subsequent configurations only apply to the current port; in port group view, the subsequent configurations apply to all ports in the port group

Enter port group view

port-group { manual port-group-name | aggregation agg-id }

Configure the port link type as Hybrid

port link-type hybrid

Required

Allow the packets of protocol-based VLANs to pass through the current Hybrid port in untagged way (with the tags of the packets stripped)

port hybrid vlan vlan-id-list untagged

Required

Configure the association between the Hybrid port and the protocol-based VLAN

port hybrid protocol-vlan vlan vlan-id { protocol-index [ to protocol-end ] | all }

Required

 

  Caution:

l      At present, the AppleTalk-based protocol template cannot be associated with a port on an S55