NetEngine 8000 M14, M8 and M4 V800R023C00SPC500 Configuration Guide

VLAN Configuration

VLAN Configuration

VLAN Description

Overview of VLANs

Definition

The virtual local area network (VLAN) technology logically divides a physical LAN into multiple VLANs that are broadcast domains. Each VLAN contains a group of PCs that have the same requirements. A VLAN has the same attributes as a LAN. PCs of a VLAN can be placed on different LAN segments. Hosts can communicate within the same VLAN, while cannot communicate in different VLANs. If two PCs are located on one LAN segment but belong to different VLANs, they do not broadcast packets to each other. In this manner, network security is enhanced.

Purpose

The traditional LAN technology based on the bus structure has the following defects:
  • Conflicts are inevitable if multiple nodes send messages simultaneously.

  • Messages are broadcast to all nodes.

  • Networks have security risks as all the hosts in a LAN share the same transmission channel.

The network constructs a collision domain. More computers on the network cause more conflicts and lower network efficiency. The network is also a broadcast domain. When many computers on the network send data, broadcast traffic consumes much bandwidth.

Traditional networks face collision domain and broadcast domain issues, and cannot ensure information security.

To offset the defects, bridges and Layer 2 switches are introduced to consummate the traditional LAN.

Bridges and Layer 2 switches can forward data from the inbound interface to outbound interface in switching mode. This properly solves the access conflict problem on the shared media, and limits the collision domain to the port level. Nevertheless, the bridge or Layer 2 switch networking can only solve the problem of the collision domain, but not the problems of broadcast domain and network security.

In this document, the Layer 2 switch is referred to as the switch for short.

To reduce the broadcast traffic, you need to enable the broadcast only among hosts that need to communicate with each other, and isolate the hosts that do not need the broadcast. A router can select routes based on IP addresses and effectively suppress broadcast traffic between two connected network segments. The router solution, however, is costly. Therefore, multiple logical LANs, namely, VLANs are developed on the physical LAN.

In this manner, a physical LAN is divided into multiple broadcast domains, that is, multiple VLANs. The intra-VLAN communication is not restricted, while the inter-VLAN communication is restricted. As a result, network security is enhanced.

For example, if different companies in the same building build their LANs separately, it is costly; if these companies share the same LAN in the building, there may be security problems.

Figure 1-746 Typical VLAN application

Figure 1-746 is a networking diagram of a typical VLAN application. Device A, Device B, and Device C are placed at different locations, such as different floors in an office building. Each switch connects to three computers which belong to three different VLANs. In Figure 1-746, each dashed line frame identifies a VLAN. Packets of enterprise customers in the same VLAN are broadcast within the VLAN but not among VLANs. In this way, enterprise customers in the same VLAN can share resources as well as protect their information security.

This application shows the following VLAN advantages:
  • Broadcast domains are confined. A broadcast domain is confined to a VLAN. This saves bandwidth and improves network processing capabilities.
  • Network security is enhanced. Packets from different VLANs are separately transmitted. PCs in one VLAN cannot directly communicate with PCs in another VLAN.
  • Network robustness is improved. A fault in a VLAN does not affect PCs in other VLANs.
  • Virtual groups are set up flexibly. With the VLAN technology, PCs in different geographical areas can be grouped together. This facilitates network construction and maintenance.

Benefits

The VLAN technology offers the following benefits:
  • Saves network bandwidth resources by isolating broadcast domains.

  • Improves communication security and facilitates service deployment.

Understanding VLANs

Basic Concepts

VLAN Frame Format

IEEE 802.1Q modifies the Ethernet frame format by adding a 4-byte 802.1Q tag between the source MAC address field and the Length/Type field, as shown in Figure 1-747.

Figure 1-747 VLAN frame format defined in IEEE 802.1Q

An 802.1Q tag contains four fields:

  • EType

    The 2-byte EType field indicates a frame type. If the value of the field is 0x8100, it indicates an 802.1Q frame. If a device that does not support 802.1Q frames receives an 802.1Q frame, it discards the frame.

  • PRI

    The 3-bit Priority field indicates the frame priority. A greater PRI value indicates a higher frame priority. Frames with a higher priority are preferentially sent in the case of congestion.

  • CFI

    The 1-bit Canonical Format Indicator (CFI) field indicates whether a MAC address is in the canonical format. If the CFI field value is 0, the MAC address is in canonical format. If the CFI field value is 1, the MAC address is not in canonical format. This field is mainly used to differentiate among Ethernet frames, Fiber Distributed Digital Interface (FDDI) frames, and token ring frames. The CFI field value in an Ethernet frame is 0.

  • VID

    The 12-bit VLAN ID (VID) field indicates to which VLAN a frame belongs. A VID is an integer ranging from 0 to 4095. The values 0 and 4095 are reserved, and therefore available VIDs are in the range from 1 to 4094.

    Each frame sent by an 802.1Q-capable switch carries a VID. On a VLAN, Ethernet frames are classified into the following types:
    • Tagged frames: frames with 4-byte 802.1Q tags.
    • Untagged frames: frames without 4-byte 802.1Q tags.
Link Types

VLAN links can be divided into the following types:

  • Access link: a link connecting a user host and a switch. Generally, a host does not know which VLAN it belongs to, and host hardware cannot identify frames with VLAN tags. Therefore, hosts send and receive only untagged frames. In Figure 1-748, links between the hosts and the switches are access links.

  • Trunk link: a link connecting switches. Data of different VLANs is transmitted along a trunk link. The two ends of a trunk link must be able to identify the VLANs to which the data frames belong. Therefore, only tagged frames are transmitted along trunk links. In Figure 1-748, links between switches are trunk links. Frames transmitted over trunk links carry VLAN tags.

Figure 1-748 Link types

Port Types

Some ports of a device can identify VLAN frames defined by IEEE 802.1Q, whereas others cannot. Ports can be divided into four types based on whether they can identify VLAN frames:

  • Access port

    An access port connects a switch to a host through an access link, as shown in Figure 1-748. An access port has the following features:

    • Allows only frames tagged with the port default VLAN ID (PVID) to pass.

    • Adds a PVID to its received untagged frame.

    • Removes the tag from a frame before it sends the frame.

  • Trunk port

    A trunk port connects a switch to another switch through a trunk link, as shown in Figure 1-748. A trunk port has the following features:

    • Allows tagged frames from multiple VLANs to pass.

    • Directly sends the frame if the port permits the VLAN ID carried in the frame.

    • Discards the frame if the port denies the VLAN ID carried in the frame.

  • Hybrid port

    A hybrid port connects a switch either to a host through an access link or to another switch through a trunk link, as shown in Figure 1-749. A hybrid port allows frames from multiple VLANs to pass and can remove VLAN tags from some outgoing VLAN frames.

    Figure 1-749 Ports

  • QinQ port

    An 802.1Q-in-802.1Q (QinQ) port refers to a QinQ-enabled port. A QinQ port adds an outer tag to a single-tagged frame. In this manner, the number of VLANs can meet the requirement of networks.

    Figure 1-750 shows the format of a QinQ frame. The outer tag is a public network tag for carrying a public network VLAN ID. The inner tag is a private network tag for carrying a private network VLAN ID.

    Figure 1-750 QinQ frame format

    For details on the QinQ protocol, see QinQ.

VLAN Classification

VLANs are classified based on port numbers. In this mode, VLANs are classified based on the numbers of ports on a switching device. The network administrator configures a unique PVID for each port on the switch. When a data frame reaches a port which is configured with a PVID, the frame is marked with the PVID if the data frame carries no VLAN tag. If the data frame carries a VLAN tag, the switch will not add a VLAN tag to the data frame even if the port is configured with a PVID. Different types of ports process VLAN frames in different manners.

VLAN Communication Principles

Basic Principles

To improve frame processing efficiency, frames arriving at a switch must carry a VLAN tag for uniform processing. If an untagged frame enters a switch port which has a PVID configured, the port then adds a VLAN tag whose VID is the same as the PVID to the frame. If a tagged frame enters a switch port that has a PVID configured, the port does not add any tag to the frame.

The switch processes frames in a different way according to the port types. The following table describes how a port processes a frame.

Table 1-383 Port types

Port Type

Method for Processing a Received Untagged Frame

Method for Processing a Received Tagged Frame

Method for Sending a Frame

Application

Access port

Accepts the frame and adds a tag with the default VLAN ID to the frame.

  • Accepts the frame if the VLAN ID carried in the frame is the same as the default VLAN ID.
  • Discards the frame if the VLAN ID carried in the frame is different from the default VLAN ID.

Removes the tag from the frame and sends the frame.

An access port connects a switch to a PC and can be added to only one VLAN.

Trunk port

Discards the frame.

  • Accepts the frame if the port permits the VLAN ID carried in the frame.
  • Discards the frame if the port denies the VLAN ID carried in the frame.
  • Directly sends the frame if the port permits the VLAN ID carried in the frame.
  • Discards the frame if the port denies the VLAN ID carried in the frame.

A trunk port can be added to multiple VLANs to send and receive frames for these VLANs. A trunk port connects a switch to another switch or to a router.

Hybrid port

  • If only the port default vlan command is run on a hybrid port, the hybrid port receives the frame and adds the default VLAN tag to the frame.
  • If only the port trunk allow-pass command is run on a hybrid port, the hybrid port discards the frame.
  • If both the port default vlan and port trunk allow-pass commands are run on a hybrid port, the hybrid port receives the frame and adds the VLAN tag with the default VLAN ID specified in the port default vlan command to the frame.
  • If only the port default vlan command is run on a hybrid port:
    • The hybrid port accepts the frame if the frame's VLAN ID is the same as the default VLAN ID of the port.
    • The hybrid port discards the frame if the frame's VLAN ID is different from the default VLAN ID of the port.
  • If only the port trunk allow-pass command is run on a hybrid port:
    • The hybrid port accepts the frame if the frame's VLAN ID is in the permitted range of VLAN IDs.
    • The hybrid port discards the frame if the frame's VLAN ID is not in the permitted range of VLAN IDs.
  • If both the port default vlan and port trunk allow-pass commands are run on a hybrid port:
    • The hybrid port accepts the frame if the frame's VLAN ID is in the permitted range of VLAN IDs specified in the port trunk allow-pass command or is the same as the default VLAN ID specified in the port default vlan command.
    • The hybrid port discards the frame if the frame's VLAN ID is not in the permitted range of VLAN IDs specified in the port trunk allow-pass command or is different from the default VLAN ID specified in the port default vlan command.
  • If only the port default vlan command is run on the hybrid port and the frame's VLAN ID is the same as the default VLAN ID, the hybrid port removes the VLAN tag and forwards the frame. Otherwise, the hybrid port discards the frame.

  • If only the port trunk allow-pass command is run on a hybrid port:
    • The hybrid port forwards the frame if the frame's VLAN ID is in the permitted range of VLAN IDs.
    • The hybrid port discards the frame if the frame's VLAN ID is not in the permitted range of VLAN IDs.
  • If both the port default vlan and port trunk allow-pass commands are run on a hybrid port:
    • The hybrid port removes the VLAN tag and forwards the frame if the frame's VLAN ID is the same as the default VLAN ID of the port.
    • The hybrid port forwards the frame if the frame's VLAN ID is different from the default VLAN ID of the port but in the permitted range of VLAN IDs specified in the port trunk allow-pass command. Otherwise, the hybrid port discards the frame.
    NOTE:

    The hybrid port removes the VLAN tag and forwards the frame if the frame's VLAN ID is the same as the default VLAN ID configured using the port default vlan command and the default VLAN ID is in the permitted range of VLAN IDs specified in the port trunk allow-pass command.

A hybrid port can be added to multiple VLANs to send and receive frames of these VLANs. A hybrid port can be used to connect network devices or connect user devices.

QinQ port

QinQ ports are enabled with the IEEE 802.1QinQ protocol. A QinQ port adds a tag to a single-tagged frame, and thus supports a maximum of 4094 x 4094 VLANs, which meets the requirement of a Metropolitan Area Network (MAN) for the number of VLANs.

Principles of Intra-VLAN Communication Across Switches

Hosts of a VLAN are sometimes connected to different switches. In this situation, ports of different switches must be able to recognize and send packets belonging to this VLAN. To this end, trunk links are required.

A trunk link has two functions:

  • Reply function

    A trunk link can transparently transmit VLAN packets from a switch to another interconnected switch.

  • Trunk function

    A trunk link can transmit multiple VLAN packets.

Figure 1-751 Trunk link communication

On the network shown in Figure 1-751, the trunk link between DeviceA and DeviceB must support both the intra-VLAN 2 communication and the intra-VLAN 3 communication. Therefore, the ports at both ends of the trunk link must be configured to be bound to VLAN 2 and VLAN 3. That is, Port 2 on DeviceA and Port 1 on DeviceB must belong to both VLAN 2 and VLAN 3.

Host A sends a frame to Host B in the following process:

  1. The frame is first sent to Port 4 on DeviceA.

  2. A tag is added to the frame on Port 4. The VID field of the tag is set to 2, that is, the ID of the VLAN to which Port 4 belongs.

  3. DeviceA checks whether its MAC address table contains the MAC address destined for Host B.
    • If so, DeviceA sends the frame to the outbound interface Port 2.
    • If not, DeviceA sends the frame to all interfaces bound to VLAN 2 except for Port 4.
  4. Upon receipt of the frame, Port 2 sends the frame to DeviceB.

  5. After receiving the frame, DeviceB checks whether its MAC address table contains the MAC address destined for Host B.
    • If so, DeviceB sends the frame to the outbound interface Port 3.
    • If not, DeviceB sends the frame to all interfaces bound to VLAN 2 except for Port 1.
  6. Upon receipt of the frame, Port 3 sends the frame to Host B.

The intra-VLAN 3 communication is similar, and is omitted here.

Inter-VLAN Communication Principles

After VLANs are configured, hosts in different VLANs cannot directly communicate with each other at Layer 2. To implement communication between VLANs, establish IP routes. The specific implementation schemes are as follows:

  • Layer 2 switch + router

    On the network shown in Figure 1-752, a switched Ethernet interface on a Layer 2 switch is connected to a routed Ethernet interface on a router for LAN communication.

    Figure 1-752 Inter-VLAN communication based on a Layer 2 switch and a router

    If VLAN 2 and VLAN 3 are configured on the switch, to enable VLAN 2 to communicate with VLAN 3, you need to create two sub-interfaces on the routed Ethernet interface that is connected to the switch. Sub-interface 1 is used to forward traffic to VLAN 2, and sub-interface 2 is used to forward traffic to VLAN 3.

    Then, configure 802.1Q encapsulation on and assign IP addresses to the sub-interfaces.

    On the switch, you need to configure the switched Ethernet interface as a trunk or hybrid interface and allow frames of VLAN 2 and VLAN 3 to pass.

    The defects of the Layer 2 switch + router mode are as follows:
    • Multiple devices are needed, and the networking is complex.

    • A router is deployed, which is expensive and provides a low transmission rate.

  • Layer 3 switch

    Layer 3 switching combines both routing and switching techniques to implement routing on a switch, improving the overall performance of the network. After sending the first data flow based on a routing table, a Layer 3 switch generates a mapping table, in which the mapping between the MAC address and the IP address about this data flow is recorded. If the switch needs to send the same data flow again, it directly sends the data flow at Layer 2 but not Layer 3 based on the mapping table. In this manner, delays on the network caused by route selection are eliminated, and data forwarding efficiency is improved.

    To allow the first data flow to be correctly forwarded based on the routing table, the routing table must contain correct routing entries. Therefore, configuring a Layer 3 interface and a routing protocol on the Layer 3 switch is required. VLANIF interfaces are therefore introduced.

    A VLANIF interface is a Layer 3 logical interface, which can be configured on either a Layer 3 switch or a router.

    As shown in Figure 1-753, VLAN 2 and VLAN 3 are configured on the switch. You can then create two VLANIF interfaces on the switch and assign IP addresses to and configure routes for them. In this manner, VLAN 2 can communicate with VLAN 3.

    Figure 1-753 Inter-VLAN communication through a Layer 3 switch

    The Layer 3 switch offsets the defects in the scheme of Layer 2 switch + router, and can implement faster traffic forwarding at a lower cost. Nevertheless, the Layer 3 switch has the following defects:
    • Applicable to a network whose interfaces are almost all Ethernet interfaces.

    • Applicable to a network with only stable routes and few changes in the network topology.

Key points are summarized as follows:
  • A PC does not need to know the VLAN to which it belongs. It sends only untagged frames.
  • After receiving an untagged frame from a PC, a switching device determines the VLAN to which the frame belongs. The determination is based on the configured VLAN classification method such as port information, and then the switching device processes the frame accordingly.
  • If the frame needs to be forwarded to another switching device, the frame must be transparently transmitted along a trunk link. Frames transmitted along trunk links must carry VLAN tags to allow other switching devices to properly forward the frame based on the VLAN information.
  • Before sending the frame to the destination PC, the switching device connected to the destination PC removes the VLAN tag from the frame to ensure that the PC receives an untagged frame.

Generally, only tagged frames are transmitted on trunk links; only untagged frames are transmitted on access links. In this manner, switching devices on the network can properly process VLAN information, and PCs do not need to learn VLAN information.

VLAN Aggregation

Background

A VLAN is widely used on switching networks because of its flexible control of broadcast domains and convenient deployment. On a Layer 3 switch, the interconnection between the broadcast domains is implemented by using one VLAN with a logical Layer 3 interface. Figure 1-754 shows a VLAN assignment example on devices.

Figure 1-754 Common VLAN

Table 1-384 Example of assigning host addresses in common VLANs

VLAN

Subnet

Gateway Address

Number of Available Addresses

Number of Available Hosts

Practical Requirements

2

1.1.1.0/28

1.1.1.1

14

13

10

3

1.1.1.16/29

1.1.1.17

6

5

5

4

1.1.1.24/30

1.1.1.25

2

1

1

On the network shown in Table 1-384, VLAN 2 requires 10 host addresses. A subnet address 1.1.1.0/28 with a mask length of 28 bits is assigned to VLAN 2. 1.1.1.0 is the subnet number, and 1.1.1.15 is the directed broadcast address. These two addresses cannot serve as the host address. In addition, 1.1.1.1, as the default address of the network gateway of the subnet, cannot be used as the host address. The remaining 13 addresses ranging from 1.1.1.2 to 1.1.1.14 can be used by the hosts. In this way, although VLAN 2 needs only ten addresses, 13 addresses are assigned to it according to the subnet division.

