Example for Configuring Traffic Distribution Based on ECMP
Networking Requirements
In the example shown in Figure 10-6, SwitchA, which is a traffic distribution device, is connected to a third-party network probe through XGE2/0/1, and the network probe forwards a copy of traffic to SwitchA through XGE2/0/1.
In this example, the customer requires that traffic from the traffic distribution device be distributed to four packet analysis servers and a bidirectional flow pair be distributed to the same server. The packets are not allowed to be modified during distribution. Only a single fiber is deployed between SwitchA and each packet analysis server. The packet analysis servers receive data but do not send data, ensuring data confidentiality of the server.
Interface |
VLANIF Interface |
IP Address |
---|---|---|
GigabitEthernet 1/0/1 |
VLANIF 10 |
10.1.1.1/24 |
GigabitEthernet 1/0/2 |
VLANIF 20 |
10.1.2.1/24 |
GigabitEthernet 1/0/3 |
VLANIF 30 |
10.1.3.1/24 |
GigabitEthernet 1/0/4 |
VLANIF 40 |
10.1.4.1/24 |
XGigabitEthernet 2/0/1 |
VLANIF 100 |
10.0.0.1/24 |
Configuration Roadmap
Configure IP addresses for the inbound and outbound interfaces of the traffic so that static routes can be configured.
Configure static equal-cost routes to load balance traffic.
Enable distribution of bidirectional flow pairs to the same server and distribute the packets that need to be analyzed to four servers based on ECMP.
Configure the device to ensure data integrity so that packet contents before and after traffic distribution are the same.
Configure unidirectional single-fiber communication to ensure data security on the packet analysis servers.
Procedure
- Create VLANs and add interfaces to the VLANs.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 10 20 30 40 100 [SwitchA] interface vlanif 10 [SwitchA-Vlanif10] ip address 10.1.1.1 24 [SwitchA-Vlanif10] quit [SwitchA] interface vlanif 20 [SwitchA-Vlanif20] ip address 10.1.2.1 24 [SwitchA-Vlanif20] quit [SwitchA] interface vlanif 30 [SwitchA-Vlanif30] ip address 10.1.3.1 24 [SwitchA-Vlanif30] quit [SwitchA] interface vlanif 40 [SwitchA-Vlanif40] ip address 10.1.4.1 24 [SwitchA-Vlanif40] quit [SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] port link-type access [SwitchA-GigabitEthernet1/0/1] port default vlan 10 [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] port link-type access [SwitchA-GigabitEthernet1/0/2] port default vlan 20 [SwitchA-GigabitEthernet1/0/2] quit [SwitchA] interface gigabitethernet 1/0/3 [SwitchA-GigabitEthernet1/0/3] port link-type access [SwitchA-GigabitEthernet1/0/3] port default vlan 30 [SwitchA-GigabitEthernet1/0/3] quit [SwitchA] interface gigabitethernet 1/0/4 [SwitchA-GigabitEthernet1/0/4] port link-type access [SwitchA-GigabitEthernet1/0/4] port default vlan 40 [SwitchA-GigabitEthernet1/0/4] quit
- Assign IP addresses to the interfaces.
# Assign an IP address to VLANIF 100.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] interface xgigabitethernet2/0/1 [SwitchA-XGigabitEthernet2/0/1] port link-type access [SwitchA-XGigabitEthernet2/0/1] port default vlan 100 [SwitchA-XGigabitEthernet2/0/1] quit [SwitchA] interface vlanif 100 [SwitchA-Vlanif100] ip address 10.0.0.1 255.255.255.0 [SwitchA-Vlanif100] quit
# The configurations on other interfaces are the same as the configuration on VLANIF 100. Figure 10-6 shows the IP address configurations.
- Configure static equal-cost routes.
# Configure static equal-cost routes to load balance traffic.
[SwitchA] ip route-static 0.0.0.0 0 vlanif 10 10.1.1.2 [SwitchA] ip route-static 0.0.0.0 0 vlanif 20 10.1.2.2 [SwitchA] ip route-static 0.0.0.0 0 vlanif 30 10.1.3.2 [SwitchA] ip route-static 0.0.0.0 0 vlanif 40 10.1.4.2
- Enable distribution of bidirectional flow pairs to the same server.
# Enable distribution of bidirectional flow pairs to the same server.
[SwitchA] ecmp load-balance diffluence
- Ensure data integrity.
# Configure VLANIF 100 to ignore MAC address check for IP packets during Layer 3 forwarding.
[SwitchA] interface vlanif 100 [SwitchA-Vlanif100] ip forward-mode dstmac-independent [SwitchA-Vlanif100] quit
# Disable the device from replacing the source and destination MAC addresses of IP packets during Layer 3 forwarding.
[SwitchA] ip forwarding mac-unvaried
# Configure the device to retain the original TTL value on XGE2/0/1.
[SwitchA] interface xgigabitethernet2/0/1 [SwitchA-XGigabitEthernet2/0/1] set ttl unvaried [SwitchA-XGigabitEthernet2/0/1] quit
The TTL value retaining function can be configured on only inbound interfaces.
- Configure unidirectional single-fiber communication.
# Configure unidirectional single-fiber communication on GE interfaces connected to packet analysis servers.
[SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] undo negotiation auto [SwitchA-GigabitEthernet1/0/1] single-fiber enable [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] undo negotiation auto [SwitchA-GigabitEthernet1/0/2] single-fiber enable [SwitchA-GigabitEthernet1/0/2] quit [SwitchA] interface gigabitethernet 1/0/3 [SwitchA-GigabitEthernet1/0/3] undo negotiation auto [SwitchA-GigabitEthernet1/0/3] single-fiber enable [SwitchA-GigabitEthernet1/0/3] quit [SwitchA] interface gigabitethernet 1/0/4 [SwitchA-GigabitEthernet1/0/4] undo negotiation auto [SwitchA-GigabitEthernet1/0/4] single-fiber enable [SwitchA-GigabitEthernet1/0/4] quit
Configuration File
SwitchA configuration file
#
sysname SwitchA
#
vlan batch 10 20 30 40 100
#
ip forwarding mac-unvaried
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface Vlanif20
ip address 10.1.2.1 255.255.255.0
#
interface Vlanif30
ip address 10.1.3.1 255.255.255.0
#
interface Vlanif40
ip address 10.1.4.1 255.255.255.0
#
interface Vlanif100
ip address 10.0.0.1 255.255.255.0
ip forward-mode dstmac-independent
#
interface GigabitEthernet1/0/1
undo negotiation auto
port link-type access
port default vlan 10
single-fiber enable
#
interface GigabitEthernet1/0/2
undo negotiation auto
port link-type access
port default vlan 20
single-fiber enable
#
interface GigabitEthernet1/0/3
undo negotiation auto
port link-type access
port default vlan 30
single-fiber enable
#
interface GigabitEthernet1/0/4
undo negotiation auto
port link-type access
port default vlan 40
single-fiber enable
#
interface XGigabitEthernet2/0/1
port link-type access
port default vlan 100
set ttl unvaried
#
ip route-static 0.0.0.0 0.0.0.0 Vlanif10 10.1.1.2
ip route-static 0.0.0.0 0.0.0.0 Vlanif20 10.1.2.2
ip route-static 0.0.0.0 0.0.0.0 Vlanif30 10.1.3.2
ip route-static 0.0.0.0 0.0.0.0 Vlanif40 10.1.4.2
#
ecmp load-balance diffluence
#
return