The gre key command sets the key number of a GRE tunnel.
The undo gre key command deletes this configuration.
| Parameter | Description | Value |
|---|---|---|
| key-number | Indicates the text used for authentication. | The value is a string of case-sensitive characters that can be letters or digits. The authentication password can be a string of 0 to 4294967295 integer in simple text or a string of 32 to 48 characters in ciphertext. |
| cipher key-number | Indicates the ciphertext used for authentication. | The value is a string of case-sensitive characters that can be letters or digits. The authentication password can be a string of 0 to 4294967295 integer in simple text or a string of 32 to 48 characters in ciphertext. |
| plain key-number | Indicates the simple text used for authentication. NOTE:
When configuring an authentication password, select the
ciphertext mode because the password is saved in the configuration
file as a simple text if you select the simple text mode, which has
a high risk. To ensure device security, change the password periodically. |
The value is a string of case-sensitive characters
that can be letters or digits. The configured text will be stored
as unencrypted text and displayed as un-encrypted text. The value is a
string of case-sensitive characters ranging from 0 to 4294967295. NOTE:
If a password contains a space, the password must be placed
into a pair of double quotation marks. Only one pair of double quotation
marks can be used for each user name. |
By default, the GRE key number is not configured.
This command takes effect only on a GRE tunnel interface.
If the gre key command is configured, the source and destination ends authenticate the key number of the GRE tunnel. Packets can be successfully transmitted only when the key numbers are completely the same. Therefore, you must set the same key number on the source end and the destination end, or you can set no key number for both ends.
# Configure the GRE key number on both ends of the tunnel between sysnameA and sysnameB.
<sysnameA> system-view [sysnameA] interface tunnel 0 [sysnameA-Tunnel0] tunnel-protocol gre [sysnameA-Tunnel0] gre key cipher 123 <sysnameB> system-view [sysnameB] interface tunnel 1 [sysnameB-Tunnel1] tunnel-protocol gre [sysnameB-Tunnel1] gre key cipher 123