VLAN 3 requires five host addresses. A subnet address 1.1.1.16/29 with a mask length of 29 bits is assigned to VLAN 3. VLAN 4 requires only one address. A subnet address 1.1.1.24/30 with a mask length of 30 bits is assigned to VLAN 4.

The preceding VLANs require a total of 16 (10 + 5 + 1) addresses. However, at least 28 (16 + 8 + 4) addresses are occupied by the common VLANs. In this way, nearly half of the addresses are wasted. In addition, if only three hosts, not 10 hosts are bound to VLAN 2 later, the extra addresses cannot be used by other VLANs and thereby are wasted.

Meanwhile, this division is inconvenient for later network upgrades and expansions. For example, if you want to add two more hosts to VLAN 4 and do not want to change the IP addresses assigned to VLAN 4, and the addresses after 1.1.1.24 has been assigned to others, a new subnet with the mask length of 29 bits and a new VLAN must be assigned to the new hosts. VLAN 4 has only three hosts, but the three hosts are assigned to two subnets, and a new VLAN is required. This is inconvenient for network management.

To sum up, many IP addresses are used as the addresses of subnets, directional broadcast addresses of subnets, and default addresses of network gateways of subnets and therefore cannot be used as the host addresses in VLANs. This reduces addressing flexibility and wastes many addresses. To solve this problem, VLAN aggregation is used.

Principles

The VLAN aggregation technology, also known as the super VLAN, provides a mechanism that partitions the broadcast domain by using multiple VLANs in a physical network so that different VLANs can belong to the same subnet. In VLAN aggregation, two concepts are involved, namely, super VLAN and sub VLAN.

  • Super VLAN: In a super VLAN that is different from a common VLAN, only Layer 3 interfaces are created, and physical ports are not contained. The super VLAN can be viewed as a logical Layer 3 concept. It is a collection of many sub VLANs.
  • Sub VLAN: It is used to isolate broadcast domains. In a sub VLAN, only physical ports are contained, and Layer 3 VLAN interfaces cannot be created. A sub VLAN implements Layer 3 switching through the Layer 3 interface of the super VLAN.

A super VLAN can contain one or more sub VLANs that identify different broadcast domains. The sub VLAN does not occupy an independent subnet segment. In the same super VLAN, IP addresses of hosts belong to the subnet segment of the super VLAN, regardless of the mapping between hosts and sub VLANs.

Therefore, the same Layer 3 interface is shared by sub VLANs. Some subnet IDs, default gateway addresses of the subnet, and directed broadcast addresses of the subnet are saved; meanwhile, different broadcast domains can use the addresses in the same subnet segment. As a result, subnet differences are eliminated, addressing becomes flexible and idle addresses are reduced.

For example, on the network shown in Table 1-384, VLAN 2 requires 10 host addresses, VLAN 3 requires 5 host addresses, and VLAN 4 requires 1 host address.

To implement VLAN aggregation, create VLAN 10 and configure VLAN 10 as a super VLAN. Then assign a subnet address 1.1.1.0/24 with the mask length of 24 to VLAN 10; 1.1.1.0 is the subnet number, and 1.1.1.1 is the gateway address of the subnet, as shown in Figure 1-755. Address assignment of sub VLANs (VLAN 2, VLAN 3, and VLAN 4) is shown in Table 1-385.

Figure 1-755 VLAN aggregation

Table 1-385 Example for assigning Host addresses in VLAN aggregation mode

VLAN

Subnet

Gateway Address

Number of Available Addresses

Available Addresses

Practical Requirements

2

1.1.1.0/24

1.1.1.1

10

1.1.1.2-1.1.1.11

10

3

5

1.1.1.12-1.1.1.16

5

4

1

1.1.1.17

1

In VLAN aggregation implementation, sub VLANs are not divided according to the previous subnet border. Instead, their addresses are flexibly assigned in the subnet corresponding to the super VLAN according to the required host number.

As shown in Table 1-385, VLAN 2, VLAN 3, and VLAN 4 share the same subnet (1.1.1.0/24), default subnet gateway address (1.1.1.1), and directed broadcast address (1.1.1.255). In this manner, the subnet IDs (1.1.1.16, 1.1.1.24), the default gateways of the subnet (1.1.1.17, 1.1.1.25), and the directed broadcast addresses of the subnet (1.1.1.15, 1.1.1.23, and 1.1.1.27) can be used as IP addresses of hosts.

Totally, 16 addresses (10 + 5 + 1 = 16) are required for the three VLANs. In practice, in this subnet, a total of 16 addresses are assigned to the three VLANs (1.1.1.2 to 1.1.1.17). A total of 19 IP addresses are used, that is, the 16 host addresses together with the subnet ID (1.1.1.0), the default gateway of the subnet (1.1.1.1), and the directed broadcast address of the subnet (1.1.1.255). In the network segment, 236 addresses (255 – 19 = 236) are available, which can be used by any host in the sub VLAN.

Inter-VLAN Communication
  • Introduction

    VLAN aggregation ensures that different VLANs use the IP addresses in the same subnet segment. This, however, leads to the problem of Layer 3 forwarding between sub VLANs.

    In common VLAN mode, the hosts of different VLANs can communicate with each other based on the Layer 3 forwarding through their respective gateways. In VLAN aggregation mode, the hosts in a super VLAN use the IP addresses on the same network segment and share the same gateway address. The hosts in different sub VLANs belong to the same subnet. Therefore, they communicate with each other based on the Layer 2 forwarding, rather than the Layer 3 forwarding through a gateway. In practice, hosts in different sub VLANs are isolated in Layer 2. As a result, sub VLANs fail to communicate with each other.

    To solve the preceding problem, you can use proxy ARP.

    For details of proxy ARP, see the chapter "ARP" in the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M Feature Description - IP Services.

  • Layer 3 communication between different sub VLANs

    For example, a super VLAN (VLAN 10) contains sub VLANs (VLAN 2 and VLAN 3), as shown in Figure 1-756.

    Figure 1-756 Layer 3 communication between different sub VLANs based on ARP proxy

    In the scenario where Host A has no ARP entry of Host B in its ARP table and the gateway (L3 Switch) has proxy ARP enabled, Host A in VLAN 2 wants to communication with Host B in VLAN 3. The communication process is as follows:

    1. After comparing the IP address of Host B 1.1.1.3 with its IP address, Host A finds that both IP addresses are on the same network segment 1.1.1.0/24 and its ARP table has no ARP entry of Host B.
    2. Host A broadcasts an ARP request to ask for the MAC address of Host B.
    3. Host B is not in the broadcast domain of VLAN 2, and cannot receive the ARP request.
    4. The proxy-ARP enabled gateway between the sub VLANs receives the ARP request from Host A and finds that the IP address of Host B 1.1.1.3 is the IP address of a directly connected interface. Then the gateway broadcasts an ARP request to all the other sub VLAN interfaces to ask for the MAC address of Host B.
    5. After receiving the ARP request, Host B sends an ARP response.
    6. After receiving the ARP response from Host B, the gateway replies with its MAC address to Host A.
    7. Both the gateway and Host A have the ARP entry of Host B.
    8. Host A sends packets to the gateway, and then the gateway sends the packets from Host A to Host B at the Layer 3. In this way, Host A and Host B can communicate with each other.

    The process that Host B sends packets to Host A is similar, and is not mentioned.

  • Layer 2 communication between a sub VLAN and an external network

    As shown in Figure 1-757, in the Layer 2 VLAN communications based on ports, the received or sent frames are not tagged with the super VLAN ID.

    Figure 1-757 Layer 2 communication between a sub VLAN and an external network

    Host A sends a frame to Switch1 through Port 1. Upon receipt, Switch1 adds a VLAN tag with a VLAN ID 2 to the frame. The VLAN ID 2 is not changed to the VLAN 10 on Switch1 even if VLAN 2 is the sub VLAN of VLAN 10. When the frame is sent by a trunk Port 3, it still carries the ID of VLAN 2.

    That is to say, Switch1 itself does not send the frames from VLAN 10. If Switch1 receives frames from VLAN 10, it discards these frames as there is no physical port for VLAN 10.

    A super VLAN has no physical port. This limitation is obligatory, as shown below:
    • If you configure the super VLAN and then the trunk interface, the frames of a super VLAN are filtered automatically according to the allowed VLAN range set on the trunk interface.

      In Figure 1-757, Port3 of Switch1 allows packets from all VLANs to pass through, but packets from VLAN 10 (super VLAN) cannot pass through this port.

    • If you configure the trunk interface and allow all VLAN packets to pass through, you still cannot configure the super VLAN on Switch1, because any VLAN with physical ports cannot be configured as the super VLAN.

    As for Switch1, the valid VLANs are just VLAN 2 and VLAN 3, and all frames from these VLANs are forwarded.

  • Layer 3 communication between a sub VLAN and an external network

    Figure 1-758 Layer 3 communication between a sub VLAN and an external network

    As shown in Figure 1-758, Switch1 is configured with super VLAN 4, sub VLAN 2, sub VLAN 3, and a common VLAN 10. Switch2 is configured with two common VLANs, namely, VLAN 10 and VLAN 20. Suppose that Switch1 is configured with the route to the network segment 1.1.3.0/24, and Switch2 is configured with the route to the network segment 1.1.1.0/24. Then the communication process is as follows when Host A in sub VLAN 2 that belongs to the super VLAN 4 needs to communicate with Host C in Switch2:
    1. After comparing the IP address of Host C 1.1.3.2 with its IP address, Host A finds that two IP addresses are not on the same network segment 1.1.1.0/24.
    2. Host A broadcasts an ARP request to ask for the MAC address of the gateway (Switch1).
    3. After receiving the ARP request, Switch1 finds the ARP request packet is from sub VLAN 2 and replies with an ARP response to Host A through sub VLAN 2. The source MAC address in the ARP response packet is the MAC address of VLANIF 4 for super VLAN 4.
    4. Host A learns the MAC address of the gateway.
    5. Host A sends the packet to the gateway, with the destination MAC address as the MAC address of VLANIF 4 for super VLAN 4, and the destination IP address as 1.1.3.2.
    6. After receiving the packet, Switch1 performs the Layer 3 forwarding and sends the packet to Switch2, with the next hop address as 1.1.2.2, the outgoing interface as VLANIF 10.
    7. After receiving the packet, Switch2 performs the Layer 3 forwarding and sends the packet to Host C through the directly connected interface VLANIF 20.
    8. The response packet from Host C reaches Switch1 after the Layer 3 forwarding on Switch2.
    9. After receiving the packet, Switch1 performs the Layer 3 forwarding and sends the packet to Host A through the super VLAN.

VLAN Mapping

VLAN mapping, also called VLAN translation, converts between user VLAN IDs and ISP VLAN IDs.

VLAN mapping is implemented after packets are received on an inbound interface and before the packets are forwarded by an outbound interface.

  • After VLAN mapping is configured on an interface, the interface replaces the VLAN tag of a local VLAN frame with an external VLAN tag before sending the VLAN frame out.

  • After receiving a VLAN frame, the interface replaces the VLAN tag with a local VLAN tag.

This implements inter-VLAN communication.

In Figure 1-759, VLAN 2-VLAN 3 mapping is configured on Interface1 of DeviceA. Before Interface1 sends a frame in VLAN 2 to VLAN 3, Interface1 replaces VLAN ID 2 in the frame with VLAN ID 3 of VLAN 3. After Interface1 receives a frame from VLAN 3, Interface1 replaces VLAN ID 3 in the frame with VLAN ID 2 of VLAN 2. Therefore, devices in VLAN 2 and VLAN 3 can communicate.

Figure 1-759 VLAN mapping

If devices in two VLANs need to communicate using VLAN mapping, the IP addresses of these devices must be on the same network segment. If the IP addresses of the devices in the two VLANs are on different network segments, the communication between the devices depends on Layer 3 routing. In this case, VLAN mapping is meaningless.

The NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M supports only 1 to 1 VLAN mapping. When a VLAN mapping-enabled interface receives a single-tagged frame, the interface replaces the VLAN ID in the frame with a specified VLAN ID.

If a VLAN range is specified for configuring VLAN mapping, broadcast, unknown unicast, and multicast (BUM) traffic is replicated in all VLANs in that VLAN range. Excessive traffic replication will overburden the board, potentially interrupting services. To ensure that the board is not overburdened by many redundant VLANs, you are advised to plan VLANs appropriately during service deployment.

VLAN Damping

In case that a VLAN Down event occurs when all the interfaces added to the VLAN go Down, the VLAN will report the Down event to the corresponding VLANIF interface, causing a change in the VLANIF interface status.

To avoid this, enable VLAN damping on the VLANIF interface.

After VLAN damping is enabled, among all the interfaces that are added to the VLAN, if the last Up interface in the VLAN becomes Down, the VLAN damping-enabled device will report the VLAN status to the VLANIF interface after the set delay time expires. If some interfaces in the VLAN become Up before the set delay time expires, the VLANIF interface status will stay Up. VLAN damping delays reporting a Down event to a VLANIF interface and suppresses unnecessary route flapping.

If a user runs a command to enable a VLAN to go Down, VLAN damping does not need to be configured.

Flexible Service Access Through Sub-interfaces of Various Types

Background

On an ME network, users and services are differentiated based on a single VLAN tag or double VLAN tags carried in packets and then access different Virtual Private Networks (VPNs) through sub-interfaces. In some special scenarios where the access device does not support QinQ or a single VLAN tag is used in different services, different services cannot be distributed to different Virtual Switching Instances (VSIs) or VPN instances.

As shown in Figure 1-760, the high-speed Internet (HSI), Voice over Internet Protocol (VoIP), and Internet Protocol Television (IPTV) services belong to VLAN 10 and are converged to the UPE through a switch; the UPE is connected to the SR and BRAS through Layer 2 virtual private networks (L2VPNs).

If the UPE does not support QinQ, it cannot differentiate the received HSI, VoIP, and IPTV services for transmitting them over different Pseudo Wires (PWs). In this case, you can configure the UPE to resolve the 802.1p priorities, DiffServ Code Point (DSCP) values, or EthType values of packets. Then, the UPE can transmit different packets over different PWs based on the 802.1p priorities, DSCP values, or EthType values of the packets.

In a similar manner, if the UPE is connected to the SR and BRAS through L3VPNs, the UPE can transmit different services through different VPN instances based on the 802.1p priorities or DSCP values of the packets.

Figure 1-760 Multiple services belonging to the same VLAN

Basic Concepts

As shown in Figure 1-760, sub-interfaces of different types are configured at the attachment circuit (AC) side of the UPE to transmit packets with different 802.1p priorities, DSCP values, or EthType values through different PWs or VPN instances. This implements flexible service access. Flexible service access through sub-interfaces is a technology that differentiates VPN access based on the VLAN IDs and 802.1p priorities/DSCP values/EthType (PPPoE or IPoE) values in packets.

The sub-interfaces are classified in Table 1-386 based on VLAN identification policies configured on them.

Table 1-386 Different types of sub-interfaces

Sub-interface Type

Description

Application

VLAN sub-interface

It is a sub-interface encapsulated with a VLAN ID.

Sub-interfaces on different main interfaces can be encapsulated with the same VLAN ID. VLAN sub-interfaces are bound to VSIs/Virtual Private Wire Services (VPWSs) or VPN instances to access L2VPNs or L3VPNs.

Untagged sub-interface

It is a sub-interface that supports untagged+DSCP. An untagged sub-interface receives untagged packets with DSCP values.

An access device on an ME network differentiates services based on their DSCP values. Untagged packets are transmitted through different VPN instances based on the DSCP values of the packets.

After untagged+DSCP is configured on a sub-interface, note the following:

  1. The sub-interface automatically resolves a received packet to obtain its DSCP value.

  2. If the obtained DSCP value matches the configured matching policy, the packet is transmitted to the VPN instance associated with the sub-interface.

  3. If the obtained DSCP value does not match the configured matching policy but a default sub-interface is configured, the packet is transmitted to the VPN instance associated with the default sub-interface.

If neither of the preceding conditions is met, the packet is discarded.

After untagged+DSCP is configured on a sub-interface, its main interface cannot process Layer 3 packets, and all Layer 3 packets are processed on the untagged sub-interface on the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M.

NOTE:

Untagged+DSCP is applicable only to the IP and L3VPN access scenario.

DSCP sub-interface

It is a sub-interface that supports VLAN+DSCP. Here, the VLAN can be a single VLAN or a VLAN range. If a single VLAN is specified, it is a Dot1q sub-interface; if a VLAN range is specified, it can be a sub-interface for Dot1q VLAN tag termination or a QinQ stacking sub-interface. A DSCP sub-interface receives tagged packets with DSCP values.

An access device on an ME network differentiates services based on their VLAN IDs and DSCP values.

After VLAN+DSCP is configured on a sub-interface, note the following:

  1. The sub-interface automatically resolves a received packet to obtain its VLAN ID and DSCP value.

  2. If the obtained VLAN ID and DSCP value match the configured matching policy, the packet is transmitted to the VPWS/VSI or VPN instance associated with the sub-interface.

  3. If the obtained VLAN ID and DSCP value do not match the configured matching policy but a default sub-interface is configured, the packet is transmitted to the VPWS/VSI or VPN instance associated with the default sub-interface.

If neither of the preceding conditions is met, the packet is discarded.

EthType sub-interface

It is a sub-interface that supports VLAN+EthType. Here, the VLAN can be a single VLAN or a VLAN range. If a single VLAN is specified, it is a Dot1q sub-interface; if a VLAN range is specified, it can be a sub-interface for Dot1q VLAN tag termination or a QinQ stacking sub-interface. An EthType sub-interface receives tagged packets with different EthType values.

An access device on an ME network differentiates services based on their VLAN IDs and EthType values.

After VLAN+EthType is configured on a sub-interface, there are the following situations:

  1. The sub-interface automatically resolves a received packet to obtain its VLAN ID and EthType.

  2. If the obtained VLAN ID and EthType match the configured matching policy, the packet is transmitted to the VPWS/VSI associated with the sub-interface.

  3. If the obtained VLAN ID and EthType do not match the configured matching policy but a default sub-interface is configured, the packet is transmitted to the VPWS/VSI associated with the default sub-interface.

If neither of the preceding conditions is met, the packet is discarded.

Default sub-interface

