Example for Configuring Traffic Distribution Based on Multi-Trunk
Networking Requirements
In the example shown in Figure 10-7, SwitchA 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 for processing, only UDP packets with destination port 10000 be analyzed, and a bidirectional flow pair be distributed to the same server. Only a single fiber is deployed between SwitchA and each packet analysis server, and the packet analysis servers receive data but do not send data, ensuring data confidentiality on the servers.
Configuration Roadmap
Configure Eth-Trunks and set the load balancing mode to distribute packets to four servers.
Configure a traffic policy and apply the traffic policy to the inbound interface connected to the network probe, so that packets to be analyzed are classified and redirected to the Eth-Trunk.
Configure unidirectional single-fiber communication to ensure data security on the packet analysis servers.
Procedure
- Create Eth-Trunks, add member interfaces to the Eth-Trunks, and set the load balancing mode.
# Create Eth-Trunk1, and add GE 1/0/1 and GE 1/0/2 to Eth-Trunk1.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] interface eth-trunk 1 [SwitchA-Eth-Trunk1] trunkport gigabitethernet 1/0/1 to 1/0/2 [SwitchA-Eth-Trunk1] quit
# Create Eth-Trunk2, and add GE 3/0/1 and GE 1/0/4 to Eth-Trunk2.
[SwitchA] interface eth-trunk 2 [SwitchA-Eth-Trunk2] trunkport gigabitethernet 1/0/3 to 1/0/4 [SwitchA-Eth-Trunk2] quit
# Configure ECMP-based load balancing.
[SwitchA] ecmp load-balance diffluence
- Configure a traffic policy to redirect the UDP packets with the destination port 10000 to Eth-Trunk1 and Eth-Trunk2.
# Create ACL 3000 to match the UDP packets with the destination port 10000.
[SwitchA] acl 3000 [SwitchA-acl-adv-3000] rule 5 permit udp destination-port eq 10000 [SwitchA-acl-adv-3000] quit
# Define the traffic classifier test and configure ACL 3000.
[SwitchA] traffic classifier test [SwitchA-classifier-test] if-match acl 3000 [SwitchA-classifier-test] quit
# Define the traffic behavior test and set the traffic action to redirection.
[SwitchA] traffic behavior test [SwitchA-behavior-test] redirect multi-trunk eth-trunk 1 eth-trunk 2 [SwitchA-behavior-test] quit
# Define the traffic policy test and bind the traffic policy to the traffic classifier and the traffic behavior.
[SwitchA] traffic policy test [SwitchA-trafficpolicy-test] classifier test behavior test [SwitchA-trafficpolicy-test] quit
# Apply the traffic policy to the inbound interface.
[SwitchA] interface xgigabitethernet 2/0/1 [SwitchA-XGigabitEthernet2/0/1] traffic-policy test inbound [SwitchA-XGigabitEthernet2/0/1] quit
- 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 Files
SwitchA configuration file
#
sysname SwitchA
#
acl number 3000
rule 5 permit udp destination-port eq 10000
#
traffic classifier test operator or precedence 5
if-match acl 3000
#
traffic behavior test
permit
redirect multi-trunk eth-trunk 1 eth-trunk 2
#
traffic policy test match-order config
classifier test behavior test
#
interface Eth-Trunk1
#
interface Eth-Trunk2
#
interface GigabitEthernet1/0/1
undo negotiation auto
single-fiber enable
eth-trunk 1
#
interface GigabitEthernet1/0/2
undo negotiation auto
single-fiber enable
eth-trunk 1
#
interface GigabitEthernet1/0/3
undo negotiation auto
single-fiber enable
eth-trunk 2
#
interface GigabitEthernet1/0/4
undo negotiation auto
single-fiber enable
eth-trunk 2
#
interface XGigabitEthernet2/0/1
traffic-policy test inbound
#
ecmp load-balance diffluence
#
return