AR100, AR120, AR150, AR160, AR200, AR1200, AR2200, AR3200, and AR3600 V200R010 CLI-based Configuration Guide - Ethernet Switching

This document describes how to configure the components for LAN services, including link aggregation groups, VLANs, voice VLANs, MAC address tables, transparent bridging, as well as GVRP, STP/RSTP, and MSTP protocols.

Example for Configuring Dot1q Termination Sub-interfaces to Implement Inter-VLAN Communication

Example for Configuring Dot1q Termination Sub-interfaces to Implement Inter-VLAN Communication

Networking Requirements

‏‏An enterprise's departments are located on different network segments and use the same services such as Internet access and VoIP. To allow the departments in different VLANs to use the same service, inter-VLAN communication must be implemented.

In the networking example shown in Figure 6-7, both department 1 and department 2 located in different VLANs and network segments need to use the Internet access service, and users in department 1 and department 2 need to communicate with each other.

Figure 6-7  Networking for configuring Dot1q termination sub-interfaces to implement inter-VLAN communication

Configuration Roadmap

The configuration roadmap is as follows.

  1. Configure the ID of the VLAN to which each interface belongs.

  2. Configure Dot1q termination sub-interfaces.

  3. Assign IP addresses to the sub-interfaces.

Procedure

  1. Configure VLANs on interfaces of RouterA and RouterB.

    # Add the uplink interface of RouterA to VLAN 10 in tagged mode and user-side interface to VLAN 10 in untagged mode.

    <Huawei> system-view
    [Huawei] sysname RouterA
    [RouterA] vlan batch 10
    [RouterA] interface ethernet 2/0/1
    [RouterA-Ethernet2/0/1] port link-type access
    [RouterA-Ethernet2/0/1] port default vlan 10
    [RouterA-Ethernet2/0/1] quit
    [RouterA] interface ethernet 2/0/2
    [RouterA-Ethernet2/0/2] port link-type trunk
    [RouterA-Ethernet2/0/2] port trunk allow-pass vlan 10
    [RouterA-Ethernet2/0/2] quit
    

    # Add the uplink interface of RouterB to VLAN 20 in tagged mode and user-side interface to VLAN 20 in untagged mode.

    <Huawei> system-view
    [Huawei] sysname RouterB
    [RouterB] vlan batch 20
    [RouterB] interface ethernet 2/0/1
    [RouterB-Ethernet2/0/1] port link-type access
    [RouterB-Ethernet2/0/1] port default vlan 20
    [RouterB-Ethernet2/0/1] quit
    [RouterB] interface ethernet2/0/2
    [RouterB-Ethernet2/0/2] port link-type trunk
    [RouterB-Ethernet2/0/2] port trunk allow-pass vlan 20
    [RouterB-Ethernet2/0/2] quit
    

  2. Configure the interface on the Router connected to RouterA.

    # Create and configure Ethernet sub-interface GE1/0/0.1.

    <Huawei> system-view
    [Huawei] sysname Router
    [Router] interface gigabitEthernet 1/0/0.1
    [Router-GigabitEthernet1/0/0.1] dot1q termination vid 10
    [Router-GigabitEthernet1/0/0.1] ip address 10.10.10.1 24
    [Router-GigabitEthernet1/0/0.1] arp broadcast enable
    [Router-GigabitEthernet1/0/0.1] quit
    

  3. Configure the interface on the Router connected to RouterB.

    # Create and configure Ethernet sub-interface GE2/0/0.1.

    [Router] interface gigabitEthernet 2/0/0.1
    [Router-GigabitEthernet2/0/0.1] dot1q termination vid 20
    [Router-GigabitEthernet2/0/0.1] ip address 10.10.20.1 24
    [Router-GigabitEthernet2/0/0.1] arp broadcast enable
    [Router-GigabitEthernet2/0/0.1] quit
    

  4. Verify the configuration.

    # On PC1 in VLAN 10, set the IP address (10.10.10.1/24) of GE1/0/0.1 as the default gateway address.

    # On PC2 in VLAN 20, set the IP address (10.10.20.1/24) of GE2/0/0.1 as the default gateway address.

    After the configuration is complete, PC1 in VLAN 10 and PC2 in VLAN 20 can communicate with each other.

Configuration Files

  • Configuration file of the Router
    #
    sysname Router
    #
    interface GigabitEthernet1/0/0.1
     dot1q termination vid 10
     ip address 10.10.10.1 255.255.255.0
     arp broadcast enable
    #
    interface GigabitEthernet2/0/0.1
     dot1q termination vid 20
     ip address 10.10.20.1 255.255.255.0
     arp broadcast enable
    #
    return
    
  • Configuration file of the RouterA
    #
    sysname RouterA
    #
    vlan batch 10
    #
    interface Ethernet2/0/1
     port link-type access
     port default vlan 10
    #
    interface Ethernet2/0/2
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    return
    
  • Configuration file of the RouterB
    #
    sysname RouterB
    #
    vlan batch 20
    #
    interface Ethernet2/0/1
     port link-type access
     port default vlan 20
    #
    interface Ethernet2/0/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    return