It is a sub-interface that supports VLAN+default. Here, the VLAN can be a single VLAN or a VLAN range. If a single VLAN is specified, it is a Dot1q sub-interface; if a VLAN range is specified, it can be a sub-interface for Dot1q VLAN tag termination or a QinQ stacking sub-interface. A default sub-interface receives tagged packets with no 802.1p priorities/DSCP values/EthType values.

A VLAN+default-enabled sub-interface identifies packets based on their VLAN IDs without 802.1p priorities/DSCP values/EthType values.

  • 802.1p and EthType

    Figure 1-761 shows the format of a VLAN frame defined in IEEE 802.1Q.

    Figure 1-761 VLAN frame format defined in IEEE 802.1Q

    As shown in Figure 1-761, the 802.1p priority is represented by a 3-bit PRI (priority) field in a VLAN frame defined in IEEE 802.1Q. The value ranges from 0 to 7. The greater the value, the higher the priority. When the switching device is congested, the switching device preferentially sends packets with higher priorities. In flexible service access, this field is used to identify service types so that different services can access different L2VPNs/L3VPNs.

    The EthType is represented by a 2-byte LEN/ETYPE field, as shown in Figure 1-761. In flexible service access, this field is used to identify service types based on EthType values (PPPoE or IPoE) so that different services can access different L2VPNs.

  • DSCP

    As shown in Figure 1-762, the DSCP is represented by the first 6 bits of the Type of Service (ToS) field in an IPv4 packet header, as defined in relevant standards. DSCP, as the signaling for DiffServ, is used for QoS guarantee on IP networks. Traffic control on the gateway depends on the DSCP field.

    Figure 1-762 DSCP frame format

    In flexible service access, this field is used to identify service types so that different services can access different L2VPNs/L3VPNs.

On the network shown in Figure 1-763, when a CSG accesses an IP station, VPWS is not required on the CSG and MASG. After the CSG receives IP packets, it performs the following:

  1. The CSG directly encapsulates the packets with VLAN IDs and 802.1p priorities for differentiating services. The CSG encapsulates the IP packets as follows:

    • Encapsulates different users with different VLAN IDs.

    • Encapsulates different services with different 802.1p priorities.

    • Encapsulates different services of the same user with the same VLAN ID but different 802.1p priorities.

    • Encapsulates different services of different users with different VLAN IDs but the same or different 802.1p priorities.

  2. Then, the CSG sends the encapsulated packets to PE1. After PE1 receives the packets, its 802.1p sub-interface resolves the packets to obtain their VLAN IDs and 802.1p priorities. The packets then access different VSIs through priority mapping. In this manner, different services are transmitted to PE2 through different VSIs.

  3. After PE2 receives the packets, it sends the packets to the MASG based on the VSIs carried in the packets.

  4. The MASG then transmits the packets to the BSC.

Figure 1-763 IP station access to an L2VPN

  • Huawei high-end routers can function as PEs. In this scenario, only the configurations of PEs are mentioned. For detailed configurations of other devices, see the related configuration guides.

  • You can configure the 802.1p priorities on the CSG through commands.

  • For details on L2VPNs, see the chapters "VPWS" and "VPLS" in the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M Feature Description - VPN.

VLAN+EthType-based L2VPN Access

On the network shown in Figure 1-764, packets sent from PC users are encapsulated with PPPoE whereas packets sent from IPTV and voice users are encapsulated with IPoE. To enable packets of different encapsulation types to be transmitted to different remote servers, VLAN+EthType-based L2VPN access can be deployed on the edge device of the metro Ethernet network. In this manner, the edge device differentiates services based on VLAN+EthType, steers them to different VSIs or VPWSs, and transparently transmits PPPoE packets to the BRAS and IPoE packets to the remote SR.

Figure 1-764 VLAN+EthType-based L2VPN access

On the network shown in Figure 1-765, after the CSG receives IP packets, it performs the following:

  1. The CSG directly encapsulates the packets with VLAN IDs and DSCP values for differentiating services. The CSG encapsulates the IP packets as follows:

    • Encapsulates different users with different VLAN IDs.

    • Encapsulates different services with different DSCP values.

    • Encapsulates different services of the same user with the same VLAN ID but different DSCP values.

    • Encapsulates different services of different users with different VLAN IDs but the same or different DSCP values.

  2. Then, the CSG sends the encapsulated packets to PE1. After PE1 receives the packets, its DSCP sub-interface resolves the packets to obtain their VLAN IDs and DSCP values. The packets then access different VSIs through DSCP priority mapping. In this manner, different services are transmitted to PE2 through different VSIs.

  3. After PE2 receives the packets, it sends the packets to the RNC.

Figure 1-765 IP station access to an L2VPN

  • Huawei high-end routers can function as PEs. In this scenario, only the configurations of PEs are mentioned. For detailed configurations of other devices, see the related configuration guides.

  • You can configure the DSCP values on the CSG through commands.

  • For details on L2VPNs, see the chapters "VPWS" and "VPLS" in the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M Feature Description - VPN.

On the network shown in Figure 1-766, after the CSG receives IP packets, it performs the following:

  1. The CSG directly encapsulates the packets with VLAN IDs and DSCP values for differentiating services. The CSG encapsulates the IP packets as follows:

    • Encapsulates different users with different VLAN IDs.

    • Encapsulates different services with different DSCP values.

    • Encapsulates different services of the same user with the same VLAN ID but different DSCP values.

    • Encapsulates different services of different users with different VLAN IDs but the same or different DSCP values.

  2. Then, the CSG sends the encapsulated packets to PE1. After PE1 receives the packets, its DSCP sub-interface resolves the packets to obtain their VLAN IDs and DSCP values. The packets then access different VPN instances through priority mapping. In this manner, different services are transmitted to PE2 through different VPN instances.

  3. After PE2 receives the packets, it sends the packets to the RNC.

Figure 1-766 IP station access to an L3VPN

  • Huawei high-end routers can function as PEs. In this scenario, only the configurations of PEs are mentioned. For detailed configurations of other devices, see the related configuration guides.

  • You can configure the DSCP values on the CSG through commands.

  • For details on L3VPNs, see the chapter "BGP/MPLS IP VPN" in the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M Feature Description - VPN.

On the network shown in Figure 1-767, when a CSG accesses an IP station, VPWS is not required on the CSG and MASG. After the CSG receives IP packets, it performs the following:

  1. The CSG directly encapsulates the packets with VLAN IDs and 802.1p priorities for differentiating services. The CSG encapsulates the IP packets as follows:

    • Encapsulates different users with different VLAN IDs.

    • Encapsulates different services with different 802.1p priorities.

    • Encapsulates different services of the same user with the same VLAN ID but different 802.1p priorities.

    • Encapsulates different services of different users with different VLAN IDs but the same or different 802.1p priorities.

  2. Then, the CSG sends the encapsulated packets to PE1. After PE1 receives the packets, its 802.1p sub-interface resolves the packets to obtain their VLAN IDs and 802.1p priorities. The packets then access different VPN instances through 802.1p priority mapping. In this manner, different services are transmitted to PE2 through different VPN instances.

  3. After PE2 receives the packets, it sends the packets to the RNC.

Figure 1-767 IP station access to an L3VPN

  • Huawei high-end routers can function as PEs. In this scenario, only the configurations of PEs are mentioned. For detailed configurations of other devices, see the related configuration guides.

  • You can configure the 802.1p priorities on the CSG through commands.

  • For details on L3VPNs, see the chapter "BGP/MPLS IP VPN" in the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M Feature Description - VPN.

Application Scenarios for VLANs

Port-based VLAN Classification

On the network shown in Figure 1-768, different companies residing in the same business premise need to isolate service data. According to the port requirement of each company, ports of each company are bound to a VLAN. This ensures that each company can have a "virtual switch" or a "virtual workstation".

Figure 1-768 Port-based VLAN classification

VLAN Trunk Application

On the network shown in Figure 1-769, a company may have departments located in different business premises. In such a situation, a trunk link can be used to interconnect core switches of different business premises, In this manner, data of different companies can be isolated, and the inter-department communication within the company can be implemented.

Figure 1-769 VLAN trunk application

Inter-VLAN Communication Application

Inter-VLAN communication ensures that different companies can communicate with each other.

  • Multiple VLANs belong to the same Layer 3 device.

    On the network shown in Figure 1-770, if VLAN 2, VLAN 3, and VLAN 4 belong to DeviceA, these VLANs do not cross switches. In such a situation, you can configure a VLANIF interface for each VLAN on DeviceA to implement the communication among these VLANs.

    Figure 1-770 Inter-VLAN communication through the same Layer 3 device

    The Layer 3 device shown in Figure 1-770 can be a router or a Layer 3 switch.

  • Multiple VLANs belong to different Layer 3 devices.

    On the network shown in Figure 1-771, VLAN 2, VLAN 3, and VLAN 4 are VLANs across different switches. In such a situation, you can configure a VLANIF interface on DeviceA and DeviceB for each VLAN, and then configure the static route or a routing protocol on DeviceA and DeviceB, so that DeviceA and DeviceB can communicate over a Layer 3 route.

    Figure 1-771 Inter-VLAN communication through different Layer 3 devices

    The Layer 3 device shown in Figure 1-771 can be a router or a Layer 3 switch.

VLAN Aggregation Application

In Figure 1-772, four VLANs are configured. If these VLANs need to communicate with each other, configure an IP address for each VLAN on the router.

As an alternative, you can enable VLAN aggregation to aggregate VLAN 1 and VLAN 2 into super VLAN 1, and VLAN 3 and VLAN 4 into super VLAN 2. In this manner, you only need to assign IP addresses to the super VLANs on the router, thus saving IP address resources.

After proxy ARP is configured on the router, the sub VLANs in each super VLAN can communicate with each other.

Figure 1-772 VLAN aggregation application

Terminology for VLANs

Terms

None

Acronyms and Abbreviations

Acronym and Abbreviation

Full Name

VLAN

virtual local area network

PVID

port default VLAN ID

VLAN Configuration

Virtual local area networks (VLANs) have advantages of broadcast domain isolation, security improvement, flexible networking, and good extensibility.

VLAN Overview

The VLAN technology is important for Layer 2 network forwarding. This section describes the background, functions, and advantages of the VLAN technology.

Introduction

The traditional LAN technology based on the bus structure has the following defects:
  • Conflicts are inevitable if multiple nodes send messages simultaneously.

  • Messages are broadcast to all nodes.

  • Networks have security risks as all the hosts in a LAN share the same transmission channel.

The network constructs a collision domain. More computers on the network cause more conflicts and lower network efficiency. The network is also a broadcast domain. When many computers on the network send data, broadcast traffic consumes much bandwidth.

Traditional networks face collision domain and broadcast domain issues, and cannot ensure information security.

To reduce the broadcast traffic, you need to enable the broadcast only among hosts that need to communicate with each other, and isolate the hosts that do not need the broadcast. A router can select routes based on IP addresses and effectively suppress broadcast traffic between two connected network segments. The router solution, however, is costly. Therefore, multiple logical LANs, namely, VLANs are developed on the physical LAN.

In this manner, a physical LAN is divided into multiple broadcast domains, that is, multiple VLANs. The intra-VLAN communication is not restricted, while the inter-VLAN communication is restricted. As a result, network security is enhanced.

Definition

The virtual local area network (VLAN) technology logically divides a physical LAN into multiple VLANs that are broadcast domains. Each VLAN contains a group of PCs that have the same requirements. A VLAN has the same attributes as a LAN. PCs of a VLAN can be placed on different LAN segments. Hosts can communicate within the same VLAN, while cannot communicate in different VLANs. If two PCs are located on one LAN segment but belong to different VLANs, they do not broadcast packets to each other. In this manner, network security is enhanced.

Figure 1-746 is a networking diagram of a typical VLAN application. Device A, Device B, and Device C are placed at different locations, such as different floors in an office building. Each switch connects to three computers which belong to three different VLANs. In Figure 1-746, each dashed line frame identifies a VLAN. Packets of enterprise customers in the same VLAN are broadcast within the VLAN but not among VLANs. In this way, enterprise customers in the same VLAN can share resources as well as protect their information security.

Figure 1-773 Typical VLAN application

This application shows the following VLAN advantages:
  • Broadcast domains are confined. A broadcast domain is confined to a VLAN. This saves bandwidth and improves network processing capabilities.
  • Network security is enhanced. Packets from different VLANs are separately transmitted. PCs in one VLAN cannot directly communicate with PCs in another VLAN.
  • Network robustness is improved. A fault in a VLAN does not affect PCs in other VLANs.
  • Virtual groups are set up flexibly. With the VLAN technology, PCs in different geographical areas can be grouped together. This facilitates network construction and maintenance.

Basic VLAN Concepts and Principles

  • 802.1q and VLAN frame format

    A conventional Ethernet frame is encapsulated with the Length/Type field for an upper-layer protocol following the Destination address and Source address fields, as shown in Figure 1-774.

    Figure 1-774 Conventional Ethernet frame format

    IEEE 802.1Q modifies the Ethernet frame format by adding a 4-byte 802.1Q tag between the source MAC address field and the Length/Type field, as shown in Figure 1-747.

    Figure 1-775 VLAN frame format defined in IEEE 802.1Q

    An 802.1Q tag contains four fields:

    • EType

      The 2-byte EType field indicates a frame type. If the value of the field is 0x8100, it indicates an 802.1Q frame. If a device that does not support 802.1Q frames receives an 802.1Q frame, it discards the frame.

    • PRI

      The 3-bit Priority field indicates the frame priority. A greater PRI value indicates a higher frame priority. Frames with a higher priority are preferentially sent in the case of congestion.

    • CFI

      The 1-bit Canonical Format Indicator (CFI) field indicates whether a MAC address is in the canonical format. If the CFI field value is 0, the MAC address is in canonical format. If the CFI field value is 1, the MAC address is not in canonical format. This field is mainly used to differentiate among Ethernet frames, Fiber Distributed Digital Interface (FDDI) frames, and token ring frames. The CFI field value in an Ethernet frame is 0.

    • VID

      The 12-bit VLAN ID (VID) field indicates to which VLAN a frame belongs. A VID is an integer ranging from 0 to 4095. The values 0 and 4095 are reserved, and therefore available VIDs are in the range from 1 to 4094.

      Each frame sent by an 802.1Q-capable switch carries a VID. On a VLAN, Ethernet frames are classified into the following types:
      • Tagged frames: frames with 4-byte 802.1Q tags.
      • Untagged frames: frames without 4-byte 802.1Q tags.
  • Port-based VLAN classification

    VLANs are classified based on port numbers. In this mode, VLANs are classified based on the numbers of ports on a switching device. The network administrator configures a unique PVID for each port on the switch. When a data frame reaches a port which is configured with a PVID, the frame is marked with the PVID if the data frame carries no VLAN tag. If the data frame carries a VLAN tag, the switch will not add a VLAN tag to the data frame even if the port is configured with a PVID. Different types of ports process VLAN frames in different manners.

  • Type of VLAN links

    Figure 1-776 VLAN links

    As shown in Figure 1-776, there are the following types of VLAN links:

    • Access link: a link connecting a user host and a switch. Generally, a host does not know which VLAN it belongs to, and host hardware cannot identify frames with VLAN tags. Therefore, hosts send and receive only untagged frames.

    • Trunk link: a link connecting switches. Data of different VLANs is transmitted along a trunk link. The two ends of a trunk link must be able to identify the VLANs to which the data frames belong. Therefore, only tagged frames are transmitted along trunk links.

  • Port types

    Table 1-387 lists VLAN port types.

    Table 1-387 Port types

    Port Type

    Method for Processing a Received Untagged Frame

    Method for Processing a Received Tagged Frame

    Method for Sending a Frame

    Application

    Access port

    Accepts the frame and adds a tag with the default VLAN ID to the frame.

    • Accepts the frame if the VLAN ID carried in the frame is the same as the default VLAN ID.
    • Discards the frame if the VLAN ID carried in the frame is different from the default VLAN ID.

    Removes the tag from the frame and sends the frame.

    An access port connects a switch to a PC and can be added to only one VLAN.

    Trunk port

    Discards the frame.

    • Accepts the frame if the port permits the VLAN ID carried in the frame.
    • Discards the frame if the port denies the VLAN ID carried in the frame.
    • Directly sends the frame if the port permits the VLAN ID carried in the frame.
    • Discards the frame if the port denies the VLAN ID carried in the frame.

    A trunk port can be added to multiple VLANs to send and receive frames for these VLANs. A trunk port connects a switch to another switch or to a router.

    Hybrid port

    • If only the port default vlan command is run on a hybrid port, the hybrid port receives the frame and adds the default VLAN tag to the frame.
    • If only the port trunk allow-pass command is run on a hybrid port, the hybrid port discards the frame.
    • If both the port default vlan and port trunk allow-pass commands are run on a hybrid port, the hybrid port receives the frame and adds the VLAN tag with the default VLAN ID specified in the port default vlan command to the frame.
    • If only the port default vlan command is run on a hybrid port:
      • The hybrid port accepts the frame if the frame's VLAN ID is the same as the default VLAN ID of the port.
      • The hybrid port discards the frame if the frame's VLAN ID is different from the default VLAN ID of the port.
    • If only the port trunk allow-pass command is run on a hybrid port:
      • The hybrid port accepts the frame if the frame's VLAN ID is in the permitted range of VLAN IDs.
      • The hybrid port discards the frame if the frame's VLAN ID is not in the permitted range of VLAN IDs.
    • If both the port default vlan and port trunk allow-pass commands are run on a hybrid port:
      • The hybrid port accepts the frame if the frame's VLAN ID is in the permitted range of VLAN IDs specified in the port trunk allow-pass command or is the same as the default VLAN ID specified in the port default vlan command.
      • The hybrid port discards the frame if the frame's VLAN ID is not in the permitted range of VLAN IDs specified in the port trunk allow-pass command or is different from the default VLAN ID specified in the port default vlan command.
    • If only the port default vlan command is run on the hybrid port and the frame's VLAN ID is the same as the default VLAN ID, the hybrid port removes the VLAN tag and forwards the frame. Otherwise, the hybrid port discards the frame.

    • If only the port trunk allow-pass command is run on a hybrid port:
      • The hybrid port forwards the frame if the frame's VLAN ID is in the permitted range of VLAN IDs.
      • The hybrid port discards the frame if the frame's VLAN ID is not in the permitted range of VLAN IDs.
    • If both the port default vlan and port trunk allow-pass commands are run on a hybrid port:
      • The hybrid port removes the VLAN tag and forwards the frame if the frame's VLAN ID is the same as the default VLAN ID of the port.
      • The hybrid port forwards the frame if the frame's VLAN ID is different from the default VLAN ID of the port but in the permitted range of VLAN IDs specified in the port trunk allow-pass command. Otherwise, the hybrid port discards the frame.
      NOTE:

      The hybrid port removes the VLAN tag and forwards the frame if the frame's VLAN ID is the same as the default VLAN ID configured using the port default vlan command and the default VLAN ID is in the permitted range of VLAN IDs specified in the port trunk allow-pass command.

    A hybrid port can be added to multiple VLANs to send and receive frames of these VLANs. A hybrid port can be used to connect network devices or connect user devices.

    QinQ port

    QinQ ports are enabled with the IEEE 802.1QinQ protocol. A QinQ port adds a tag to a single-tagged frame, and thus supports a maximum of 4094 x 4094 VLANs, which meets the requirement of a Metropolitan Area Network (MAN) for the number of VLANs.

  • Principle for data switching in a VLAN

    Use the network shown in Figure 1-776 as an example. If PC1 in VLAN 2 intends to send data to PC2, the data is forwarded as follows:

    1. An access port on CE1 receives an untagged frame from PC1 and adds a PVID (VLAN 2) to the frame. CE1 searches the MAC address table for an outbound port. Then the frame is transmitted from the outbound port.

    2. After the trunk port on PE receives the frame, the port checks whether the VLAN ID carried in the frame is the same as that configured on the port. If the VLAN ID has been configured on the port, the port transparently transmits the frame to CE2. If the VLAN ID is not configured on the port, the port discards the frame.

    3. After a trunk port on CE2 receives the frame, the system searches the MAC address table for an outbound port, which is the access port connecting CE2 to PC2.

    4. After the frame is sent to the access port connecting CE2 to PC2, the port checks that the VLAN ID carried in the frame is the same as that configured on the port. The port then removes the tag from the frame and sends the untagged frame to PC2.

  • VLANIF interface

    A VLANIF interface is a Layer 3 logical interface, which can be configured on either a Layer 3 switch or a router.

    Layer 3 switching combines both routing and switching techniques to implement routing on a switch, improving the overall performance of the network. After sending the first data flow based on a routing table, a Layer 3 switch generates a mapping table, in which the mapping between the MAC address and the IP address about this data flow is recorded. If the switch needs to send the same data flow again, it directly sends the data flow at Layer 2 but not Layer 3 based on the mapping table. In this manner, delays on the network caused by route selection are eliminated, and data forwarding efficiency is improved.

    To allow the first data flow to be correctly forwarded based on the routing table, the routing table must contain correct routing entries. Therefore, configuring a Layer 3 interface and a routing protocol on the Layer 3 switch is required. VLANIF interfaces are therefore introduced.

Key points are summarized as follows:
  • A PC does not need to know the VLAN to which it belongs. It sends only untagged frames.
  • After receiving an untagged frame from a PC, a switching device determines the VLAN to which the frame belongs. The determination is based on the configured VLAN classification method such as port information, and then the switching device processes the frame accordingly.
  • If the frame needs to be forwarded to another switching device, the frame must be transparently transmitted along a trunk link. Frames transmitted along trunk links must carry VLAN tags to allow other switching devices to properly forward the frame based on the VLAN information.
  • Before sending the frame to the destination PC, the switching device connected to the destination PC removes the VLAN tag from the frame to ensure that the PC receives an untagged frame.

Generally, only tagged frames are transmitted on trunk links; only untagged frames are transmitted on access links. In this manner, switching devices on the network can properly process VLAN information, and PCs do not need to learn VLAN information.

Configuration Precautions for VLAN

Feature Requirements

Table 1-388 Feature requirements

Feature Requirements

Series

Models

In actual applications, the trunk interface transparently transmits packets of all VLANs. Therefore, do not use the port trunk allow-pass vlan all command.

NetEngine 8000 M

NetEngine 8000 M14/NetEngine 8000 M14K/NetEngine 8000 M4/NetEngine 8000 M8/NetEngine 8000 M8K/NetEngine 8000E M14/NetEngine 8000E M8/NetEngine 8100 M14/NetEngine 8100 M8

When the mapping VLAN or stacking VLAN goes Down, protocol packets sent to the outbound interface can be transparently transmitted. As a result, traffic from the remote device may be incorrectly sent to the local device and then discarded.

NetEngine 8000 M

NetEngine 8000 M14/NetEngine 8000 M14K/NetEngine 8000 M4/NetEngine 8000 M8/NetEngine 8000 M8K/NetEngine 8000E M14/NetEngine 8000E M8/NetEngine 8100 M14/NetEngine 8100 M8

In a VLANIF IP FRR scenario, if the primary outbound interface is a VLANIF interface and fails, FRR cannot rapidly switch traffic to the backup outbound interface. Traffic can be restored only when routes are hard converged to the backup outbound interface. Packet loss occurs during the switchover.

NetEngine 8000 M

NetEngine 8000 M14/NetEngine 8000 M14K/NetEngine 8000 M4/NetEngine 8000 M8/NetEngine 8000 M8K/NetEngine 8000E M14/NetEngine 8000E M8/NetEngine 8100 M14/NetEngine 8100 M8

VLANs cannot support the Layer 3 function of VLANIF interfaces after the port vlan-mapping and port vlan-stacking commands are configured.

Do not configure VLANIF Layer 3 services after the port vlan-mapping and port vlan-stacking commands are configured.

NetEngine 8000 M

NetEngine 8000 M14/NetEngine 8000 M14K/NetEngine 8000 M4/NetEngine 8000 M8/NetEngine 8000 M8K/NetEngine 8000E M14/NetEngine 8000E M8/NetEngine 8100 M14/NetEngine 8100 M8

Summary of VLAN Configuration Tasks

This section describes VLAN features supported by the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M in light of better understanding the process of configuring VLANs.

The VLAN technology helps set up virtual groups to separate broadcast domains and implements both intra-VLAN and inter-VLAN communication.

  1. After VLANs are configured, users in a VLAN can communicate with each other.
  2. In addition to intra-VLAN communication, users in different VLANs need to communicate with each other sometimes.

    Intra-VLAN communication and inter-VLAN communication are basic VLAN functions.
  3. Security configurations are required to ensure reliable VLAN data transmission.

Configuring a VLAN Based on Ports

Configuring a VLAN based on ports allows PCs in the VLAN to communicate with each other.

Applicable Environment

A company has multiple departments located in different buildings. For service security, it is required that employees in one department be able to communicate with each other, whereas employees in different departments be prohibited from communicating with each other. Devices on the network shown in Figure 1-777 are configured as follows:
  • Add ports connecting devices to PCs of the financial department to VLAN 5 and ports connecting devices to PCs of the marketing department to VLAN 9. This configuration prevents employees in financial and marketing departments from communicating with each other.
  • Configure links between CE and PE as trunk links to allow frames from VLAN 5 and VLAN 9 to pass through, allowing employees of the same department but different buildings to communicate with each other.

By configuring port-based VLANs on the PE, CE1, and CE2, employees in the same department can communicate with each other, whereas employees in different departments cannot.

Figure 1-777 Networking diagram for configuring a VLAN based on ports

Pre-configuration Tasks

Before configuring a VLAN based on ports, complete the following task:

  • Connecting ports and configuring physical parameters of the ports, ensuring that the ports are physically Up

Creating a VLAN

Creating a VLAN isolates PCs that do not need to communicate with each other. This improves network security, reduces broadcast traffic, and prevents broadcast storms.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run vlan vlan-id

    A VLAN is created, and the VLAN view is displayed. If the specified VLAN has been created, the VLAN view is directly displayed.

    The VLAN ID ranges from 1 to 4094. If VLANs need to be created in batches, you can run the vlan batch command to create VLANs in batches, and then run the vlan vlan-id command to enter the view of a specified VLAN.

    If a device is configured with multiple VLANs, do as follows to configure a name for each VLAN:

    Run the name vlan-name command in the VLAN view. After a VLAN name is configured, you can run the vlan vlan-name vlan-name command in the system view to enter the corresponding VLAN view.

  3. Run commit

    The configuration is committed.

Configuring the Type of a Layer 2 Ethernet Port

On a Layer 2 switching device, some ports identify frames with VLAN tags, whereas the others do not. Configure ports types for Layer 2 Ethernet ports as needed.

Context

Table 1-389 lists Layer 2 Ethernet port types.

Table 1-389 Port types

Port Type

Method for Processing a Received Untagged Frame

Method for Processing a Received Tagged Frame

Method for Sending a Frame

Application

Access port

Accepts the frame and adds a tag with the default VLAN ID to the frame.

  • Accepts the frame if the VLAN ID carried in the frame is the same as the default VLAN ID.
  • Discards the frame if the VLAN ID carried in the frame is different from the default VLAN ID.

Removes the tag from the frame and sends the frame.

An access port connects a switch to a PC and can be added to only one VLAN.

Trunk port

Discards the frame.

  • Accepts the frame if the port permits the VLAN ID carried in the frame.
  • Discards the frame if the port denies the VLAN ID carried in the frame.
  • Directly sends the frame if the port permits the VLAN ID carried in the frame.
  • Discards the frame if the port denies the VLAN ID carried in the frame.

A trunk port can be added to multiple VLANs to send and receive frames for these VLANs. A trunk port connects a switch to another switch or to a router.

Hybrid port

  • If only the port default vlan command is run on a hybrid port, the hybrid port receives the frame and adds the default VLAN tag to the frame.
  • If only the port trunk allow-pass command is run on a hybrid port, the hybrid port discards the frame.
  • If both the port default vlan and port trunk allow-pass commands are run on a hybrid port, the hybrid port receives the frame and adds the VLAN tag with the default VLAN ID specified in the port default vlan command to the frame.
  • If only the port default vlan command is run on a hybrid port:
    • The hybrid port accepts the frame if the frame's VLAN ID is the same as the default VLAN ID of the port.
    • The hybrid port discards the frame if the frame's VLAN ID is different from the default VLAN ID of the port.
  • If only the port trunk allow-pass command is run on a hybrid port:
    • The hybrid port accepts the frame if the frame's VLAN ID is in the permitted range of VLAN IDs.
    • The hybrid port discards the frame if the frame's VLAN ID is not in the permitted range of VLAN IDs.
  • If both the port default vlan and port trunk allow-pass commands are run on a hybrid port:
    • The hybrid port accepts the frame if the frame's VLAN ID is in the permitted range of VLAN IDs specified in the port trunk allow-pass command or is the same as the default VLAN ID specified in the port default vlan command.
    • The hybrid port discards the frame if the frame's VLAN ID is not in the permitted range of VLAN IDs specified in the port trunk allow-pass command or is different from the default VLAN ID specified in the port default vlan command.
  • If only the port default vlan command is run on the hybrid port and the frame's VLAN ID is the same as the default VLAN ID, the hybrid port removes the VLAN tag and forwards the frame. Otherwise, the hybrid port discards the frame.

  • If only the port trunk allow-pass command is run on a hybrid port:
    • The hybrid port forwards the frame if the frame's VLAN ID is in the permitted range of VLAN IDs.
    • The hybrid port discards the frame if the frame's VLAN ID is not in the permitted range of VLAN IDs.
  • If both the port default vlan and port trunk allow-pass commands are run on a hybrid port:
    • The hybrid port removes the VLAN tag and forwards the frame if the frame's VLAN ID is the same as the default VLAN ID of the port.
    • The hybrid port forwards the frame if the frame's VLAN ID is different from the default VLAN ID of the port but in the permitted range of VLAN IDs specified in the port trunk allow-pass command. Otherwise, the hybrid port discards the frame.
    NOTE:

    The hybrid port removes the VLAN tag and forwards the frame if the frame's VLAN ID is the same as the default VLAN ID configured using the port default vlan command and the default VLAN ID is in the permitted range of VLAN IDs specified in the port trunk allow-pass command.

A hybrid port can be added to multiple VLANs to send and receive frames of these VLANs. A hybrid port can be used to connect network devices or connect user devices.

QinQ port

QinQ ports are enabled with the IEEE 802.1QinQ protocol. A QinQ port adds a tag to a single-tagged frame, and thus supports a maximum of 4094 x 4094 VLANs, which meets the requirement of a Metropolitan Area Network (MAN) for the number of VLANs.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The view of a Layer 3 Ethernet interface to be added to a VLAN is displayed.

  3. Run portswitch

    The Layer 3 interface is switched to the Layer 2 mode.

    • If an interface is borrowing the IP address of an Ethernet, a GE, or an Eth-Trunk, the portswitch command cannot be run on the Ethernet, GE, or Eth-Trunk.
    • If the Ethernet, GE, or Eth-Trunk has any Layer 3 configuration, the portswitch command cannot be run on the interface. Before running the portswitch command on the interface, clear all Layer 3 configurations on the interface.

    If many Layer 3 Ethernet interfaces need to be added to the VLAN, run the portswitch batch interface-type { interface-number1 [ to interface-number2 ] } &<1-10> command in the system view to switch the working mode of these Ethernet interfaces in batches.

  4. Run port link-type { access | dot1q-tunnel | hybrid | trunk }The port type is configured.

    If you have specified a Dot1q-tunnel interface, run the port dot1q-tunnel discard untag-frame command to enable this Dot1q-tunnel interface to discard incoming untagged packets to ensure network security.

  5. Run commit

    The configuration is committed.

Adding a Port to a VLAN

Adding a port to a VLAN associates the port with the VLAN.

Context

  • A port connecting a switch to a PC must be configured as an access or a hybrid port.

    The port trunk allow-pass vlan command is invalid on access ports.

  • A port connecting one switch to another must be configured as a trunk or hybrid port.

    The port default vlan command cannot be used on trunk ports.

Procedure

  • For access ports or QinQ ports:

    1. Run the port default vlan vlan-id command to add a port to a specified VLAN.

      To add ports to a VLAN in batches, run the port porttype { portbegin [ to iportend ] } &<1-10> command in the VLAN view.

      The input port format must be correct. The port number following to must be greater than the port number before to. If a group of ports are specified, ensure that these ports are of the same type and all specified ports exist.

      In one port command, a maximum of 10 groups of ports can be specified by using to.

    2. Run commit

      The configuration is committed.

  • For trunk ports:

    1. Run the port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all } command to add ports to specified VLANs.

    2. Run the commit command to commit the configuration.

Verifying the Configuration of a Layer 2 Interface-based VLAN

After configuring a Layer 2 interface-based VLAN, verify the configuration.

Prerequisites

All functions of a Layer 2 interface-based VLAN have been configured.

Procedure

  • Run the display vlan command to check VLAN information.
  • Run the display port vlan command to check information about all interfaces belonging to the configured VLANs.
  • Run the display port vlan interface-type interface-number active command to check information about interfaces with specified types and numbers within the configured VLANs.

Configuring Layer 3 Communication Between VLANIF Interfaces

VLANIF interfaces are Layer 3 logical interfaces. After creating VLANIF interfaces on Layer 2 devices, you can configure Layer 3 features on these interfaces.

Usage Scenario

A Layer 2 device cannot communicate with a Layer 3 device because no IP address can be configured on the Layer 2 device. To allow a Layer 2 device to communicate with a Layer 3 device, create a VLANIF interface on the Layer 2 device and assign an IP address to the VLANIF interface. The Layer 2 device then can communicate with the Layer 3 device.

Layer 3 switching combines both routing and switching techniques to implement routing on a switch, improving the overall performance of the network. After sending the first data flow based on a routing table, a Layer 3 switch generates a mapping table, in which the mapping between the MAC address and the IP address about this data flow is recorded. If the switch needs to send the same data flow again, it directly sends the data flow at Layer 2 but not Layer 3 based on the mapping table. In this manner, delays on the network caused by route selection are eliminated, and data forwarding efficiency is improved.

To allow the first data flow to be correctly forwarded based on the routing table, the routing table must contain correct routing entries. Therefore, configuring a Layer 3 interface and a routing protocol on the Layer 3 switch is required. VLANIF interfaces are therefore introduced.

Pre-configuration Tasks

Before creating a VLANIF interface, complete the following task:

  • Creating a VLAN

Creating a VLANIF Interface

Before configuring Layer 3 features on a Layer 2 device, you must create a VLANIF interface on the device.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface vlanif vlan-id

    A VLANIF interface is created and the VLANIF interface view is displayed.

    The VLAN ID specified in this command must be the ID of an existing VLAN.

    A VLANIF interface is Up only when at least one physical port added to the corresponding VLAN is Up.

  3. Run commit

    The configuration is committed.

Assigning an IP Address to a VLANIF Interface

As a VLANIF interface is a Layer 3 logical interface, it can communicate with other interfaces at the network layer only after being assigned an IP address.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface vlanif vlan-id

    The VLANIF interface view is displayed.

    The VLAN ID specified in this command must be the ID of an existing VLAN.

  3. Run ip address ip-address { mask | mask-length } [ sub ]

    An IP address is assigned to the VLANIF interface for communication at the network layer.

    If IP addresses assigned to VLANIF interfaces on a Layer 3 device belong to different network segments, a routing protocol must be configured on the Layer 3 switch to provide reachable routes. Otherwise, VLANIF interfaces cannot communicate with each other at the network layer. For configurations of routing protocols, see the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M Configuration Guide - IP Routing.

  4. Run commit

    The configuration is committed.

Follow-up Procedure

To disable all users in a VLAN from communicating with users in other VLANs through a VLANIF interface, whereas communication is available between users within the VLAN, run the shutdown command in the VLANIF interface view.

Both Layer 2 and Layer 3 traffic is transmitted over the VLANIF interface. Running the shutdown command in the VLANIF interface view prohibits only Layer 3 traffic. After running the display interface vlanif command, you can view that traffic statistics still increase on this VLANIF interface.

To prohibit all traffic on the VLANIF interface, run the shutdown vlan command in the VLANIF interface view.

(Optional) Setting a Delay After Which a VLANIF Interface Goes Down

Setting a delay after which a VLANIF interface goes Down prevents network flapping caused by changes of VLANIF interface status. This function is also called VLAN damping.

Context

If a VLAN goes Down because all ports in the VLAN go Down, the system immediately reports the VLAN Down event to the corresponding VLANIF interface, instructing the VLANIF interface to go Down.

