01-06 MAC Swap Loopback Configuration
01-06 MAC Swap Loopback Configuration
Description
MAC swap loopback is a technique which modifies the header of a received
Ethernet frame by swapping the source and destination MAC addresses so that the
frame can be returned to the sender. This function effectively checks Ethernet
connectivity and network performance.
Purpose
MAC swap loopback is used for checking Ethernet network connectivity and
performance. It can be used with a network performance test tool to assess the
connectivity, throughput, and QoS of an Ethernet network.
MAC swap loopback tests can only be performed on Ethernet frames with IP
payloads.
Tester
still be forwarded on the interface. However, if a large number of test packets are
sent, test packets occupy bandwidth of other services on the interface.
Tester
Licensing Requirements
MAC swap loopback is a basic feature of a switch and is not under license control.
Version Requirements
S5710-C-LI V200R001C00
NOTE
For details about software mappings, visit Hardware Query Tool and search for the desired
product model.
Feature Limitations
● The MAC swap loopback test cannot be used with the ACL (including the ACL
used in CAR, traffic statistics, and 802.1p priority re-marking) that matches
the source and destination MAC addresses of loopback test packets.
● After ALS is configured on the S6700EI, MAC swap loopback becomes
ineffective. When MAC swap loopback needs to be configured on the S6700EI,
do not configure ALS.
Pre-configuration Tasks
A local MAC swap loopback test checks Ethernet connectivity and network
performance.
Before configuring local MAC swap loopback, complete the following tasks:
● Create a VLAN and add the interface where you want to perform the remote
MAC swap loopback test to the VLAN.
● Configure QoS CAR if you want to test QoS on the network (see Traffic
Policing, Traffic Shaping, and Interface-based Rate Limiting Configuration in
the S2720, S5700, and S6720 V200R013C00 Configuration Guide - QoS).
NOTE
The MAC swap loopback test cannot be used with the ACL (including the ACL used in
CAR, traffic statistics, and 802.1p priority re-marking) that matches the source and
destination MAC addresses of loopback test packets.
Context
Before performing a local MAC swap loopback test, configure the source MAC
address, destination MAC address, and VLAN ID of test packets on the Switch.
Only the packets with the specified source MAC address, destination MAC address,
and VLAN ID are looped back.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run loopback local swap-mac source-mac source-mac-address dest-mac dest-
mac-address vlan vlan-id [ inner-vlan inner-vlan-id ] interface interface-type
interface-number [ timeout { time-value | none } ]
NOTE
Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support the inner-
vlan inner-vlan-id parameter.
QinQ and MAC swap loopback can be used simultaneously on a loopback interface of the
S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI. If a loopback interface joins a
VLAN in untagged mode, packets sent from the loopback interface do not carry tags. If a
loopback interface joins a VLAN in tagged mode, packets sent from the loopback interface
carry tags.
----End
Context
A loopback test causes network performance to deteriorate. If a large number of
test packets are sent, bandwidth of other services is occupied. To ensure
satisfactory network performance, enable the MAC swap loopback function only
when the loopback test begins and disable it immediately after the loopback test
is complete.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run loopback swap-mac start
The MAC swap loopback function is enabled.
The loopback swap-mac start command is a one-time command and is not
saved in the configuration file.
To ensure service provisioning on the interface, run the loopback swap-mac stop
command to disable the MAC swap loopback function immediately after the test
is complete.
----End
Context
A loopback test causes network performance to deteriorate. If a large number of
test packets are sent, bandwidth of other services is occupied. You are advised to
disable the MAC swap loopback function immediately after the test is complete.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run loopback swap-mac stop
The MAC swap loopback function is disabled.
The loopback swap-mac stop command is a one-time command and is not saved
in the configuration file.
A MAC swap loopback test stops when you disable the MAC swap loopback
function or the loopback test times out. To perform the loopback test again, run
the loopback swap-mac start command.
----End
Procedure
● Run the display loopback swap-mac information command to verify the
MAC swap loopback configuration.
----End
Pre-configuration Tasks
A remote MAC swap loopback test checks Ethernet connectivity and network
performance.
Before configuring remote MAC swap loopback, complete the following tasks:
● Create a VLAN and add the interface where you want to perform the remote
MAC swap loopback test to the VLAN.
● Configure VLAN mapping or VLAN stacking if you want to test VLAN mapping
or VLAN stacking.
Context
Before performing a remote MAC swap loopback test, configure the source MAC
address, destination MAC address, and VLAN ID of test packets on the Switch.
Only the packets with the specified source MAC address, destination MAC address,
and VLAN ID are looped back.
A remote MAC swap loopback test modifies only Ethernet frames matching the
MAC swap loopback configuration on an interface, and other Ethernet frames can
still be forwarded on the interface. However, if a large number of test packets are
sent, test packets occupy bandwidth of other services on the interface.
Procedure
Step 1 Run system-view
Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support the inner-
vlan inner-vlan-id parameter.
QinQ and MAC swap loopback can be used simultaneously on a loopback interface of the
S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI. If a loopback interface joins a
VLAN in untagged mode, packets sent from the loopback interface do not carry tags. If a
loopback interface joins a VLAN in tagged mode, packets sent from the loopback interface
carry tags.
----End
Context
A loopback test causes network performance to deteriorate. If a large number of
test packets are sent, bandwidth of other services is occupied. To ensure
satisfactory network performance, enable the MAC swap loopback function only
when the loopback test begins and disable it immediately after the loopback test
is complete.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run loopback swap-mac start
The MAC swap loopback function is enabled.
The loopback swap-mac start command is a one-time command and is not
saved in the configuration file.
To ensure service provisioning on the interface, run the loopback swap-mac stop
command to disable the MAC swap loopback function immediately after the test
is complete.
----End
Context
A loopback test causes network performance to deteriorate. If a large number of
test packets are sent, bandwidth of other services is occupied. You are advised to
disable the MAC swap loopback function immediately after the test is complete.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run loopback swap-mac stop
The MAC swap loopback function is disabled.
The loopback swap-mac stop command is a one-time command and is not saved
in the configuration file.
A MAC swap loopback test stops when you disable the MAC swap loopback
function or the loopback test times out. To perform the loopback test again, run
the loopback swap-mac start command.
----End
Procedure
● Run the display loopback swap-mac information command to verify the
MAC swap loopback configuration.
----End
Networking Requirements
On SwitchB, GE0/0/1 connects to an Ethernet network and GE0/0/2 connects to
users. A local MAC swap loopback test needs to be performed to test connectivity
and performance of the Ethernet network. The local MAC swap loopback test
checks performance of SwitchB.
Tester
GE0/0/1 GE0/0/2
Ethernet
Users
SwitchA SwitchB
Configuration Roadmap
The configuration roadmap is as follows:
1. Create a VLAN and add GE0/0/1 and GE0/0/2 to the VLAN.
2. Configure local MAC swap loopback on SwitchB.
3. Enable the MAC swap loopback function on SwitchB to detect network
connectivity and network quality.
Procedure
Step 1 Create VLAN 100 on SwitchB, configure GE0/0/1 as a trunk interface and GE0/0/2
as a hybrid interface, and add the interfaces to VLAN 100.
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 100
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
Step 2 Configure local MAC swap loopback on GE0/0/2 of SwitchB and specify GE0/0/1
as the outbound interface of loopback Ethernet frames. Enable the MAC swap
loopback function.
[SwitchB-GigabitEthernet0/0/2] loopback local swap-mac source-mac 0018-2000-0085 dest-mac
018-2000-0070 vlan 100 interface gigabitethernet 0/0/1 timeout 80
[SwitchB-GigabitEthernet0/0/2] loopback swap-mac start
[SwitchB-GigabitEthernet0/0/2] quit
----End
Configuration Files
● SwitchB configuration file
#
sysname SwitchB
#
vlan batch 100
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
loopback local swap-mac source-mac 0018-2000-0085 dest-mac 0018-2000-0070 vlan 100 interface
GigabitEthernet0/0/1 timeout 80
#
return
Networking Requirements
GE0/0/1 on SwitchB connects to an Ethernet network. A remote MAC swap
loopback test needs to be performed to test connectivity and performance of the
Ethernet network. The remote MAC swap loopback test does not check
performance of SwitchB.
Tester
GE0/0/1
Ethernet
Users
SwitchA SwitchB
Configuration Roadmap
The configuration roadmap is as follows:
1. Create a VLAN and add GE0/0/1 to the VLAN.
2. Configure remote MAC swap loopback on SwitchB.
3. Enable the MAC swap loopback function on SwitchB to detect network
connectivity and network quality.
Procedure
Step 1 Create VLAN 100 on SwitchB, configure GE0/0/1 as a trunk interface, and add
GE0/0/1 to VLAN 100.
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 100
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
Step 2 Configure remote MAC swap loopback on GE0/0/1 of SwitchB and enable the
MAC swap loopback function.
[SwitchB-GigabitEthernet0/0/1] loopback remote swap-mac source-mac 0018-2000-0085 dest-mac
018-2000-0070 vlan 100 timeout 80
[SwitchB-GigabitEthernet0/0/1] loopback swap-mac start
[SwitchB-GigabitEthernet0/0/1] quit
----End
Configuration Files
● SwitchB configuration file
#
sysname SwitchB
#
vlan batch 100
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
loopback remote swap-mac source-mac 0018-2000-0085 dest-mac 0018-2000-0070 vlan 100
timeout 80
#
return