In Layer-2 injection, the cleaning device injects the cleaned traffic to the Zone in Layer 2 mode instead of routing forwarding.
This function is configured on the AntiDDoS.
As shown in Figure 1, the E1/1 interface on the core switch is directly connected to interface GE1/0/1 on the cleaning device. The channel between them is for both traffic diversion and traffic injection. Two VLANs such as VLAN1 and VLAN2 are created on the switch. Two subinterfaces on the cleaning device are associated with VLAN1 and VLAN2 for traffic diversion and injection respectively. Traffic is diverted to the cleaning device for cleaning over VLAN1 of the core switch. After cleaning is complete, the cleaning device requests the MAC address of the Zone by sending an ARP request packet. Then the Zone replies with an ARP reply packet. Subsequently, the cleaning device injects traffic to the Zone based on the MAC address over layer 2.
Layer 2 injection is applicable to the scenario where only the Layer 2 forwarding device exists between the core switch and the Zone.
The VLAN function is configured on the cleaning device to forward injected traffic through the VLAN.
Run the vlan-type dot1q vlan-id command to set the encapsulation type and VLAN ID of the sub-interface.
By default, a sub-interface is not encapsulated with 802.1Q and is not associated with any VLAN.
In Layer-2 injection, if subinterfaces are used for traffic injection, anti-DDoS policies are configured on subinterfaces. If VLANIF interfaces are used for traffic injection, anti-DDoS policies are configured on corresponding physical interfaces.
The following uses Huawei S9300 as an example to describe how to configure the core switch.