To prevent network flapping caused by changes of VLANIF interface status, enable VLAN damping on the VLANIF interface. After the last Up port in a VLAN goes Down, the system starts a delay timer and informs the corresponding VLANIF interface of the VLAN Down event after the timer expires. If a port in the VLAN goes Up during the delay period, the VLANIF interface remains Up.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface vlanif vlan-id

    The VLANIF interface view is displayed.

    The VLAN ID specified in this command must be the ID of an existing VLAN.

  3. Run damping time delay-time

    The delay for VLAN damping is set.

    The delay-time value ranges from 0 to 20, in seconds.

  4. Run commit

    The configuration is committed.

(Optional) Configuring Bandwidth for a VLANIF Interface

After configuring bandwidth for VLANIF interfaces, you can use the NMS to query the bandwidth. This facilitates traffic monitoring.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface vlanif vlan-id

    The VLANIF interface view is displayed.

    The VLAN ID specified in this command must be the ID of an existing VLAN.

  3. Run bandwidth bandwidth

    The VLANIF interface is configured with bandwidth.

  4. Run commit

    The configuration is committed.

Verifying the VLANIF Interface Configuration

After the configuration is complete, verify the VLANIF interface configuration, such as whether an IP address is correctly assigned to the VLANIF interface and status of the VLANIF interface.

Prerequisites

The configurations of a VLANIF interface are complete.

Procedure

  • Run the display interface vlanif [ vlan-id ] command to check the physical status, link protocol status, description, and IP address of the VLANIF interface.

Configuring Inter-VLAN Communication

Configuring inter-VLAN communication allows users in different VLANs to communicate with each other.

Usage Scenario

Currently, schemes listed in Table 1-390 are provided for inter-VLAN communication. You can choose one of them based on the real world situation.

Table 1-390 Schemes for inter-VLAN communication

Inter-VLAN Communication Scheme

Advantage

Disadvantage

Usage Scenario

Sub-interface

After sub-interfaces are configured, users in different VLANs and network segments can communicate with each other as long as routes are reachable.

  • Both Layer 2 and Layer 3 devices are required, which increases expenditure.
  • If multiple users on a network belong to different VLANs, each VLAN requires a sub-interface on a Layer 3 device. Each sub-interface needs to be assigned an IP address. This increases configuration workload and uses up a large number of IP addresses.

This scheme is applicable to small-scale networks on which users belong to different network segments.

VLANIF interface

After sub-interfaces are configured, users in different VLANs and network segments can communicate with each other as long as routes are reachable.

Inter-VLAN communication can also be implemented by Layer 3 switches if routes are reachable. This scheme boasts of low operating costs.

If multiple users on a network belong to different VLANs, each VLAN requires a VLANIF interface. Each VLANIF interface needs to be assigned an IP address. This increases configuration workload and uses a lot of IP addresses.

This scheme is applicable to small-scale networks on which users belong to different network segments and IP addresses of these users are seldom changed.

VLAN mapping

This scheme is easily configured and does not rely on routes.

IP addresses of users in different VLANs must belong to the same network segment.

This scheme is applicable to large-scale networks on which multiple users belong to one network segment.

Pre-configuration Tasks

Before configuring communication between VLANs, complete the following task:
  • Creating VLANs

Configuring Sub-interfaces for Inter-VLAN Communication

If users belong to different VLANs and reside on different network segments, sub-interfaces can be created on an Layer 3 device and assigned IP addresses to allow these users to communicate with each other at the network layer.

Context

During communication at the data link layer on a LAN, source MAC addresses identify where data comes from, and destination MAC addresses guide data to destinations. If the source and destination PCs reside on different network segments, a Layer 2 network is unable to send data from the source to the destination. In this case, data has to be forwarded at the network layer 3. After the default gateway address of the Layer 2 device is specified as the IP address of the Layer 3 device, the Layer 2 device sends data that needs to be forwarded at the network layer to the Layer 3 device. After receiving a packet, the Layer 3 device searches its routing table according to the destination address in the packet. If the Layer 3 device finds a matching route in the routing table, the Layer 3 device directly forwards the packet to another network segment. If the Layer 3 device does not find any matching route, it discards the packet.

On the network shown in Figure 1-778, VLANs 2 to n belong to different network segments. To allow users in VLANs 2 to n to communicate with each other, you can create a sub-interface on the PE for each VLAN and assign an IP address to each sub-interface. After VLANs are configured, the CE is logically divided into n parts. Accordingly, the Layer 3 device must have n logical interfaces corresponding to n VLANs. The detailed implementation process is as follows:

  1. A PC in VLAN 2 checks the destination IP address and finds that the destination PC in VLAN n is on a different network segment.
  2. The PC in VLAN 2 sends an ARP request. After receiving the request, the PE considers itself the destination, translates its MAC address into an IP address, and sends an ARP reply to the PC in VLAN 2.
  3. After receiving data from the PC in VLAN 2, the CE adds a VLAN tag to the data and searches the MAC address table for an outbound port.
  4. The PE receives the frame and sends it to sub-interface 2.
  5. Sub-interface 2 removes the VLAN tag from the frame, searches for an ARP entry based on the IP address in the IP header, and forwards the packet at the network layer.
  6. Sub-interface n receives the packet, re-encapsulates the packet with the VLAN ID of n and the destination MAC address of the MAC address of the destination PC, and sends the frame.
  7. After receiving the frame, the CE searches the MAC address table for the destination MAC address based on the VLAN ID carried in the packet to determine the outbound port.
  8. The PC in VLAN n receives the frame from VLAN 2.

    If a PC in VLAN n sends a packet to a PC in VLAN 2, the process is similar and not described in this document.

Figure 1-778 Networking diagram for configuring sub-interfaces for inter-VLAN communication

On the network shown in Figure 1-778, downstream ports on the CE are separately added to VLAN 2 to VLAN n. The configuration roadmap for communication between these VLANs is as follows:

  1. Create n-1 sub-interfaces on the Ethernet interface connecting the PE to the CE.

  2. The sub-interface is associated with a VLAN.

  3. Assign an IP address to each sub-interface for communication at the network layer.

  4. Configure the port connecting the CE to the PE as a trunk or hybrid port to allow frames with VLAN IDs from 2 to n to pass through.

The default gateway address of each PC in a VLAN must be the IP address of the corresponding sub-interface. Otherwise, inter-VLAN communication fails.

Procedure

  • Do as follows on the PE:
    1. Run system-view

      The system view is displayed.

    2. Run interface { ethernet | gigabitethernet } interface-number.subinterface-number

      An Ethernet sub-interface is created and the view of the Ethernet sub-interface is displayed.

      The Ethernet interface in this step is the interface connecting the PE to the CE.

    3. Run vlan-type dot1q vlan-id

      The sub-interface is associated with a VLAN.

      Sub-interfaces of different interfaces can be associated with the same VLAN; sub-interfaces of one interface cannot be associated with the same VLAN.

    4. Run ip address ip-address { mask | mask-length } [ sub ]

      An IP address is assigned to the sub-interface for communication at the network layer.

    5. Run commit

      The configuration is committed.

Configuring VLANIF Interfaces for Inter-VLAN Communication

Configuring VLANIF interfaces for inter-VLAN communication saves expenditure and helps implement fast forwarding.

Context

VLANIF interfaces are Layer 3 logical interfaces. After being assigned IP addresses, VLANIF interfaces are able to communicate at the network layer. Layer 3 switches and routers can be configured with VLANIF interfaces.

By using VLANIF interfaces to implement inter-VLAN communication, you need to configure a VLANIF interface for each VLAN and assign an IP address to each VLANIF interface. The communication process by using VLANIF interfaces is similar to that by using sub-interfaces.

Figure 1-779 Networking diagram for configuring VLANIF interfaces for inter-VLAN communication

The default gateway address of each PC in a VLAN must be the IP address of the corresponding VLANIF interface. Otherwise, inter-VLAN communication will fail.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface vlanif vlan-id

    A VLANIF interface is created and the VLANIF interface view is displayed.

    The VLAN ID specified in this command must be the ID of an existing VLAN.

    A VLANIF interface is Up only when at least one physical port added to the corresponding VLAN is Up.

  3. Run ip address ip-address { mask | mask-length } [ sub ]

    An IP address is assigned to the VLANIF interface.

    VLANIF interfaces must belong to different network segments.

  4. Run commit

    The configuration is committed.

Configuring VLAN Mapping for Inter-VLAN Communication

The configuration of VLAN mapping is simple and independent of Layer 3 routing.

Context

VLAN mapping is also called VLAN translation. With VLAN mapping, a device maps the VLAN ID of a frame to another VLAN ID after receiving the frame and before sending the frame. On the network shown in Figure 1-780, ports connecting CE 1 to users are added to VLAN 2 and ports connecting CE 2 to users are added to VLAN 3. To allow users in VLAN 2 and VLAN 3 to communicate with each other, configure VLAN mapping on the uplink interface interface1 of CE1.
  • Before sending a frame to VLAN 3, interface1 on CE 1 replaces the VLAN ID 2 in the frame with the VLAN ID 3.

  • After receiving a frame from VLAN 3, interface1 on CE 1 replaces the VLAN ID 3 in the frame with the VLAN ID 2.

Figure 1-780 Networking diagram for configuring VLAN mapping for inter-VLAN communication

Before configuring VLAN mapping to allow PCs in two VLANs to communicate, IP addresses of the PCs must belong to the same network segment. Otherwise, communication between these devices must be implemented using Layer 3 routes, making VLAN mapping invalid.

Currently, the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M supports the following mapping modes:
  • 1 to 1 VLAN mapping

    After receiving a single-tagged frame, the device replaces the tag with a specified tag.

    1 to 1 VLAN mapping is applicable to the networking environment shown in Figure 1-781.

    Figure 1-781 Networking diagram for 1 to 1 VLAN mapping

    On the network shown in Figure 1-781, different types of services (Internet, IPTV, and VoIP) of each household are transmitted in separate VLANs. To differentiate between households, you need to configure 1 to 1 VLAN mapping on each corridor switch to transmit the same type of services for different households in separate VLANs. In this case, the aggregation switch must provide a large number of VLAN IDs to separate services of different households. As the number of available VLAN IDs on the aggregation switch is limited, you need to implement VLAN aggregation to transmit the same type of services for different households in one VLAN.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Add the ports connected to users to the specified VLANs.
  3. Configure the Layer 2 port type.

    1. Run the interface interface-type interface-number command to enter the view of an Ethernet port to be configured with VLAN mapping.

    2. Run the port link-type trunk command to configure the Layer 2 Ethernet port as a trunk port.

  4. Run port vlan-mapping vlan vlan-id1 [ to vlan-id2 ] map-vlan vlan-id3

    VLAN mapping is configured to change the outer VLAN tag to vlan-id3.

  5. Run the port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all } command to specify the VLAN IDs permitted by the port configured with VLAN mapping.

    The VLAN ID specified in this command must be private VLAN IDs and cannot be public VLAN IDs.

  6. Run commit

    The configuration is committed.

Verifying the Inter-VLAN Communication Configuration

After inter-VLAN communication is configured, you can check whether users in different VLANs can communicate with each other and check information about VLANs to which users belong.

Prerequisites

The configurations of inter-VLAN communication are complete.

Procedure

  • Run the ping [ ip ] [ -a source-ip-address | -c count | -d | -f | -h ttl-value | -i interface-type interface-number | -m time | -n | -p pattern | -q | -r | -s packetsize | -system-time | -t timeout | -tos tos-value | -v | -vpn-instance vpn-instance-name ] * host command to check whether users in different VLANs can communicate with each other.

    If the ping fails, you can run the following commands to locate the fault:

    • Run the display vlan [ vlan-id [ verbose ] ] command to check information about all VLANs or a specified VLAN.

    • Run the display interface vlanif [ vlan-id ] command to check information about VLANIF interfaces.

      Before running this command, ensure that VLANIF interfaces have been configured.

Configuring VLAN Security Attributes

Configuring VLAN security attributes ensures reliable transmission of user data. Currently, the NetEngine 8100 M, NetEngine 8000E M, NetEngine 8000 M supports two security attributes. You can configure security attributes as required.

Applicable Environment

Table 1-391 lists VLAN security attribute schemes.

Table 1-391 Security schemes for VLANs

Security Scheme

Description

Advantage

Disadvantage

Usage Scenario

Disabling a port from broadcasting packets to other ports in the same VLAN

If a port in a VLAN receives a broadcast or unknown unicast packet, it will broadcast the packet to other ports in the VLAN. If the broadcast or unknown unicast packet is malicious, system resources waste and device performance deteriorates or even the device malfunctions. Disabling the port from broadcasting packets to other ports in the VLAN prevents malicious attacks.

-

-

This security scheme is applicable to topology-stable networks or networks on which MAC addresses are configured and forwarding paths are specified.

Disabling MAC address learning in a VLAN

If a device has only one inbound port and one outbound port, MAC address learning in a VLAN can be disabled.

  • MAC address entries are saved.

  • Security is guaranteed.

This security scheme requires that the network has fixed users and forwarding paths have been established by using dynamic MAC address learning or by manually configuring MAC addresses.

If there are a large number of users connected to a switch, each user needs to be configured with a static forwarding path. This imposes a configuration burden on network administrators.

This security scheme prohibits new users from visiting the network.

This security scheme is applicable to topology-stable networks or networks on which MAC addresses are configured and forwarding paths are specified.

Pre-configuration Tasks

Before configuring VLAN security attributes, complete the following task:
  • Creating VLANs

Disabling a Port from Broadcasting Packets to Other Ports in the Same VLAN

Disabling a port from broadcasting packets to other ports in the same VLAN prevents malicious attacks and improves network security.

Context

If a port in a VLAN receives a broadcast or unknown unicast packet, it will broadcast the packet to other ports in the VLAN. If the broadcast or unknown unicast packet is malicious, system resources waste and device performance deteriorates or even the device malfunctions. Disabling the port from broadcasting packets to other ports in the VLAN prevents malicious attacks.

This security scheme is applicable to topology-stable networks or networks on which MAC addresses are configured and forwarding paths are specified.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run vlan vlan-id

    The VLAN view is displayed.

    If a device is configured with multiple VLANs, do as follows to configure a name for each VLAN:

    Run the name vlan-name command in the VLAN view. After a VLAN name is configured, you can run the vlan vlan-name vlan-name command in the system view to enter the corresponding VLAN view.

  3. Run broadcast discard

    The port is disabled from broadcasting packets to other ports in the same VLAN.

  4. Run commit

    The configuration is committed.

Disabling MAC Address Learning in a VLAN

If a device has only one inbound port and one outbound port, or the network topology is stable, MAC address learning in a VLAN can be disabled.

Context

A company has multiple departments located in different stories of a building. It is required that PCs of one department be grouped into a VLAN and PCs in different departments be grouped into different VLANs.

On the network shown in Figure 1-782, department 1 belongs to VLAN 2; department 2 belongs to VLAN 3; the public sector belongs to VLAN 10. Users in VLANs 2 and 3 can access VLAN 10. Users in VLAN 2 or 3 can communicate with each other. Users in VLAN 2 cannot communicate with users in VLAN 3. To reduce the number of MAC address entries saved on the core switching device and prevent visitors from accessing the company's network, you can disable MAC address learning in a VLAN on CE 1 and CE 5.

Disabling MAC address learning in a VLAN is suitable for a device that has only one inbound port and one outbound port or a network with a stable topology.

Figure 1-782 Networking diagram for disabling MAC address learning in a VLAN

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run vlan vlan-id

    The VLAN view is displayed.

    If a device is configured with multiple VLANs, do as follows to configure a name for each VLAN:

    Run the name vlan-name command in the VLAN view. After a VLAN name is configured, you can run the vlan vlan-name vlan-name command in the system view to enter the corresponding VLAN view.

  3. Run mac-address learning disable

    MAC address learning in a VLAN is disabled.

  4. Run commit

    The configuration is committed.

Verifying the VLAN Security Attribute Configuration

After VLAN security attributes are configured, you can check whether a VLAN is enabled with the broadcast function and the MAC address learning function.

Prerequisites

The configurations of VLAN security attributes are complete.

Procedure

  • Run the display vlan [ vlan-id ] command to check information about all VLANs or a specified VLAN.

Modifying the Mode Used to Add Interfaces to a VLAN Through the YANG API

Modify the mode used to add interfaces to a VLAN through the YANG API according to site requirements.

Usage Scenario

You can add trunk or hybrid interfaces to a VLAN through the YANG API using either of the following modes:

  • VLAN range mode (used by default). It features good performance and is easy to use for VLAN query and configuration. However, this mode cannot be used for incremental configuration delivery when some third-party NMSs are involved.
  • Leaf-list mode. It has poor performance, and its efficiency decreases as the number of VLANs increases. However, it supports incremental configuration delivery when some third-party NMSs are involved.

Determine whether to use this mode based on site requirements.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run ethernet yang-mode trunk-vlan vlan-id-list

    The default VLAN range mode is switched to the leaf-list mode.

  3. Run commit

    The configuration is committed.

Verifying the Configuration

Run the display current-configuration command to check whether the mode is successfully switched.

Configuring Intra-VLAN Interface Isolation

After you configure selected interfaces in a VLAN as isolated interfaces, these interfaces cannot communicate.

Usage Scenario

Intra-VLAN interface isolation disables specific interfaces in a VLAN from communicating.

To enable isolated interfaces to communicate, configure Layer 3 routing. This implementation allows you to flexibly manage and monitor VLAN users.

Pre-configuration Tasks

Before you configure intra-VLAN interface isolation, configure an interface-based VLAN.

Configuring Interface Isolation for a Common VLAN

This section describes how to configure interface isolation for a common VLAN.

Context

Two methods are available to configure interface isolation for a common VLAN:
  • Enabling interface isolation in the interface view
  • Configuring one or more interfaces as isolated interfaces in the VLAN view

In a VLAN, isolated interfaces cannot communicate with each other at Layer 2, but can do so with non-isolated interfaces.

Procedure

  • Enable interface isolation in the interface view.

    Perform the following steps on the device on which the interfaces to be isolated reside:

    1. Run system-view

      The system view is displayed.

    2. Run interface { ethernet | gigabitethernet | eth-trunk } interface-number

      The interface view is displayed.

    3. Run portswitch

      The interface is configured as a switched interface.

    4. Run port default vlan vlan-id

      The interface is added to a VLAN.

    5. Run port isolate-state enable vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10>}

      Interface isolation is enabled.

  • Configure one or more interfaces as isolated interfaces in the VLAN view.

    Perform the following steps on the device on which the interfaces to be isolated reside:

    1. Run system-view

      The system view is displayed.

    2. Run vlan vlan-id

      The VLAN view is displayed.

    3. Run port isolate { { interface-type interface-number } &<1-10>| all }

      The specified interfaces are configured as isolated interfaces.

