< Home

GRE Security

Context

To improve system security, GRE introduces GRE keys to identify individual traffic flows. The GRE key is a 32-bit string with a value range of 0 to 4294967295. It is configured on the transmit end and written into the GRE header of a GRE packet to be sent. After receiving the packet, the receive end decapsulates it and compares the key with the locally configured key. If the keys are the same, a GRE tunnel can then be established. The GRE key can be configured in either ciphertext or cleartext. A ciphertext key is displayed in ciphertext in the configuration file.

GRE also supports the checksum verification of GRE-encapsulated packets. If the checksum is configured on both ends of a GRE tunnel, the local end calculates the checksum based on the GRE header and payload information and sends the packet containing the checksum to the peer end. The peer then calculates the checksum of the received packet and compares it with the checksum in the packet. If the two checksum values match, the packet continues to be processed; otherwise, it is discarded. If the checksum function is enabled only on the local end, the local end does not check the checksum for received packets, but instead calculates a checksum for packets to be sent. If the checksum function is enabled only on the peer end, the local end checks the checksum for received packets but does not calculate a checksum for packets to be sent.

Impact on the System

The security of services carried over GRE tunnels is enhanced.

Procedure

  1. Enter the system view.

    system-view

  2. Create a tunnel interface and enter the tunnel interface view.

    interface tunnel interface-number

  3. Configure the checksum function on each end of a GRE tunnel.

    gre checksum

  4. Configure a GRE key for the tunnel interface.

    gre key { simple key-number-simple | [ cipher ] key-number-cipher }

Checking the Security Hardening Result

Run the display interface tunnel [ interface-number ] command to check the operating status of the tunnel interface.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >