The ipsec fragmentation before-encryption command sets the fragmentation mode of packets to fragmentation before encryption for all IPSec tunnels.
The undo ipsec fragmentation before-encryption command restores the default packet fragmentation mode.
By default, the packet fragmentation mode for all IPSec tunnels is fragmentation after encryption.
Usage Scenario
Fragmentation before encryption: Before encapsulation, the encryption device calculates the predicted encapsulated packet length. If the packet length is larger than the MTU of the outbound interface, the encryption device fragments packets, and then encrypts the packets. In this situation, the decryption device requests the terminal to reassemble the packets, reducing the CPU usage on the decryption device.
Fragmentation after encryption: If the size of the encapsulated VPN packets exceeds the MTU of the outbound interface, the encryption device fragments the packets based on the MTU of the outbound interface. In this case, the peer decryption device assembles and decrypts VPN fragments and then sends decrypted packets to the terminal host.
The fragmentation before encryption mode can be configured globally or on an IPSec tunnel. The packet fragmentation mode configured globally is valid for all IPSec tunnels.
Precautions
Before IPSec packets can be fragmented, the ipsec df-bit command must be configured to permit IPSec packet fragmentation.
If the fragmentation command has been executed to configure a packet fragmentation mode for a specified IPSec tunnel, the IPSec tunnel uses the configured packet fragmentation mode.
In transport mode, fragmentation before encryption is not supported.
For the established IPSec tunnels, you need to restart them after running this command. Otherwise, the command function does not take effect.