Configuring Interface Isolation for an Outside VLAN in VLAN Stacking or VLAN Mapping Scenarios

This section describes how to configure interface isolation for an outside VLAN in VLAN stacking or VLAN mapping scenarios.

Context

Perform the following steps on the device on which the interfaces to be isolated reside:

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface { ethernet |gigabitethernet | eth-trunk } interface-number

    The interface view is displayed.

  3. Run portswitch

    The interface is configured as a switched interface.

  4. Run outside-vlan port isolate

    Interface isolation is enabled for the outside VLAN in VLAN stacking or VLAN mapping scenarios.

Enabling Intra-VLAN Proxy ARP

This section describes how to configure proxy ARP for isolated interfaces in a VLAN to communicate.

Context

Perform the following steps on the device on which the isolated interfaces that require communication reside:

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface vlanif vlan-id

    A VLANIF interface is created.

  3. Run ip address ip-address { mask | mask-length } [ sub ]

    An IP address is assigned to the VLANIF interface.

    The IP address of the VLANIF interface must be on the same network segment as the IP addresses of interfaces in the VLAN.

    The IP addresses of different VLANIF interfaces must be on different network segments so that users in different VLANs can communicate with each other.

  4. Run arp-proxy inner-sub-vlan-proxy enable

    Intra-VLAN proxy ARP is enabled.

Verifying the Intra-VLAN Interface Isolation Configuration

After interface isolation is configured for a common VLAN, verify the configuration.

Procedure

  1. Run the display port-isolate command in the VLAN view to check interface isolation information.
  2. Run the display this command in the interface view to check interface isolation information for an outside VLAN in VLAN stacking or VLAN mapping scenarios.

Maintaining VLAN

A command of clearing statistics helps to locate the faults in a VLAN.

Clearing the Statistics of VLAN Packets

Before collecting traffic statistics in a specified time period on an interface, you need to reset the original statistics on the interface.

Context

Statistics of VLAN packets cannot be restored after you clear it. So, confirm the action before you use the command.

To clear the statistics of VLAN packets, run the following reset command in the user view:

Procedure

  • Run the reset statistics interface interface type interface number vlan vlan-id command to clear the VLAN packet statistics on a specified interface.

Monitoring the VLAN Operating Status

This section describes how to monitor the VLAN operating status.

Context

In routine maintenance, you can run the following command in any view to check the VLAN operating status.

Procedure

  • Run the display vlan vlan-id statistics command to view VLAN packet statistics.

    Before you run this command to view VLAN packet statistics to locate faults, run the statistics enable command in the VLAN view to enable VLAN packet statistics collection. If VLAN packet statistics collection is disabled, you cannot obtain statistics.

  • Run the display vlan vlan-id statistics command to check statistics about discarded BUM packets in a specified VLAN.

    Before you run the display vlan vlan-id statistics command to check statistics about discarded BUM packets in a VLAN for fault locating, run the statistic discard enable command in the VLAN view to enable collection on traffic statistics about discarded BUM packets. If you do not run the statistic discard enable command, the statistics cannot be collected.

  • Run the display statistics interface interface-type interface-number vlan vlan-id command to view statistics about both sent and received packets on a specific interface in a specific VLAN.

    To view packet statistics on a specified interface in a specified VLAN for fault locating, run the statistics enable vlan command in the interface view to enable VLAN-based packet statistics collection on the interface. If the statistics enable vlan command is not executed, statistics cannot be displayed.

  • Run the monitor interface-vlan-statistics interface interface-type interface-number vlan vlan-id [ interval interval-value | times { times-value | infinity } ] command to monitor traffic statistics on an interface of a specified VLAN.

    By default, once the monitor interface-vlan-statistics command is run on an interface, the system displays traffic statistics five times at an interval of 10s. To stop the statistics display, press Ctrl+C.

Configuration Examples for VLANs

This section describes the typical application scenarios of VLANs, including networking requirements, configuration roadmap, and data preparation, and provides related configuration files.

Example for Dividing a LAN into VLANs Based on Ports

It is easy to divide a LAN into VLANs based on ports. After ports are added to different VLANs, users in the same VLAN can directly communicate with each other, whereas users in different VLANs cannot directly communicate with each other.

Networking Requirements

As shown in Figure 1-783, a department has multiple project teams. To improve service security, it is required that employees in the same project team can communicate with each other but employees in different project teams cannot communicate with each other.

Figure 1-783 Networking diagram for dividing a LAN into VLANs based on ports

Interfaces 1 through 4 in this example are GE 0/1/1, GE 0/1/2, GE 0/1/3, GE 0/1/4, respectively.


Configuration Roadmap

The configuration roadmap is as follows:

  1. Create VLANs and determine mappings between employees and VLANs.
  2. Configure port types to determine the device connected to each port.
  3. Add the port connected to group 1 to VLAN 2 and the port connected to group 2 to VLAN 3 to prevent employees in group 1 from communicating with employees in group 2.

Data Preparation

To complete the configuration, you need the following data:

  • Number of each port connecting CE to a PC
  • ID of each VLAN

Procedure

  1. Create VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE
    [*HUAWEI] commit
    [~CE] vlan batch 2 3

  2. Configure port types.

    [*CE] interface gigabitethernet 0/1/1
    [*CE-GigabitEthernet0/1/1] portswitch
    [*CE-GigabitEthernet0/1/1] undo shutdown
    [*CE-GigabitEthernet0/1/1] port link-type access
    [*CE-GigabitEthernet0/1/1] quit
    [*CE] interface gigabitethernet 0/1/2
    [*CE-GigabitEthernet0/1/2] portswitch
    [*CE-GigabitEthernet0/1/2] undo shutdown
    [*CE-GigabitEthernet0/1/2] port link-type access
    [*CE-GigabitEthernet0/1/2] quit
    [*CE] interface GigabitEthernet 0/1/3
    [*CE-GigabitEthernet0/1/3] portswitch
    [*CE-GigabitEthernet0/1/3] undo shutdown
    [*CE-GigabitEthernet0/1/3] port link-type access
    [*CE-GigabitEthernet0/1/3] quit
    [*CE] interface GigabitEthernet 0/1/4
    [*CE-GigabitEthernet0/1/4] portswitch
    [*CE-GigabitEthernet0/1/4] undo shutdown
    [*CE-GigabitEthernet0/1/4] port link-type access
    [*CE-GigabitEthernet0/1/4] quit

  3. Add ports to VLANs.

    # Add GE 0/1/1 and GE 0/1/2 to VLAN 2.

    [*CE] vlan 2
    [*CE-vlan2] port gigabitethernet 0/1/1 to 0/1/2
    [*CE-vlan2] quit

    # Add GE 0/1/3 and GE 0/1/4 to VLAN 3.

    [*CE] vlan 3
    [*CE-vlan3] port gigabitethernet 0/1/3 to 0/1/4
    [*CE-vlan3]quit
    [*CE] commit

  4. Verify the configuration.

    After the configurations are complete, run the display vlan command to view the VLAN status.

    [~CE] display vlan
    The total number of vlans is : 2                                               
    VID  Type     Status  Property  MAC-LRN STAT    BC  MC  UC  Description         
    --------------------------------------------------------------------------------
       2 common   enable  default   enable  disable FWD FWD FWD VLAN 0002
       3 common   enable  default   enable  disable FWD FWD FWD VLAN 0003

    Ping a PC in group 2 from a PC in group 1. The ping fails. PCs in the same group can ping each other successfully.

Configuration Files

#
sysname CE
#
vlan batch 2 3
#
interface GigabitEthernet0/1/1
 portswitch
 undo shutdown
 port link-type access
 port default vlan 2
#
interface GigabitEthernet0/1/2
 portswitch
 undo shutdown
 port link-type access
 port default vlan 2
#
interface GigabitEthernet0/1/3
 portswitch
 undo shutdown
 port link-type access
 port default vlan 3
#
interface GigabitEthernet0/1/4
 portswitch
 undo shutdown
 port link-type access
 port default vlan 3
#
return

Example for Configuring Users in a VLAN to Communicate by Using a Trunk Link

If employees of a department work in different buildings, devices in the buildings can be connected by using a trunk link to allow the employees to communicate.

Networking Requirements

A company has several departments. Employees of each department reside in different buildings.

On the network shown in Figure 1-784, employees of the financial or marketing department work in different buildings. It is required that employees of the same department can communicate with each other but employees of different departments cannot communicate with each other.

Figure 1-784 Networking diagram for configuring users in a VLAN to communicate by using a trunk link

Interfaces 1 through 5 in this example are GE 0/1/1, GE 0/1/2, GE 0/1/3, GE 0/1/4, GE 0/1/5, respectively.


Configuration Roadmap

The configuration roadmap is as follows:

  1. Add the device port connected to the financial department to VLAN 5 and the device port connected to the marketing department to VLAN 9 to isolate these two departments.
  2. Configure links between CEs and PE as trunk links to allow frames from VLAN 5 and VLAN 9 to pass through, allowing employees of the same department but different buildings to communicate with each other.

    Only Layer 2 ports are able to identify frames with tags. Therefore, you need to switch the interfaces connecting PEs and CEs to Layer 2 ports.

Data Preparation

To complete the configuration, you need the following data:

  • Number of each port connecting a CE to a PC
  • Number of each port connecting a CE to the PE
  • Number of each port connecting the PE to a CE
  • ID of each VLAN

Procedure

  1. Add the downlink interfaces of the CEs to the specified VLANs.

    # Configure CE 1.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE1
    [*HUAWEI] commit
    [~CE1] vlan batch 5 9
    [*CE1] interface gigabitethernet 0/1/1
    [*CE1-GigabitEthernet0/1/1] portswitch
    [*CE1-GigabitEthernet0/1/1] undo shutdown
    [*CE1-GigabitEthernet0/1/1] port link-type access
    [*CE1-GigabitEthernet0/1/1] port default vlan 5
    [*CE1-GigabitEthernet0/1/1] quit
    [*CE1] interface gigabitethernet 0/1/2
    [*CE1-GigabitEthernet0/1/2] portswitch
    [*CE1-GigabitEthernet0/1/2] undo shutdown
    [*CE1-GigabitEthernet0/1/2] port link-type access
    [*CE1-GigabitEthernet0/1/2] port default vlan 5
    [*CE1-GigabitEthernet0/1/2] quit
    [*CE1] interface gigabitethernet 0/1/3
    [*CE1-GigabitEthernet0/1/3] portswitch
    [*CE1-GigabitEthernet0/1/3] undo shutdown
    [*CE1-GigabitEthernet0/1/3] port link-type access
    [*CE1-GigabitEthernet0/1/3] port default vlan 9
    [*CE1-GigabitEthernet0/1/3] quit
    [*CE1] interface gigabitethernet 0/1/4
    [*CE1-GigabitEthernet0/1/4] portswitch
    [*CE1-GigabitEthernet0/1/4] undo shutdown
    [*CE1-GigabitEthernet0/1/4] port link-type access
    [*CE1-GigabitEthernet0/1/4] port default vlan 9
    [*CE1-GigabitEthernet0/1/4] commit
    [~CE1-GigabitEthernet0/1/4] quit

    # Configure CE 2.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE2
    [*HUAWEI] commit
    [~CE2] vlan batch 5 9
    [*CE2] interface gigabitethernet 0/1/1
    [*CE2-GigabitEthernet0/1/1] portswitch
    [*CE2-GigabitEthernet0/1/1] undo shutdown
    [*CE2-GigabitEthernet0/1/1] port link-type access
    [*CE2-GigabitEthernet0/1/1] port default vlan 5
    [*CE2-GigabitEthernet0/1/1] quit
    [*CE2] interface gigabitethernet 0/1/2
    [*CE2-GigabitEthernet0/1/2] portswitch
    [*CE2-GigabitEthernet0/1/2] undo shutdown
    [*CE2-GigabitEthernet0/1/2] port link-type access
    [*CE2-GigabitEthernet0/1/2] port default vlan 5
    [*CE2-GigabitEthernet0/1/2] quit
    [*CE2] interface gigabitethernet 0/1/3
    [*CE2-GigabitEthernet0/1/3] portswitch
    [*CE2-GigabitEthernet0/1/3] undo shutdown
    [*CE2-GigabitEthernet0/1/3] port link-type access
    [*CE2-GigabitEthernet0/1/3] port default vlan 9
    [*CE2-GigabitEthernet0/1/3] quit
    [*CE2] interface gigabitethernet 0/1/4
    [*CE2-GigabitEthernet0/1/4] portswitch
    [*CE2-GigabitEthernet0/1/4] undo shutdown
    [*CE2-GigabitEthernet0/1/4] port link-type access
    [*CE2-GigabitEthernet0/1/4] port default vlan 9
    [*CE2-GigabitEthernet0/1/4] commit
    [~CE2-GigabitEthernet0/1/4] quit

  2. Configure links between CEs and the PE as trunk links.

    # Configure CE 1.

    [*CE1] interface gigabitethernet 0/1/5
    [*CE1-GigabitEthernet0/1/5] portswitch
    [*CE1-GigabitEthernet0/1/5] undo shutdown
    [*CE1-GigabitEthernet0/1/5] port link-type trunk
    [*CE1-GigabitEthernet0/1/5] port trunk allow-pass vlan 5 9
    [*CE1-GigabitEthernet0/1/5] quit
    [*CE1] commit

    # Configure CE 2.

    [*CE2] interface gigabitethernet 0/1/5
    [*CE2-GigabitEthernet0/1/5] portswitch
    [*CE2-GigabitEthernet0/1/5] undo shutdown
    [*CE2-GigabitEthernet0/1/5] port link-type trunk
    [*CE2-GigabitEthernet0/1/5] port trunk allow-pass vlan 5 9
    [*CE2-GigabitEthernet0/1/5] quit
    [*CE2] commit

  3. Configure PE.

    <HUAWEI> system-view
    [~HUAWEI] sysname PE
    [*HUAWEI] commit
    [~PE] interface gigabitethernet 0/1/1
    [*PE-GigabitEthernet0/1/1] portswitch
    [*PE-GigabitEthernet0/1/1] undo shutdown
    [*PE-GigabitEthernet0/1/1] port link-type trunk
    [*PE-GigabitEthernet0/1/1] port trunk allow-pass vlan 5 9
    [*PE-GigabitEthernet0/1/1] quit
    [*PE] interface gigabitethernet 0/1/2
    [*PE-GigabitEthernet0/1/2] portswitch
    [*PE-GigabitEthernet0/1/2] undo shutdown
    [*PE-GigabitEthernet0/1/2] port link-type trunk
    [*PE-GigabitEthernet0/1/2] port trunk allow-pass vlan 5 9
    [*PE-GigabitEthernet0/1/2] quit
    [*PE] commit

  4. Verify the configuration.

    After the configurations are complete, run the display vlan command to view VLAN status. In the following example, the display on CE1 is used:

    [~CE1] display vlan 5
    --------------------------------------------------------------------------------
    U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
    MP: Vlan-mapping;               ST: Vlan-stacking;
    #: ProtocolTransparent-vlan;    *: Management-vlan;
    --------------------------------------------------------------------------------
    
    VID  Type    Ports
    --------------------------------------------------------------------------------
    5    common  UT:0/1/1(U)     0/1/2(U)
                 TG:0/1/5(U)
    
    VID  Status  Property      MAC-LRN Statistics Description
    --------------------------------------------------------------------------------
    5    enable  default       enable  disable    VLAN 0005  

    Run the display port vlan command to view the list of VLANs configured on the trunk port. The following uses CE1 as an example:

    [*CE1] display port vlan gigabitethernet0/1/5
    Port                     Link Type    PVID    Trunk VLAN List
    --------------------------------------------------------------
    GigabitEthernet0/1/5     trunk        0       5 9

    In either VLAN 5 or VLAN 9, a PC connected to CE 1 can ping a PC connected to CE 2 successfully.

Configuration Files

  • CE1 configuration file

    #
     sysname CE1
    #
     vlan batch 5 9
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type access
     port default vlan 5
    #
    interface GigabitEthernet0/1/2
     portswitch
     undo shutdown
     port link-type access
     port default vlan 5
    #
    interface GigabitEthernet0/1/3
     portswitch
     undo shutdown
     port link-type access
     port default vlan 9
    #
    interface GigabitEthernet0/1/4
     portswitch
     undo shutdown
     port link-type access
     port default vlan 9
    #
    interface GigabitEthernet0/1/5
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 5 9
    #
    return
  • CE2 configuration file

    #
     sysname CE2
    #
     vlan batch 5 9
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type access
     port default vlan 5
    #
    interface GigabitEthernet0/1/2
     portswitch
     undo shutdown
     port link-type access
     port default vlan 5
    #
    interface GigabitEthernet0/1/3
     portswitch
     undo shutdown
     port link-type access
     port default vlan 9
    #
    interface GigabitEthernet0/1/4
     portswitch
     undo shutdown
     port link-type access
     port default vlan 9
    #
    interface GigabitEthernet0/1/5
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 5 9
    #
    return
  • PE configuration file

    #
     sysname PE
    #
     vlan batch 5 9
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 5 9
    #
    interface GigabitEthernet0/1/2
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 5 9
    #
    return

Example for Configuring Inter-VLAN Communication by Using Sub-interfaces

Configuring sub-interfaces enables users in different VLANs and network segments to communicate with each other.

Networking Requirements

Users in different residential compounds in different network segments require various services such as Internet, IPTV, and VoIP services. The network administrator of each residential compound configures a VLAN for each service to simplify management. After the configuration, users in different residential compounds belong to different VLANs, but they need to communicate with each other for the same type of service.

On the network shown in Figure 1-785, users in residential compounds 1 to 4 belong to different VLANs and network segments but all require the Internet access service. Therefore, communication between these users is required.

Figure 1-785 Networking diagram for configuring inter-VLAN communication by using sub-interfaces

Interfaces 1 through 3 and subinterface1.1, subinterface1.2, subinterface2.1, subinterface2.2 in this example are GE 0/1/1, GE 0/1/2, GE 0/1/3, GE 0/1/1.1, GE 0/1/1.2, GE 0/1/2.1, GE 0/1/2.2, respectively.


