Typical Configuration Case of Huawei AR Router - Ethernet Switching

Table of contents

Eth-Trunk

Example: Configuring Layer 3 Link Aggregation

Networking requirements

Steps

Check configuration results

Placement script

VLAN

Example: Configure interface-based VLAN division to achieve intercommunication within the same VLAN (same device)

Networking requirements

Steps

Check configuration results

Placement script

Example: Configuring a Layer 3 sub-interface to implement communication between different VLANs

Networking requirements

Steps

Check configuration results

Placement script

Example: Configuring a VLANIF interface to implement intercommunication between different VLANs (same device)

Networking requirements

Steps

Check configuration results

Placement script


Eth-Trunk

Example: Configuring Layer 3 Link Aggregation

Networking requirements

As shown in the figure, an Eth-Trunk is created between DeviceA and DeviceB to bind two Layer 3 Ethernet interfaces into one Eth-Trunk interface, which can increase bandwidth and improve reliability.

Note: In this example, interface1 and interface2 represent 10GE0/0/1 and 10GE0/0/2 respectively.

 Figure 1-2 Network diagram for configuring Layer 3 link aggregation

Steps

  1. Create Eth-Trunk1 on DeviceA and DeviceB and configure IP addresses.

    # Configure DeviceA.

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] undo portswitch
    [DeviceA-Eth-Trunk1] ip address 10.1.1.1 24
    

    # Configure DeviceB.

    <HUAWEI> system-view [HUAWEI] sysname DeviceB [DeviceB] interface eth-trunk 1 [DeviceB-Eth-Trunk1] undo portswitch [DeviceB-Eth-Trunk1] ip address 10.1.1.2 24

  2. Add member interfaces to the Eth-Trunk interfaces of DeviceA and DeviceB.

    # Configure DeviceA.

    [DeviceB] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] port link-type trunk
    [DeviceA-Eth-Trunk1] trunkport 10ge 0/0/1 to 0/0/2 
    [DeviceA-Eth-Trunk1] quit
    

    # Configure DeviceB.

    [DeviceB] interface eth-trunk 1
    [DeviceB-Eth-Trunk1] port link-type trunk
    [DeviceB-Eth-Trunk1] trunkport 10ge 0/0/1 to 0/0/2 
    [DeviceB-Eth-Trunk1] quit
    

Check configuration results

# Execute the display interface eth-trunk command in any view to check whether the Eth-Trunk is successfully created and whether the member interfaces are correctly added.

[DeviceA] display interface eth-trunk 1
Eth-Trunk1 current state : UP Line protocol current state : UP 
Description:HUAWEI, AR Series, Eth-Trunk1 Interface 
Route Port,Hash arithmetic : According to SIP-XOR-DIP,The Maximum Transmit Unit 
is 1500 Internet Address is 10.1.1.1/24 
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc12-3456
Current system time: 0000-0-00 00:00:00     
Input bandwidth utilization  : 0.00%     
Output bandwidth utilization : 0.00% 
----------------------------------------------------- 
PortName                Status              Weight 
----------------------------------------------------- 
10GE0/0/1               UP                  1 
10GE0/0/2               UP                  1 
----------------------------------------------------- 
The Number of Ports in Trunk : 2 
The Number of UP Ports in Trunk : 2

# The Eth-Trunk interfaces of DeviceA and DeviceB can ping each other successfully.

[RouterA] ping -a 10.1.1.1 10.1.1.2   
 PING 10.1.1.2: 56  data bytes, press CTRL_C to break     
  Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=31 ms     
  Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=31 ms     
  Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=62 ms     
  Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=62 ms     
  Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=62 ms   
--- 10.1.1.2 ping statistics ---     
  5 packet(s) transmitted     
  5 packet(s) received     
  0.00% packet loss    
  round-trip min/avg/max = 31/49/62 ms

Placement script

  • DeviceA

    #
    sysname DeviceA
    # 
    interface Eth-Trunk1
     ip address 10.1.1.1 255.255.255.0
    # 
    interface 10GE0/0/1 
     eth-trunk 1
    # 
    interface 10GE0/0/2
     eth-trunk 1
    #
    return
  • DeviceB

    #
    sysname DeviceB
    # 
    interface Eth-Trunk1
     ip address 10.1.1.2 255.255.255.0
    # 
    interface 10GE0/0/1 
     eth-trunk 1
    # 
    interface 10GE0/0/2
     eth-trunk 1
    #
    return

VLAN

Example: Configure interface-based VLAN division to achieve intercommunication within the same VLAN (same device)

Networking requirements

As shown in Figure 1-2, assign the interface connecting Host1 and Host2 to VLAN2, and assign the interface connecting Host3 and Host4 to VLAN3, so that hosts in the same VLAN can communicate and hosts in different VLANs cannot communicate directly at Layer 2.

  • Host1 and Host2 can communicate with each other, and Host3 and Host4 can communicate with each other.
  • Host1 and Host3 and Host4 in VLAN3 cannot communicate with each other, and Host2 and Host3 and Host4 in VLAN3 cannot communicate with each other.

