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

S1720, S2700, S5700, and S6720 V200R012(C00 and C20)

This document describes the configuration of Ethernet services, including configuring MAC address table, link aggregation, VLANs, VLAN aggregation, MUX VLAN, VLAN termination, Voice VLAN, VLAN mapping, QinQ, GVRP, VCMP, STP/RSTP/MSTP, VBST, SEP, RRPP, ERPS, LBDT, and Layer 2 protocol transparent transmission.
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 need to access the Internet through the Switch and still 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 GE0/0/1 and GE0/0/2 to VLAN 10 and GE0/0/3 to VLAN 20.

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

  2. Configure VLANIF interfaces.

    # Create VLANIF 10 and configure a primary IP address of 10.1.1.1/24 and a secondary IP address of 10.1.2.1/24 for VLANIF 10. Create VLANIF 20 and configure an 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 then configure OSPF to advertise both the 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. Specify an IP address for VLANIF 20 on the same network segment as 10.10.10.1.
    • Configure basic OSPF functions and then configure OSPF to advertise the network segment between the Switch and router.

    For details, see the router documentation.

  4. Verify the configuration.

    Configure Host1 with an IP address of 10.1.1.2 and a default gateway address of 10.1.1.1/24 (primary IP address of VLANIF 10).

    Configure Host2 with an IP address of 10.1.2.2 and a default gateway address of 10.1.2.1/24 (secondary IP address of VLANIF 10).

    After the configuration is complete, Host1 and Host2 can ping each other. They can also access the Internet though the IP address of the router interface connected to the Switch (10.10.10.2/24).

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 GigabitEthernet0/0/1
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 10
# 
interface GigabitEthernet0/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: 2018-12-24

Document ID: EDOC1100038339

Views: 155898

Downloads: 674

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