Configuration Roadmap

The configuration roadmap is as follows:

  1. Create VLANs on the CEs and determine the VLANs to which users belong.
  2. Configure trunk ports on CEs to allow frames with certain VLAN IDs to pass through.
  3. Create sub-interfaces on PE and associate the sub-interfaces with VLANs.
  4. Assign an IP address to each sub-interface for communication at the network layer.

The default gateway address of each PC in a VLAN must be the IP address of the corresponding sub-interface. Otherwise, inter-VLAN communication fails.

Data Preparation

To complete the configuration, you need the following data:
  • User VLAN ID
  • User IP address
  • Number of each port connecting a CE to a PC
  • Number of each port connecting a CE to the PE
  • Number and IP address of each sub-interface on PE

Procedure

  1. Create VLANs on CE1 and CE2.

    # Configure CE1.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE1
    [*HUAWEI] commit
    [~CE1] vlan batch 30 40
    [*CE1] interface gigabitethernet 0/1/1
    [*CE1-GigabitEthernet0/1/1] portswitch
    [*CE1-GigabitEthernet0/1/1] undo shutdown
    [*CE1-GigabitEthernet0/1/1] port link-type access
    [*CE1-GigabitEthernet0/1/1] port default vlan 30
    [*CE1-GigabitEthernet0/1/1] quit
    [*CE1] interface gigabitethernet 0/1/2
    [*CE1-GigabitEthernet0/1/2] portswitch
    [*CE1-GigabitEthernet0/1/2] undo shutdown
    [*CE1-GigabitEthernet0/1/2] port link-type access
    [*CE1-GigabitEthernet0/1/2] port default vlan 40
    [*CE1-GigabitEthernet0/1/2] quit

    # Configure CE2.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE2
    [*HUAWEI] commit
    [~CE2] vlan batch 10 20
    [*CE2] interface gigabitethernet 0/1/1
    [*CE2-GigabitEthernet0/1/1] portswitch
    [*CE2-GigabitEthernet0/1/1] undo shutdown
    [*CE2-GigabitEthernet0/1/1] port link-type access
    [*CE2-GigabitEthernet0/1/1] port default vlan 10
    [*CE2-GigabitEthernet0/1/1] quit
    [*CE2] interface gigabitethernet 0/1/2
    [*CE2-GigabitEthernet0/1/2] portswitch
    [*CE2-GigabitEthernet0/1/2] undo shutdown
    [*CE2-GigabitEthernet0/1/2] port link-type access
    [*CE2-GigabitEthernet0/1/2] port default vlan 20
    [*CE2-GigabitEthernet0/1/2] quit

  2. Configure trunk ports on CE 1 and CE 2 to allow frames with certain VLAN IDs to pass through.

    # Configure CE1.

    [*CE1] interface gigabitethernet 0/1/3
    [*CE1-GigabitEthernet0/1/3] portswitch
    [*CE1-GigabitEthernet0/1/3] undo shutdown
    [*CE1-GigabitEthernet0/1/3] port link-type trunk
    [*CE1-GigabitEthernet0/1/3] port trunk allow-pass vlan 30 40
    [*CE1-GigabitEthernet0/1/3] quit
    [*CE1] commit

    # Configure CE2.

    [*CE2] interface gigabitethernet 0/1/3
    [*CE2-GigabitEthernet0/1/3] portswitch
    [*CE2-GigabitEthernet0/1/3] undo shutdown
    [*CE2-GigabitEthernet0/1/3] port link-type trunk
    [*CE2-GigabitEthernet0/1/3] port trunk allow-pass vlan 10 20
    [*CE2-GigabitEthernet0/1/3] quit
    [*CE2] commit

  3. Create sub-interfaces on PE and associate the sub-interfaces with VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname PE
    [*HUAWEI] commit
    [~PE] interface gigabitethernet 0/1/1
    [*PE-GigabitEthernet0/1/1] undo shutdown
    [*PE-GigabitEthernet0/1/1] quit
    [*PE] interface gigabitethernet 0/1/1.1
    [*PE-GigabitEthernet0/1/1.1] vlan-type dot1q 10
    [*PE-GigabitEthernet0/1/1.1] quit
    [*PE] interface gigabitethernet 0/1/1.2
    [*PE-GigabitEthernet0/1/1.2] vlan-type dot1q 20
    [*PE-GigabitEthernet0/1/1.2] quit
    [*PE] interface gigabitethernet 0/1/2
    [*PE-GigabitEthernet0/1/2] undo shutdown
    [*PE-GigabitEthernet0/1/2] quit
    [*PE] interface gigabitethernet 0/1/2.1
    [*PE-GigabitEthernet0/1/2.1] vlan-type dot1q 30
    [*PE-GigabitEthernet0/1/2.1] quit
    [*PE] interface gigabitethernet 0/1/2.2
    [*PE-GigabitEthernet0/1/2.2] vlan-type dot1q 40
    [*PE-GigabitEthernet0/1/2.2] quit

  4. Configure IP addresses.

    [*PE] interface gigabitethernet 0/1/1.1
    [*PE-GigabitEthernet0/1/1.1] ip address 10.110.6.3 24
    [*PE-GigabitEthernet0/1/1.1] quit
    [*PE] interface gigabitethernet 0/1/1.2
    [*PE-GigabitEthernet0/1/1.2] ip address 10.110.5.3 24
    [*PE-GigabitEthernet0/1/1.2] quit
    [*PE] interface gigabitethernet 0/1/2.1
    [*PE-GigabitEthernet0/1/2.1] ip address 10.110.4.3 24
    [*PE-GigabitEthernet0/1/2.1] quit
    [*PE] interface gigabitethernet 0/1/2.2
    [*PE-GigabitEthernet0/1/2.2] ip address 10.110.3.3 24
    [*PE-GigabitEthernet0/1/2.2] quit
    [*PE] commit

  5. Verify the configuration.

    On PCs in VLAN 10, configure the IP address 10.110.6.3/24 of GE 0/1/1.1 as the default gateway address.

    On PCs in VLAN 20, configure the IP address 10.110.5.3/24 of GE 0/1/1.2 as the default gateway address.

    On PCs in VLAN 30, configure the IP address 10.110.4.3/24 of GE 0/1/2.1 as the default gateway address.

    On PCs in VLAN 40, configure the IP address 10.110.3.3/24 of GE0/1/2.2 as the default gateway address.

    After the configurations, PCs in VLANs 10, 20, 30, and 40 can ping each other successfully.

Configuration Files

  • Configuration file of CE1

    #
     sysname CE1
    #
     vlan batch 30 40
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type access
     port default vlan 30
    #
    interface GigabitEthernet0/1/2
     portswitch
     undo shutdown
     port link-type access
     port default vlan 40
    #
    interface GigabitEthernet0/1/3
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 30 40
    #
    return
  • Configuration file of CE2

    #
     sysname CE2
    #
     vlan batch 10 20
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type access
     port default vlan 10
    #
    interface GigabitEthernet0/1/2
     portswitch
     undo shutdown
     port link-type access
     port default vlan 20
    #
    interface GigabitEthernet0/1/3
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 10 20
    #
    return
  • Configuration file of PE

    #
     sysname PE
    #
    interface GigabitEthernet0/1/1
     undo shutdown
    #
    interface GigabitEthernet0/1/1.1
     vlan-type dot1q 10
     ip address 10.110.6.3 255.255.255.0
    #
    interface GigabitEthernet0/1/1.2
     vlan-type dot1q 20
     ip address 10.110.5.3 255.255.255.0
    #
    interface GigabitEthernet0/1/2
     undo shutdown
    #
    interface GigabitEthernet0/1/2.1
     vlan-type dot1q 30
     ip address 10.110.4.3 255.255.255.0
    #
    interface GigabitEthernet0/1/2.2
     vlan-type dot1q 40
     ip address 10.110.3.3 255.255.255.0
    #
    return

Example for Configuring VLAN and Non-VLAN Users to Communicate by Using Sub-interfaces

This example describes how to configure communication between VLAN users and non-VLAN users.

Networking Requirements

Residents in a residential compound belong to different network segments. To simplify management, the network administrator of the residential compound adds users to different VLANs. Residents in another residential compound are not added to any VLAN. VLAN users must be able to communicate with non-VLAN users.

On the network shown in Figure 1-786, users in residential compound 1 belong to different VLANs and network segments, and users in residential compound 2 do not belong to any VLAN. It is required that the network permit the communication between users in VLAN 10 and users in residential compound 2.

Figure 1-786 Networking diagram for configuring VLAN and non-VLAN users to communicate by using sub-interfaces

Interfaces 1 through 3 and subinterface1.1 in this example represent GE 0/1/1, GE 0/1/2, GE 0/1/3, GE 0/1/1.1, respectively.


Configuration Roadmap

The configuration roadmap is as follows:

  1. Create VLANs on the CEs and determine the VLANs to which users belong.
  2. Configure Layer 2 interfaces on the CEs to allow packets from the VLANs to pass through.
  3. Create a sub-interface on the interface connecting the PE to VLAN users and associate the sub-interface with the VLAN.
  4. Assign IP addresses to interfaces for communication at the network layer.

    • Assign an IP address to the sub-interface.
    • Assign an IP address to the interface connecting the PE to non-VLAN users.
  • The IP address assigned to the sub-interface connected to VLAN users must be on the same network segment with IP addresses of VLAN users.
  • The IP address assigned to the interface connected to non-VLAN users must be on the same network segment with IP addresses of non-VLAN users.
  • The default gateway addresses of PCs in VLAN 10 must be the IP address of the sub-interface. Otherwise, VLAN and non-VLAN users cannot communicate with each other.

Data Preparation

To complete the configuration, you need the following data:
  • User VLAN ID
  • User IP address
  • Number of each port connecting a CE to a PC
  • Number of each port connecting a CE to the PE
  • Number and IP address of each sub-interface on PE

Procedure

  1. Create a VLAN on CE 1.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE1
    [*HUAWEI] commit
    [~CE1] vlan batch 10
    [*CE1-vlan10] quit
    [*CE1] interface gigabitethernet 0/1/1
    [*CE1-GigabitEthernet0/1/1] portswitch
    [*CE1-GigabitEthernet0/1/1] undo shutdown
    [*CE1-GigabitEthernet0/1/1] port link-type access
    [*CE1-GigabitEthernet0/1/1] port default vlan 10
    [*CE1-GigabitEthernet0/1/1] quit

  2. Configure the trunk port on CE 1 to allow frames with certain VLAN IDs to pass through.

    [*CE1] interface gigabitethernet 0/1/3
    [*CE1-GigabitEthernet0/1/3] portswitch
    [*CE1-GigabitEthernet0/1/3] undo shutdown
    [*CE1-GigabitEthernet0/1/3] port link-type trunk
    [*CE1-GigabitEthernet0/1/3] port trunk allow-pass vlan 10 20
    [*CE1-GigabitEthernet0/1/3] quit
    [*CE1] commit

  3. Create a sub-interface on PE and associate the sub-interface with VLAN 10.

    <HUAWEI> system-view
    [~HUAWEI] sysname PE
    [*HUAWEI] commit
    [~PE] interface gigabitethernet 0/1/1
    [*PE-GigabitEthernet0/1/1] undo shutdown
    [*PE-GigabitEthernet0/1/1] quit
    [*PE] interface gigabitethernet 0/1/1.1
    [*PE-GigabitEthernet0/1/1.1] vlan-type dot1q 10

  4. Configure IP addresses.

    [*PE-GigabitEthernet0/1/1.1] ip address 10.110.2.5 24
    [*PE-GigabitEthernet0/1/1.1] quit
    [*PE] interface gigabitethernet 0/1/2
    [*PE-GigabitEthernet0/1/2] undo shutdown
    [*PE-GigabitEthernet0/1/2] ip address 10.110.3.5 24
    [*PE-GigabitEthernet0/1/2] quit
    [*PE] commit

  5. Verify the configuration.

    On PCs in VLAN 10, configure the IP address 10.110.2.5/24 of GE 0/1/1.1 as the default gateway address.

    On CE 2, configure the IP address 10.110.3.5 of GE 0/1/2 as the default gateway address.

    After the configurations, users in VLAN 10 and non-VLAN users can ping each other successfully.

Configuration Files

  • Configuration file of CE 1

    #
     sysname CE1
    #
     vlan batch 10
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type access
     port default vlan 10
    #
    interface GigabitEthernet0/1/3
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 10 20
    #
    return
  • Configuration file of PE

    #
     sysname PE
    #
    interface GigabitEthernet0/1/1
     undo shutdown
    #
    interface GigabitEthernet0/1/1.1
     vlan-type dot1q 10
     ip address 10.110.2.5 255.255.255.0
    #
    interface GigabitEthernet0/1/2
     undo shutdown
     ip address 10.110.3.5 255.255.255.0
    #
    return

Example for Configuring Inter-VLAN Communication by Using VLANIF Interfaces

In this example, Layer 3 forwarding is performed by a Layer 3 PE instead of a router. This allows PCs in different VLANs to communicate with each other and reduces operating costs.

Networking Requirements

Users in different residential compounds in different network segments require various services such as Internet, IPTV, and VoIP services. The network administrator of each residential compound configures a VLAN for each service to simplify management. After the configuration, users in different residential compounds belong to different VLANs, but they need to communicate with each other for the same type of service.

On the network shown in Figure 1-787, users in communities 1 to 4 belong to different VLANs and network segments but all require the Internet access service. It is required that these users communicate with each other at a low operating cost.

Figure 1-787 Networking diagram for configuring inter-VLAN communication by using VLANIF interfaces

Interfaces 1 through 3 in this example represent GE 0/1/1, GE 0/1/2, GE 0/1/3, respectively.


Configuration Roadmap

The configuration roadmap is as follows:

  1. Create VLANs on the CEs and determine the VLANs to which users belong.
  2. Configure trunk ports on CEs to allow frames with certain VLAN IDs to pass through.
  3. Create VLANIF interfaces on the PE and assign IP addresses to the interfaces to allow Layer 3 communication.

The default gateway address of each PC in a VLAN must be the IP address of the corresponding VLANIF interface. Otherwise, inter-VLAN communication will fail.

Data Preparation

To complete the configuration, you need the following data:

  • User VLAN ID
  • User IP address
  • Number of each port connecting a CE to a PC
  • Number of the ports interconnecting CEs

  • Number and IP address of each VLANIF interface on the PE

Procedure

  1. Create VLANs on CE1 and CE2.

    # Configure CE1.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE1
    [*HUAWEI] commit
    [~CE1] vlan batch 30 40
    [*CE1] interface gigabitethernet 0/1/1
    [*CE1-GigabitEthernet0/1/1] portswitch
    [*CE1-GigabitEthernet0/1/1] undo shutdown
    [*CE1-GigabitEthernet0/1/1] port link-type access
    [*CE1-GigabitEthernet0/1/1] port default vlan 30
    [*CE1-GigabitEthernet0/1/1] quit
    [*CE1] interface gigabitethernet 0/1/2
    [*CE1-GigabitEthernet0/1/2] portswitch
    [*CE1-GigabitEthernet0/1/2] undo shutdown
    [*CE1-GigabitEthernet0/1/2] port link-type access
    [*CE1-GigabitEthernet0/1/2] port default vlan 40
    [*CE1-GigabitEthernet0/1/2] quit

    # Configure CE2.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE2
    [*HUAWEI] commit
    [~CE2] vlan batch 10 20
    [*CE2] interface gigabitethernet 0/1/1
    [*CE2-GigabitEthernet0/1/1] portswitch
    [*CE2-GigabitEthernet0/1/1] undo shutdown
    [*CE2-GigabitEthernet0/1/1] port link-type access
    [*CE2-GigabitEthernet0/1/1] port default vlan 10
    [*CE2-GigabitEthernet0/1/1] quit
    [*CE2] interface gigabitethernet 0/1/2
    [*CE2-GigabitEthernet0/1/2] portswitch
    [*CE2-GigabitEthernet0/1/2] undo shutdown
    [*CE2-GigabitEthernet0/1/2] port link-type access
    [*CE2-GigabitEthernet0/1/2] port default vlan 20
    [*CE2-GigabitEthernet0/1/2] quit

  2. Configure trunk ports on CE 1 and CE 2 to allow frames with certain VLAN IDs to pass through.

    # Configure CE1.

    [*CE1] interface gigabitethernet 0/1/3
    [*CE1-GigabitEthernet0/1/3] portswitch
    [*CE1-GigabitEthernet0/1/3] undo shutdown
    [*CE1-GigabitEthernet0/1/3] port link-type trunk
    [*CE1-GigabitEthernet0/1/3] port trunk allow-pass vlan 30 40
    [*CE1-GigabitEthernet0/1/3] quit
    [*CE1] commit

    # Configure CE2.

    [*CE2] interface gigabitethernet 0/1/3
    [*CE2-GigabitEthernet0/1/3] portswitch
    [*CE2-GigabitEthernet0/1/3] undo shutdown
    [*CE2-GigabitEthernet0/1/3] port link-type trunk
    [*CE2-GigabitEthernet0/1/3] port trunk allow-pass vlan 10 20
    [*CE2-GigabitEthernet0/1/3] quit
    [*CE2] commit

  3. Create VLANIF interfaces on PE and assign IP addresses to the VLANIF interfaces.

    <HUAWEI> system-view
    [~HUAWEI] sysname PE
    [*HUAWEI] commit
    [~PE] vlan batch 10 to 40
    [*PE] interface gigabitethernet 0/1/1
    [*PE-GigabitEthernet0/1/1] portswitch
    [*PE-GigabitEthernet0/1/1] undo shutdown
    [*PE-GigabitEthernet0/1/1] port link-type trunk
    [*PE-GigabitEthernet0/1/1] port trunk allow-pass vlan 30 40
    [*PE-GigabitEthernet0/1/1] quit
    [*PE] interface gigabitethernet 0/1/2
    [*PE-GigabitEthernet0/1/2] portswitch
    [*PE-GigabitEthernet0/1/2] undo shutdown
    [*PE-GigabitEthernet0/1/2] port link-type trunk
    [*PE-GigabitEthernet0/1/2] port trunk allow-pass vlan 10 20
    [*PE-GigabitEthernet0/1/2] quit
    [*PE] interface Vlanif 10
    [*PE-Vlanif10] ip address 10.110.6.3 24
    [*PE-Vlanif10] quit
    [*PE] interface Vlanif 20
    [*PE-Vlanif20] ip address 10.110.5.3 24
    [*PE-Vlanif20] quit
    [*PE] interface Vlanif 30
    [*PE-Vlanif30] ip address 10.110.4.3 24
    [*PE-Vlanif30] quit
    [*PE] interface Vlanif 40
    [*PE-Vlanif40] ip address 10.110.3.3 24
    [*PE-Vlanif40] quit
    [*PE] commit

  4. Verify the configuration.

    On PCs in VLAN 10, configure the IP address 10.110.6.3/24 of VLANIF 10 as the default gateway address.

    On PCs in VLAN 20, configure the IP address 10.110.5.3/24 of VLANIF 20 as the default gateway address.

    On PCs in VLAN 30, configure the IP address 10.110.4.3/24 of VLANIF 30 as the default gateway address.

    On PCs in VLAN 40, configure the IP address 10.110.3.3/24 of VLANIF 40 as the default gateway address.

    After the configurations, PCs in VLANs 10, 20, 30, and 40 can ping each other successfully.