Figure 1-2 Networking diagram for dividing VLANs based on interfaces (same device) 

 

Note: In this example, interface1, interface2, interface3, and interface4 represent 10GE0/0/1, 10GE0/0/2, 10GE0/0/3, and 10GE0/0/4 respectively.


Steps

  1. Create a VLAN and configure the interface connecting the device to the host as an Access interface.

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] vlan batch 2 3
    [DeviceA] interface 10ge 0/0/1
    [DeviceA-10GE0/0/1] portswitch
    [DeviceA-10GE0/0/1] port link-type access
    [DeviceA-10GE0/0/1] quit
    [DeviceA] interface 10ge 0/0/2
    [DeviceA-10GE0/0/2] portswitch
    [DeviceA-10GE0/0/2] port link-type access
    [DeviceA-10GE0/0/2] quit
    [DeviceA] interface 10ge 0/0/3
    [DeviceA-10GE0/0/3] portswitch
    [DeviceA-10GE0/0/3] port link-type access
    [DeviceA-10GE0/0/3] quit
    [DeviceA] interface 10ge 0/0/4
    [DeviceA-10GE0/0/4] portswitch
    [DeviceA-10GE0/0/4] port link-type access
    [DeviceA-10GE0/0/4] quit

  2. Configure the interface to join the VLAN.

    # Add 10GE0/0/1 and 10GE0/0/2 to VLAN 2.

    [DeviceA] vlan 2
    [DeviceA-vlan2] port 10ge 0/0/1 to 0/0/2
    [DeviceA-vlan2] quit

    # Add 10GE0/0/3 and 10GE0/0/4 to VLAN 3.

    [DeviceA] vlan 3
    [DeviceA-vlan3] port 10ge 0/0/3 to 0/0/4
    [DeviceA-vlan3] quit

Check configuration results

# Execute the display vlan command to view the VLAN status.

[DeviceA] display vlan
The total number of vlans is : 2
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
MAC-LRN: MAC-address learning;  STAT: Statistic;
BC: Broadcast; MC: Multicast;   UC: Unknown-unicast;
FWD: Forward;  DSD: Discard;
--------------------------------------------------------------------------------

VID          Ports
--------------------------------------------------------------------------------
   2         UT:10GE0/0/1(U)   10GE0/0/2(U)
   3         UT:10GE0/0/3(U)   10GE0/0/4(U)

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

# Hosts in VLAN2 cannot ping hosts in VLAN3, but hosts in the same VLAN can ping each other.

Placement script

#
sysname DeviceA
#
vlan batch 2 to 3
#
interface 10GE0/0/1
 portswitch
 port link-type access
 port default vlan 2
#
interface 10GE0/0/2
 portswitch
 port link-type access
 port default vlan 2
#
interface 10GE0/0/3
 portswitch
 port link-type access
 port default vlan 3
#
interface 10GE0/0/4
 portswitch
 port link-type access
 port default vlan 3
#
return

Example: Configuring a Layer 3 sub-interface to implement communication between different VLANs

Networking requirements

As shown in Figure 1-3, hosts in VLAN2 and VLAN3 are located on different network segments. It is desired to configure a Layer 3 sub-interface on DeviceA to implement communication between hosts in VLAN2 and VLAN3.

Figure 1-3 Networking diagram for intercommunication between different VLANs through Layer 3 sub-interfaces 

 

Note: In this example, interface1, interface2, interface3, and interface4 represent 10GE0/0/1, 10GE0/0/2, 10GE0/0/3, and 10GE0/0/4 respectively.
 

Steps

  1. Create a VLAN on DeviceB.

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceB
    [DeviceB] vlan batch 2 3
    [DeviceB] interface 10ge 0/0/1
    [DeviceB-10GE0/0/1] portswitch
    [DeviceB-10GE0/0/1] port link-type access
    [DeviceB-10GE0/0/1] port default vlan 2
    [DeviceB-10GE0/0/1] quit
    [DeviceB] interface 10ge 0/0/2
    [DeviceB-10GE0/0/2] portswitch
    [DeviceB-10GE0/0/2] port link-type access
    [DeviceB-10GE0/0/2] port default vlan 3
    [DeviceB-10GE0/0/2] quit

  2. Configure interface 10GE0/0/3 on Device B to allow the VLANs that users belong to to pass through.

    [DeviceB] interface 10ge 0/0/3
    [DeviceB-10GE0/0/3] portswitch
    [DeviceB-10GE0/0/3] port link-type trunk
    [DeviceB-10GE0/0/3] port trunk allow-pass vlan 2 3
    [DeviceB-10GE0/0/3] quit

  3. Create a sub-interface on DeviceA and associate it with a VLAN.

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] interface 10ge 0/0/4
    [DeviceA-10GE0/0/4] undo portswitch
    [DeviceA-10GE0/0/4] quit
    [DeviceA] interface 10ge 0/0/4.1
    [DeviceA-10GE0/0/4.1] dot1q termination vid 2 
    [DeviceA-10GE0/0/4.1] quit
    [DeviceA] interface 10ge 0/0/4.2
    [DeviceA-10GE0/0/4.2] dot1q termination vid 3
    [DeviceA-10GE0/0/4.2] quit

  4. Configure an IP address on DeviceA.

    [DeviceA] interface 10ge 0/0/4.1
    [DeviceA-10GE0/0/4.1] ip address 10.10.10.2 24
    [DeviceA-10GE0/0/4.1] quit
    [DeviceA] interface 10ge 0/0/4.2
    [DeviceA-10GE0/0/4.2] ip address 10.10.20.2 24
    [DeviceA-10GE0/0/4.2] quit

Check configuration results

Configure the default gateway on the hosts in VLAN2 to be the IP address 10.10.10.2/24 of interface 10GE0/0/4.1, and configure the default gateway on the hosts in VLAN3 to be the IP address 10.10.20.2/24 of interface 10GE0/0/4.2. After the configuration is complete, hosts in VLAN2 and VLAN3 can ping each other successfully.

Placement script

  • DeviceA
    #
    sysname DeviceA
    #
    interface 10GE0/0/4
    #
    interface 10GE0/0/4.1
     ip address 10.10.10.2 255.255.255.0
     encapsulation dot1q-termination
     dot1q termination vid 2
    #
    interface 10GE0/0/4.2
     ip address 10.10.20.2 255.255.255.0
     encapsulation dot1q-termination
     dot1q termination vid 3
    #
    return
  • DeviceB
    #
    sysname DeviceB
    #
    vlan batch 2 to 3
    #
    interface 10GE0/0/1
     portswitch
     port link-type access
     port default vlan 2
    #
    interface 10GE0/0/2
     portswitch
     port link-type access
     port default vlan 3
    #
    interface 10GE0/0/3
     portswitch
     port link-type trunk
     port trunk allow-pass vlan 2 to 3
    #
    return

Example: Configuring a VLANIF interface to implement intercommunication between different VLANs (same device)

Networking requirements

As shown in Figure 1-4, the hosts under DeviceA are divided into different VLANs, namely VLAN2 and VLAN3, and they are located on different network segments. It is hoped that VLAN2 and VLAN3 can communicate with each other.

Figure 1-4 Network diagram for configuring VLANIF interfaces to implement intercommunication between different VLANs (same device) 

 

Note: In this example, interface1 and interface2 represent 10GE0/0/1 and 10GE0/0/2 respectively.
 

Steps

  1. Create a VLAN and configure interfaces to join the VLAN.

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] vlan batch 2 3
    [DeviceA] interface 10ge 0/0/1
    [DeviceA-10GE0/0/1] portswitch
    [DeviceA-10GE0/0/1] port link-type access
    [DeviceA-10GE0/0/1] port default vlan 2
    [DeviceA-10GE0/0/1] quit
    [DeviceA] interface 10ge 0/0/2
    [DeviceA-10GE0/0/2] portswitch
    [DeviceA-10GE0/0/2] port link-type access
    [DeviceA-10GE0/0/2] port default vlan 3
    [DeviceA-10GE0/0/2] quit

  2. Configure an IP address for the VLANIF interface.

    [DeviceA] interface vlanif 2
    [DeviceA-Vlanif2] ip address 10.10.10.2 24
    [DeviceA-Vlanif2] quit
    [DeviceA] interface vlanif 3
    [DeviceA-Vlanif3] ip address 10.10.20.2 24
    [DeviceA-Vlanif3] quit

Check configuration results

Configure the IP address 10.10.10.1/24 on the host in VLAN2, and configure the default gateway as the IP address 10.10.10.2/24 of interface VLANIF2. Configure the IP address on the host in VLAN3 as 10.10.20.1/24, and the default gateway It is the IP address 10.10.20.2/24 of interface VLANIF3. After the configuration is complete, hosts in VLAN2 and VLAN3 can ping each other successfully.

Placement script

#
sysname DeviceA
#
vlan batch 2 to 3
# 
interface Vlanif2
 ip address 10.10.10.2 255.255.255.0 
# 
interface Vlanif3
 ip address 10.10.20.2 255.255.255.0 
# 
interface 10GE0/0/1
 portswitch
 port link-type access
 port default vlan 2
#
interface 10GE0/0/2
 portswitch
 port link-type access
 port default vlan 3
#
return

Guess you like

Origin blog.csdn.net/yuyeconglong/article/details/132446386