No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CLI-based Configuration Guide - Ethernet Switching

AR650, AR1600, and AR6100 V300R003

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.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Example for Configuring VLANIF Interfaces to Implement Communication of Hosts on Different Network Segments in the Same VLAN

Example for Configuring VLANIF Interfaces to Implement Communication of Hosts on Different Network Segments in the Same VLAN

Networking Requirements

On the enterprise network shown in Figure 3-22, hosts in the same VLAN belong to network segments of 10.1.1.1/24 and 10.1.2.1/24. Hosts on the two network segments are required to access the Internet through the Router and communicate.

Figure 3-22  Configuring VLANIF interfaces to implement communication of hosts on different network segments in the same VLAN

Configuration Roadmap

If only one IP address is configured for the VLANIF interface on the Router, only hosts on one network segment can access the Internet through the Router. To enable all hosts on the LAN can access the Internet through the Router, configure a secondary IP address for the VLANIF interface. To enable hosts on the two network segments to communicate, the hosts on the two network segments need to use the primary and secondary IP addresses of the VLANIF interface as default gateway addresses.

The configuration roadmap is as follows:

  1. Create VLANs and add interfaces to the VLANs.

  2. Configure VLANIF interfaces and assign IP addresses to them so that hosts on the two network segments can communicate.

  3. Configure a routing protocol so that hosts can access the Internet through the Router.

Procedure

  1. Create VLANs and add interfaces to the VLANs on Router.

    # Create VLAN 10 and VLAN 20.

    <Huawei> system-view
    [Huawei] sysname Router
    [Router] vlan batch 10 20
    

    # Add Eth2/0/1 and Eth2/0/2 to VLAN 10 and Eth2/0/3 to VLAN 20.

    [Router] interface ethernet 2/0/1
    [Router-Ethernet2/0/1] port link-type access
    [Router-Ethernet2/0/1] port default vlan 10
    [Router-Ethernet2/0/1] quit
    [Router] interface ethernet 2/0/2
    [Router-Ethernet2/0/2] port link-type access
    [Router-Ethernet2/0/2] port default vlan 10
    [Router-Ethernet2/0/2] quit
    [Router] interface ethernet 2/0/3
    [Router-Ethernet2/0/3] port link-type trunk
    [Router-Ethernet2/0/3] port trunk allow-pass vlan 20
    [Router-Ethernet2/0/3] quit
    

  2. Configure VLANIF interfaces on Router.

    # Create VLANIF 10 and configure the primary IP address of 10.1.1.1/24 and secondary IP address of 10.1.2.1/24 for VLANIF 10, and create VLANIF 20 and configure the IP address of 10.10.10.1/24 for VLANIF 20.

    [Router] interface vlanif 10
    [Router-Vlanif10] ip address 10.1.1.1 24
    [Router-Vlanif10] ip address 10.1.2.1 24 sub
    [Router-Vlanif10] quit
    [Router] interface vlanif 20
    [Router-Vlanif20] ip address 10.10.10.1 24
    [Router-Vlanif20] quit
    

  3. Configure a routing protocol.

    # Configure basic OSPF functions and configure OSPF to advertise network segments of hosts and the network segment between the Router and Router_1.

    [Router] ospf
    [Router-ospf-1] area 0
    [Router-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
    [Router-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
    [Router-ospf-1-area-0.0.0.0] network 10.10.10.0 0.0.0.255
    [Router-ospf-1-area-0.0.0.0] quit
    [Router-ospf-1] quit
    
    NOTE:
    Perform the following configurations on the Router_1:
    • Add the interface connected to the Router to VLAN 20 in tagged mode and specify an IP address for VLANIF 20 on the same network segment as 10.10.10.1.
    • Configure basic OSPF functions and configure OSPF to advertise the network segment between the Router and Router_1.

    For details, see the router documentation.

  4. Verify the configuration.

    # Configure the IP address of 10.1.1.2 and default gateway address of 10.1.1.1/24 (primary IP address of VLANIF 10) for Host1; configure the IP address of 10.1.2.2 and default gateway address of 10.1.2.1/24 (secondary IP address of VLANIF 10) for Host2.

    # After the configuration is complete, Host1 and Host2 can ping each other successfully, and they can ping 10.10.10.2/24, IP address of the router interface connected to the Router. That is, they can access the Internet.

Configuration Files

Router configuration file

#
sysname Router
#
vlan batch 10 20
#
interface Vlanif10
 ip address 10.1.1.1 255.255.255.0
 ip address 10.1.2.1 255.255.255.0 sub
#
interface Vlanif20
 ip address 10.10.10.1 255.255.255.0
#
interface Ethernet2/0/1
 port link-type access
 port default vlan 10
#
interface Ethernet2/0/2
 port link-type access
 port default vlan 10
# 
interface Ethernet2/0/3
 port link-type trunk
 port trunk allow-pass vlan 20
#
ospf 1
 area 0.0.0.0
  network 10.1.1.0 0.0.0.255
  network 10.1.2.0 0.0.0.255
  network 10.10.10.0 0.0.0.255
#
return
Download
Updated: 2019-04-12

Document ID: EDOC1100041791

Views: 59101

Downloads: 40

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next