Configuration Files

  • Configuration file of CE1

    #
     sysname CE1
    #
     vlan batch 30 40
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type access
     port default vlan 30
    #
    interface GigabitEthernet0/1/2
     portswitch
     undo shutdown
     port link-type access
     port default vlan 40
    #
    interface GigabitEthernet0/1/3
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 30 40
    #
    return
  • Configuration file of CE2

    #
     sysname CE2
    #
     vlan batch 10 20
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type access
     port default vlan 10
    #
    interface GigabitEthernet0/1/2
     portswitch
     undo shutdown
     port link-type access
     port default vlan 20
    #
    interface GigabitEthernet0/1/3
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 10 20
    #
    return
  • Configuration file of PE

    #
     sysname PE
    #
    vlan batch 10 to 40
    #
    interface Vlanif10
     ip address 10.110.6.3 255.255.255.0
    #
    interface Vlanif20
     ip address 10.110.5.3 255.255.255.0
    #
    interface Vlanif30
     ip address 10.110.4.3 255.255.255.0
    #
    interface Vlanif40
     ip address 10.110.3.3 255.255.255.0
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 30 40
    #
    interface GigabitEthernet0/1/2
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 10 20
    #
    return

Example for Configuring 1 to 1 VLAN Mapping for Inter-VLAN Communication

1 to 1 VLAN mapping allows user VLAN IDs and the ISP VLAN ID to be replaced with each other to help users in different VLANs to communicate with each other.

Networking Requirements

Users in different residential compounds use IPTV, VoIP, and Internet services. To simplify management, the network administrator of each residential compound configures a separate VLAN for each type of services. After the configuration, users using the same type of services in different residential compounds belong to different VLANs, but they need to communicate with each other.

On the network shown in Figure 1-788, the same type of services in residential compounds 1 and 2 belong to different VLANs. It is required that these users communicate with each other at a low operating cost.

Figure 1-788 Example for configuring 1 to 1 VLAN mapping for inter-VLAN communication

Interfaces 1 through 3 in this example are GE 0/1/1, GE 0/1/2, GE 0/1/3, respectively.


Configuration Roadmap

The configuration roadmap is as follows:

  1. Add ports connecting CE1 to residential compound 1 to VLAN 6. Add ports connecting CE2 to residential compound 2 to VLAN 5.
  2. Configure 1 to 1 VLAN mapping on devices at the edge of the ISP network to map user VLAN IDs to the ISP VLAN ID to allow users in different VLANs to communicate with each other.

Data Preparation

To complete the configuration, you need the following data:

  • Number of each port connecting a CE to a user device
  • Number of the ports interconnecting CEs
  • VLAN IDs configured on CEs
  • VLAN ID provided by the ISP

Procedure

  1. Add ports connecting CEs to user devices to specified VLANs.

    # Configure CE1.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE1
    [*HUAWEI] commit
    [~CE1] vlan 6
    [*CE1-vlan6] quit
    [*CE1] interface gigabitethernet 0/1/1
    [*CE1-GigabitEthernet0/1/1] undo shutdown
    [*CE1-GigabitEthernet0/1/1] portswitch
    [*CE1-GigabitEthernet0/1/1] port link-type access
    [*CE1-GigabitEthernet0/1/1] port default vlan 6
    [*CE1-GigabitEthernet0/1/1] quit
    [*CE1] interface gigabitethernet 0/1/2
    [*CE1-GigabitEthernet0/1/2] undo shutdown
    [*CE1-GigabitEthernet0/1/2] portswitch
    [*CE1-GigabitEthernet0/1/2] port link-type access
    [*CE1-GigabitEthernet0/1/2] port default vlan 6
    [*CE1-GigabitEthernet0/1/2] quit
    [*CE1] interface gigabitethernet 0/1/3
    [*CE1-GigabitEthernet0/1/3] undo shutdown
    [*CE1-GigabitEthernet0/1/3] portswitch
    [*CE1-GigabitEthernet0/1/3] port link-type trunk
    [*CE1-GigabitEthernet0/1/3] port trunk allow-pass vlan 6
    [*CE1-GigabitEthernet0/1/3] commit
    [~CE1-GigabitEthernet0/1/3] quit

    # Configure CE2.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE2
    [*HUAWEI] commit
    [~CE2] vlan 5
    [*CE2-vlan5] quit
    [*CE2] interface gigabitethernet 0/1/1
    [*CE2-GigabitEthernet0/1/1] undo shutdown
    [*CE2-GigabitEthernet0/1/1] portswitch
    [*CE2-GigabitEthernet0/1/1] port link-type access
    [*CE2-GigabitEthernet0/1/1] port default vlan 5
    [*CE2-GigabitEthernet0/1/1] quit
    [*CE2] interface gigabitethernet 0/1/2
    [*CE2-GigabitEthernet0/1/2] undo shutdown
    [*CE2-GigabitEthernet0/1/2] portswitch
    [*CE2-GigabitEthernet0/1/2] port link-type access
    [*CE2-GigabitEthernet0/1/2] port default vlan 5
    [*CE2-GigabitEthernet0/1/2] quit
    [*CE2] interface gigabitethernet 0/1/3
    [*CE2-GigabitEthernet0/1/3] undo shutdown
    [*CE2-GigabitEthernet0/1/3] portswitch
    [*CE2-GigabitEthernet0/1/3] port link-type trunk
    [*CE2-GigabitEthernet0/1/3] port trunk allow-pass vlan 5
    [*CE2-GigabitEthernet0/1/3] commit
    [~CE2-GigabitEthernet0/1/3] quit

  2. Configure 1 to 1 VLAN mapping.

    # Configure PE1.

    <HUAWEI> system-view
    [~HUAWEI] sysname PE1
    [*HUAWEI] commit
    [~PE1] vlan 10
    [*PE1-vlan10] quit
    [*PE1] interface gigabitethernet 0/1/1
    [*PE1-GigabitEthernet0/1/1] undo shutdown
    [*PE1-GigabitEthernet0/1/1] portswitch
    [*PE1-GigabitEthernet0/1/1] port link-type trunk
    [*PE1-GigabitEthernet0/1/1] port trunk allow-pass vlan 10
    [*PE1-GigabitEthernet0/1/1] port vlan-mapping vlan 6 map-vlan 10
    [*PE1-GigabitEthernet0/1/1] commit
    [~PE1-GigabitEthernet0/1/1] quit

    # Configure PE2.

    <HUAWEI> system-view
    [~HUAWEI] sysname PE2
    [*HUAWEI] commit
    [~PE2] vlan 10
    [*PE2-vlan10] quit
    [*PE2] interface gigabitethernet 0/1/1
    [*PE2-GigabitEthernet0/1/1] undo shutdown
    [*PE2-GigabitEthernet0/1/1] portswitch
    [*PE2-GigabitEthernet0/1/1] port link-type trunk
    [*PE2-GigabitEthernet0/1/1] port trunk allow-pass vlan 10
    [*PE2-GigabitEthernet0/1/1] port vlan-mapping vlan 5 map-vlan 10
    [*PE2-GigabitEthernet0/1/1] commit
    [~PE2-GigabitEthernet0/1/1] quit

  3. Verify the configuration.

    After completing the configurations, run the display vlan command to check VLAN mapping information. Use the display on PE1 as an example.

    [*PE1] display vlan 10
    * : management-vlan
    ---------------------
    VLAN ID Type         Status   MAC Learning Broadcast/Multicast/Unicast Property
    --------------------------------------------------------------------------------
    10      common       enable   enable       forward   forward   forward default
    ----------------
    QinQ-map  Port: GigabitEthernet0/1/1
    ----------------
    Interface                   Physical
    GigabitEthernet0/1/1        UP
    

    Users in residential compounds 1 and 2 can communicate with each other.

Configuration Files

  • CE1 configuration file

    #
    sysname CE1
    #
    vlan batch 6
    #
    interface GigabitEthernet0/1/1
     undo shutdown
     portswitch
     port link-type access
     port default vlan 6
    #
    interface GigabitEthernet0/1/2
     undo shutdown
     portswitch
     port link-type access
     port default vlan 6
    #
    interface GigabitEthernet0/1/3
     undo shutdown
     portswitch
     port link-type trunk
     port trunk allow-pass vlan 6
    #
    return
  • CE2 configuration file

    #
    sysname CE2
    #
    vlan batch 5
    #
    interface GigabitEthernet0/1/1
     undo shutdown
     portswitch
     port link-type access
     port default vlan 5
    #
    interface GigabitEthernet0/1/2
     undo shutdown
     portswitch
     port link-type access
     port default vlan 5
    #
    interface GigabitEthernet0/1/3
     undo shutdown
     portswitch
     port link-type trunk
     port trunk allow-pass vlan 5
    #
    return
  • Configuration file of PE1

    #
    sysname PE1
    #
    vlan batch 10
    #
    interface GigabitEthernet0/1/1
     undo shutdown
     portswitch
     port link-type trunk
     port trunk allow-pass vlan 10
     port vlan-mapping vlan 6 map-vlan 10
    #
    return
  • Configuration file of PE2

    #
    sysname PE2
    #
    vlan batch 10
    #
    interface GigabitEthernet0/1/1
     undo shutdown
     portswitch
     port link-type trunk
     port trunk allow-pass vlan 10
     port vlan-mapping vlan 5 map-vlan 10
    #
    return

Example for Configuring Communication Between VLANs Through VLAN Aggregation

This part describes how to configure communication between VLANs with fewer IP addresses.

Networking Requirements

Assume that an enterprise has many departments and IP addresses of these departments are on the same network segment, to improve the service security, IP addresses of PCs used by employees in the same department are added to the same VLAN and IP addresses of PCs used by employees in different departments are added to different VLANs. IP addresses of PCs used by employees in different departments need to communicate with each other.

As shown in Figure 1-789, IP addresses of the R&D department and test department belong to different VLANs. It is required that IP addresses of PCs used by employees in different VLANs communicate with each other.

Figure 1-789 Networking diagram of configuring communication between VLANs through VLAN aggregation

Interfaces 1 through 3 in this example are GE 0/1/1, GE 0/1/2, GE 0/1/3, respectively.


IP addresses of the R&D department and test department are on the same network segment. To save IP address resources, you can deploy VLAN aggregation on devices of the R&D department and test department. This ensures that different VLANs can communicate with each other.

Configuration Roadmap

The configuration roadmap is as follows:

  1. Create VLANs on the CEs and determine the VLANs to which users belong.
  2. Configure VLAN aggregation on the PE.

    1. Configure the Layer 2 forwarding function.

    2. Create a super-VLAN and add sub-VLANs to the super-VLAN.

    3. Create the VLANIF interface of the super-VLAN and assign an IP address to the VLANIF interface as the network gateway address.

Data Preparation

To complete the configuration, you need the following data:

  • User VLAN ID
  • User IP address
  • Number of each port connecting a CE to a PC
  • Sub-VLAN ID and super-VLAN ID
  • Number and IP address of the VLANIF interface of the super-VLAN

Procedure

  1. Create a VLAN on CE and add Layer 2 interfaces to the VLAN.

    # Configure CE1.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE1
    [*HUAWEI] commit
    [~CE1] vlan batch 2
    [*CE1] interface gigabitethernet 0/1/1
    [*CE1-GigabitEthernet0/1/1] portswitch
    [*CE1-GigabitEthernet0/1/1] undo shutdown
    [*CE1-GigabitEthernet0/1/1] port link-type access
    [*CE1-GigabitEthernet0/1/1] port default vlan 2
    [*CE1-GigabitEthernet0/1/1] quit
    [*CE1] interface gigabitethernet 0/1/2
    [*CE1-GigabitEthernet0/1/2] portswitch
    [*CE1-GigabitEthernet0/1/2] undo shutdown
    [*CE1-GigabitEthernet0/1/2] port link-type access
    [*CE1-GigabitEthernet0/1/2] port default vlan 2
    [*CE1-GigabitEthernet0/1/2] quit
    [*CE1] interface gigabitethernet 0/1/3
    [*CE1-GigabitEthernet0/1/3] portswitch
    [*CE1-GigabitEthernet0/1/3] undo shutdown
    [*CE1-GigabitEthernet0/1/3] port link-type trunk
    [*CE1-GigabitEthernet0/1/3] port trunk allow-pass vlan 2
    [*CE1-GigabitEthernet0/1/3] quit
    [*CE1] commit

    # Configure CE2.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE2
    [*HUAWEI] commit
    [~CE2] vlan batch 3
    [*CE2] interface gigabitethernet 0/1/1
    [*CE2-GigabitEthernet0/1/1] portswitch
    [*CE2-GigabitEthernet0/1/1] undo shutdown
    [*CE2-GigabitEthernet0/1/1] port link-type access
    [*CE2-GigabitEthernet0/1/1] port default vlan 3
    [*CE2-GigabitEthernet0/1/1] quit
    [*CE2] interface gigabitethernet 0/1/2
    [*CE2-GigabitEthernet0/1/2] portswitch
    [*CE2-GigabitEthernet0/1/2] undo shutdown
    [*CE2-GigabitEthernet0/1/2] port link-type access
    [*CE2-GigabitEthernet0/1/2] port default vlan 3
    [*CE2-GigabitEthernet0/1/2] quit
    [*CE2] interface gigabitethernet 0/1/3
    [*CE2-GigabitEthernet0/1/3] portswitch
    [*CE2-GigabitEthernet0/1/3] undo shutdown
    [*CE2-GigabitEthernet0/1/3] port link-type trunk
    [*CE2-GigabitEthernet0/1/3] port trunk allow-pass vlan 3
    [*CE2-GigabitEthernet0/1/3] quit
    [*CE2] commit

  2. Configure VLAN aggregation on the PE.

    1. Configure the Layer 2 forwarding function.

      <HUAWEI> system-view
      [~HUAWEI] sysname PE
      [*HUAWEI] commit
      [~PE] vlan batch 2 to 4
      [*PE] interface gigabitethernet 0/1/1
      [*PE-GigabitEthernet0/1/1] portswitch
      [*PE-GigabitEthernet0/1/1] undo shutdown
      [*PE-GigabitEthernet0/1/1] port link-type trunk
      [*PE-GigabitEthernet0/1/1] port trunk allow-pass vlan 2
      [*PE-GigabitEthernet0/1/1] quit
      [*PE] interface gigabitethernet 0/1/2
      [*PE-GigabitEthernet0/1/2] portswitch
      [*PE-GigabitEthernet0/1/2] undo shutdown
      [*PE-GigabitEthernet0/1/2] port link-type trunk
      [*PE-GigabitEthernet0/1/2] port trunk allow-pass vlan 3
      [*PE-GigabitEthernet0/1/2] quit
    2. Create a super-VLAN and add sub-VLANs to the super-VLAN.

      [*PE] vlan 4
      [*PE-vlan4] aggregate-vlan
      [*PE-vlan4] access-vlan 2 to 3
      [*PE-vlan4] quit
    3. Create a VLANIF interface for the super-VLAN and assign an IP address to the VLANIF interface.

      [*PE] interface vlanif 4
      [*PE-Vlanif4] ip address 10.1.1.12 24
      [*PE-Vlanif4] commit

      After the preceding configurations, configure IP addresses as shown in Figure 1-789 to PCs. The IP addresses of the PCs and VLANIF interface are on the same network segment. If the configuration succeeds, the PCs used by employees in each VLAN and the corresponding switch can ping each other, whereas the PCs used by employees in VLAN2 and the PCs used by employees in VLAN3 cannot.

  3. Enable inter-VLAN ARP proxy.

    [~PE-vlanif4] arp-proxy inter-sub-vlan-proxy enable
    [*PE-vlanif4] commit
    [~PE-vlanif4] quit

  4. Verify the configuration.

    After the configuration, IP addresses of PCs used by employees in VLAN2 and VLAN3 can ping each other.

Configuration Files

  • CE1 configuration file

    #
     sysname CE1
    #
     vlan batch 2
    #
     interface GigabitEthernet0/1/1
      portswitch
      undo shutdown
      port link-type access
      port default vlan 2
    #
     interface GigabitEthernet0/1/2
      portswitch
      undo shutdown
      port link-type access
      port default vlan 2
    #
     interface GigabitEthernet0/1/3
      portswitch
      undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 2
    #
     return
  • CE2 configuration file

    #
     sysname CE2
    #
     vlan batch 3
    #
     interface GigabitEthernet0/1/1
      portswitch
      undo shutdown
      port link-type access
      port default vlan 3
    #
     interface GigabitEthernet0/1/2
      portswitch
      undo shutdown
      port link-type access
      port default vlan 3
    #
     interface GigabitEthernet0/1/3
      portswitch
      undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 3
    #
    return
  • PE configuration file

    #
     sysname PE
    #
     vlan batch 2 to 4
    #
     vlan 4
      aggregate-vlan
      access-vlan 2 to 3
    #
     interface Vlanif4
      ip address 10.1.1.12 255.255.255.0
      arp-proxy inter-sub-vlan-proxy enable
    #
     interface GigabitEthernet0/1/1
      portswitch
      undo shutdown
      port link-type trunk
      port trunk allow-pass vlan 2
    #
     interface GigabitEthernet0/1/2
      portswitch
      undo shutdown
      port link-type trunk
      port trunk allow-pass vlan 3
    #
     return
Translation
Favorite
Download
Update Date:2024-04-01
Document ID:EDOC1100335691
Views:121882
Downloads:659
Average rating:5.0Points

Digital Signature File

digtal sigature tool