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

Configuration Guide - Ethernet Switching

S7700 and S9700 V200R011C10

This document describes the configuration of Ethernet services, including configuring link aggregation, VLANs, Voice VLAN, VLAN mapping, QinQ, GVRP, MAC table, STP/RSTP/MSTP, SEP, and so on.
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 4-32, 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 Switch and communicate.

Figure 4-32  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 Switch, only hosts on one network segment can access the Internet through the Switch. To enable all hosts on the LAN to access the Internet through the Switch, 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 Switch.

Procedure

  1. Create VLANs and add interfaces to the VLANs.

    # Create VLAN 10 and VLAN 20.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] vlan batch 10 20
    

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

    [Switch] interface gigabitethernet 1/0/1
    [Switch-GigabitEthernet1/0/1] port link-type access
    [Switch-GigabitEthernet1/0/1] port default vlan 10
    [Switch-GigabitEthernet1/0/1] quit
    [Switch] interface gigabitethernet 1/0/2
    [Switch-GigabitEthernet1/0/2] port link-type access
    [Switch-GigabitEthernet1/0/2] port default vlan 10
    [Switch-GigabitEthernet1/0/2] quit
    [Switch] interface gigabitethernet 1/0/3
    [Switch-GigabitEthernet1/0/3] port link-type trunk
    [Switch-GigabitEthernet1/0/3] port trunk allow-pass vlan 20
    [Switch-GigabitEthernet1/0/3] quit
    

  2. Configure VLANIF interfaces.

    # 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.

    [Switch] interface vlanif 10
    [Switch-Vlanif10] ip address 10.1.1.1 24
    [Switch-Vlanif10] ip address 10.1.2.1 24 sub
    [Switch-Vlanif10] quit
    [Switch] interface vlanif 20
    [Switch-Vlanif20] ip address 10.10.10.1 24
    [Switch-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 Switch and router.

    [Switch] ospf
    [Switch-ospf-1] area 0
    [Switch-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
    [Switch-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
    [Switch-ospf-1-area-0.0.0.0] network 10.10.10.0 0.0.0.255
    [Switch-ospf-1-area-0.0.0.0] quit
    [Switch-ospf-1] quit
    
    NOTE:
    Perform the following configurations on the router:
    • Add the interface connected to the Switch 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 Switch and router.

    For details, see the router documentation.

  4. Verify the configuration.

    Configure the IP address of 10.1.1.2/24 and default gateway address of 10.1.1.1 (primary IP address of VLANIF 10) for Host1; configure the IP address of 10.1.2.2/24 and default gateway address of 10.1.2.1 (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 Switch. That is, they can access the Internet.

Configuration Files

Switch configuration file

#
sysname Switch
#
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 GigabitEthernet1/0/1
 port link-type access
 port default vlan 10
#
interface GigabitEthernet1/0/2
 port link-type access
 port default vlan 10
# 
interface GigabitEthernet1/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
Translation
Download
Updated: 2019-10-18

Document ID: EDOC1000178310

Views: 287694

Downloads: 141

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