The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This module describes the commands used to configure generic routing encapsulation (GRE).
For detailed information about GRE concepts, configuration tasks, and examples, refer to the Cisco ASR 9000 Series Aggregation Services Router MPLS Layer 3 VPN Configuration Guide.
To set the tunnel interface bandwidth, use the bandwidth command in interface configuration mode. To undo the tunnel interface bandwidth that is set, use the no form of this command.
bandwidth kbps
no bandwidth kbps
kbps |
Interface bandwidth in kilobits per second (kbps). The range is from 0 to 4294967295. The default value is 100. |
None
interface configuration
Release | Modification |
---|---|
Release 4.2.0 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID | Operation |
---|---|
interface |
read, write |
This example shows how to set the bandwidth of the tunnel interface:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 6677 RP/0/RSP0/CPU0:router(config-if)# bandwidth 56789
To specify the description of any interface, use the description command in the interface configuration mode. To undo the specified description, use the no form of the command.
description description-name
no description
description-name |
Description of the Interface. |
None
Interface Configuration
Release | Modification |
---|---|
Release 4.2.0 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID | Operation |
---|---|
interface |
read, write |
The following output shows how to specify the description of an interface:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 789 RP/0/RSP0/CPU0:router(config-if)# description Interface
To set the IPv4 address of the tunnel interface, use the ipv4 address command in interface configuration mode. To remove the IPv4 addresses, use the no form of this command.
ipv4 address prefix subnet mask [ route-tag value | secondary [ route-tag value ] ]
no ipv4 address prefix subnet mask [ route-tag value | secondary [ route-tag value ] ]
prefix |
IPv4 address of the interface. |
subnet mask | Subnet mask of the interface. |
route-tag | Specifies the tag associated with the IP address. |
value | Tag value. |
secondary | Specifies the secondary IPV4 address. |
None
Interface configuration
Release |
Modification |
---|---|
Release 4.2.1 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID |
Operations |
---|---|
network |
read, write |
acl |
read, write |
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)#interface tunnel-ip 67 ipv4 address 10.1.1.2 6.7.7.8 route-tag 78
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)#interface tunnel-ip 67 ipv4 address 1.2.3.4 7.8.9.8 secondary route-tag 89
To set the IPv4 MTU on the tunnel interface, use the ipv4 mtu command in interface configuration mode. To remove the IPv4 MTU, use the no form of this command.
ipv4 mtu size
no ipv4 mtu size
size |
Size of the MTU in bytes. The range is from 68 to 65535. |
None
Interface configuration
Release |
Modification |
---|---|
Release 4.2.1 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID |
Operations |
---|---|
network |
read, write |
acl |
read, write |
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)#interface tunnel-ip 78 ipv4 mtu 78
To set the IPv6 address of the tunnel interface, use the ipv6 address command in interface configuration mode. To remove the IPv6 addresses, use the no form of this command.
ipv6 { address zone { prefix length | link-local } [ route-tag value ] | zone /length [ route-tag value ] }
no ipv6 { address zone { prefix length | link-local } [ route-tag value ] | zone /length [ route-tag value ] }
zone | Specifies the IPv6 address of the interface. |
prefix length | Specifies the length of the IPv6 address prefix, in bits. The range is from 1 to 128. |
link-local | Specifies the link-local address. |
route-tag | Specifies the tag associated with the address. |
value | Tag value. The range is from 1 to 4294967295. |
None
Interface configuration
Release |
Modification |
---|---|
Release 4.2.1 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID |
Operations |
---|---|
network |
read, write |
interface |
read, write |
ipv6 |
read, write |
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)#interface tunnel-ip 67 ipv6 address 10:2::3 link-local route-tag 78
To set the IPv6 MTU on the tunnel interface, use the ipv6 mtu command in interface configuration mode. To remove the IPv6 MTU, use the no form of this command.
ipv6 mtu size
no ipv6 mtu size
size |
Size of the MTU in bytes. The range is from 1280 to 65535. |
None
Interface configuration
Release |
Modification |
---|---|
Release 4.2.1 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID |
Operations |
---|---|
network |
read, write |
interface |
read, write |
ipv6 |
read, write |
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)#interface tunnel-ip 78 ipv6 mtu 3456
To enable keepalive for a tunnel interface, use the keepalive command. To remove keepalive, use the no form of this command.
keepalive [ time_in_seconds [retry_num] ]
no keepalive
time_in_seconds |
Specifies the frequency (in seconds) at which keepalive check is performed. The default is 10 seconds. The minimum value is 1 second. |
retry_num |
Specifies the number of keepalive retries before declaring that a tunnel destination is unreachable. The default is 3 retries. The minimum value is 1 retry. |
None
interface configuration
Release |
Modification |
---|---|
Release 4.2.0 | This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Use the keepalive command to enable keepalive for a tunnel interface.
Task ID |
Operations |
---|---|
interface |
read, write |
The following example shows how to configure interface tunnel:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 400 RP/0/RSP0/CPU0:router(config-if)# keepalive 30
To set the MTU size of the tunnel interface, use the mtu command in interface configuration mode. To undo the MTU size of the tunnel interface that is set, use the no form of this command.
This is a Generic Routing Encapsulation (GRE) command.
mtu size
no mtu size
size |
Size of MTU in bytes. The default value is 1500. |
None
Interface configuration
Release | Modification |
---|---|
Release 4.2.0 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID | Operation |
---|---|
interface |
read, write |
This example shows how to set the MTU size of the tunnel interface:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 456 RP/0/RSP0/CPU0:router(config-if)# mtu 334
To shut down any interface, use the shutdown command in interface configuration mode. To start the interface, use the no form of the command.
This is a Generic Routing Encapsulation (GRE) command.
shutdown
no shutdown
This command has no keywords or arguments.
None
Interface configuration
Release | Modification |
---|---|
Release 4.2.0 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID | Operation |
---|---|
interface |
read, write |
This example shows how to shut down a given interface:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 789 RP/0/RSP0/CPU0:router(config-if)# shutdown
To specify a tunnel interface's destination address, use the tunnel destination command. To remove the destination address, use the no form of this command.
![]() Note | The tunnel will not be operational until the tunnel destination is specified. |
tunnel destination ip-address
no tunnel destination ip-address
ip-address |
Specifies the IPv4 address of the host destination. |
None
interface configuration
Release |
Modification |
---|---|
Release 4.2.0 |
This command was introduced. |
Release 5.2.2 | The tunnel destination can be an IPv6 address. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID |
Operations |
---|---|
interface |
read, write |
The following example shows how to configure interface tunnel:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 400 RP/0/RSP0/CPU0:router(config-if)# tunnel destination 10.10.10.1
Command | Description |
Configures the encapsulation mode of the tunnel interface. | |
Sets a tunnel interface's source address. | |
Specifies the value of the TOS field in the tunnel encapsulating packets. | |
Configures the Time-To-Live (TTL) for packets entering the tunnel. |
To configure the key value for packets sent over a tunnel, use the tunnel key command. To delete the configured key value, use the no form of this command.
tunnel key key-value
no tunnel key key-value
key-value |
Specifies the tunnel key value. Range is from 0 to 4294967295. |
No value is configured.
interface configuration
Release | Modification |
---|---|
Release 5.1.1 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
GRE tunnel key feature is supported only on Cisco ASR 9000 Enhanced Ethernet line cards. It is mandatory to have ingress and egress line cards as Enhanced Ethernet line cards.
GRE tunnel keepalive is not supported with tunnel key. If the configuration for the GRE keepalives and tunnel key are present at the same time, the tunnel is brought down and a warning message is displayed.
For a given router, either the same key or different keys can be configured under multiple GRE tunnels.
Different traffic streams passing through the same GRE tunnel contain the same GRE key configured for that tunnel.
Task ID | Operation |
---|---|
interface |
read, write |
tunnel |
read, write |
This example shows how to configure the tunnel key value at the GRE transmitter and receiver end:
!Local GRE Interface RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 10 RP/0/RSP0/CPU0:router(config-if)#ipv4 address 101.0.9.1 255.255.255.0 RP/0/RSP0/CPU0:router(config-if)# tunnel key 10 RP/0/RSP0/CPU0:router(config-if)# tunnel tos 96 RP/0/RSP0/CPU0:router(config-if)# tunnel source Loopback10 RP/0/RSP0/CPU0:router(config-if)# tunnel destination 33.0.9.33 ! !Remote GRE Interface RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 10 RP/0/RSP0/CPU0:router(config-if)#ipv4 address 101.0.9.2 255.255.255.0 RP/0/RSP0/CPU0:router(config-if)# tunnel key 10 RP/0/RSP0/CPU0:router(config-if)# tunnel tos 96 RP/0/RSP0/CPU0:router(config-if)# tunnel source Loopback10 RP/0/RSP0/CPU0:router(config-if)# tunnel destination 11.0.9.11 !
To ensure that the decapsulation router skips GRE key validation before accepting the packet, use the tunnel key-ignore command. To remove the tunnel key ignore feature, use the no form of this command.
tunnel key-ignore
no tunnel key-ignore
This command has no keywords or arguments.
Tunnel key-ignore is disabled.
interface configuration
Release | Modification |
---|---|
Release 5.1.1 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Do not configure any key value under GRE tunnel that has tunnel key-ignore feature enabled. This is because the configured tunnel key overrides the tunnel key-ignore feature. As a result, packets that arrive with configured key value are accepted and undergo further processing at the decapsulation router, while the remaining packets without the key value are dropped.
Task ID | Operation |
---|---|
interface |
read, write |
tunnel |
read, write |
This example shows how to configure the tunnel key-ignore feature at the GRE transmitter and receiver ends:
!Local GRE Interface RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 10 RP/0/RSP0/CPU0:router(config-if)#ipv4 address 101.0.9.1 255.255.255.0 RP/0/RSP0/CPU0:router(config-if)# tunnel key-ignore RP/0/RSP0/CPU0:router(config-if)# tunnel tos 96 RP/0/RSP0/CPU0:router(config-if)# tunnel source Loopback10 RP/0/RSP0/CPU0:router(config-if)# tunnel destination 33.0.9.33 ! !Remote GRE Interface RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router# interface tunnel-ip 10 RP/0/RSP0/CPU0:router#ipv4 address 101.0.9.2 255.255.255.0 RP/0/RSP0/CPU0:router# tunnel key-ignore RP/0/RSP0/CPU0:router# tunnel tos 96 RP/0/RSP0/CPU0:router# tunnel source Loopback10 RP/0/RSP0/CPU0:router# tunnel destination 11.0.9.11 !
To configure the DF bit setting in the tunnel transport header, use the tunnel dfbit command. To revert to the default DF bit setting value, use the no form of this command.
tunnel dfbit disable
no tunnel dfbit
disable |
Disables the DF bit in the outer packet. This allows the outer packet to be fragmented, if required. |
The DF bit value in the outer packet is disabled. This allows outer packet fragmentation, if required.
interface configuration
Release |
Modification |
---|---|
Release 4.2.0 |
This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID |
Operations |
---|---|
interface |
read, write |
The following example shows how to enable fragmentation over an interface tunnel.
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 400 RP/0/RSP0/CPU0:router(config-if)# tunnel dfbit disable
Command | Description |
Specifies a tunnel interface's destination address. | |
Configures the encapsulation mode of the tunnel interface. | |
Sets a tunnel interface's source address. | |
Specifies the value of the TOS field in the tunnel encapsulating packets. | |
Configures the Time-To-Live (TTL) for packets entering the tunnel. |
To configure the encapsulation mode of the tunnel interface, use the tunnel mode command. To revert the encapsulation to the default IPv4 GRE tunnel mode, use the no form of this command.
tunnel mode gre ipv4}
no tunnel mode
gre |
ipv4 |
Specifies the tunnel as a GRE tunnel over an IPv4 transport network. |
The default tunnel mode is set as a GRE tunnel over an IPv4 transport network.
interface configuration
Release |
Modification |
---|---|
Release 4.2.0 |
This command was introduced. |
Release 5.2.2 | Support for GRE tunnel on an IPv6 transport network. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID |
Operations |
---|---|
interface |
read, write |
The following example shows how to configure interface tunnel:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 400 RP/0/RSP0/CPU0:router(config-if)#tunnel mode gre ipv4
Command | Description |
| Specifies a tunnel interface's destination address. |
| Sets a tunnel interface's source address. |
| Specifies the value of the TOS field in the tunnel encapsulating packets. |
| Configures the Time-To-Live (TTL) for packets entering the tunnel. |
To set a tunnel interface's source address, use the tunnel source command. To remove the source address, use the no form of this command.
![]() Note | The tunnel will not be operational until the tunnel source is specified. |
tunnel source { interface_name | ip-address }
no tunnel source { interface_name | ip-address }
interface_name |
Specifies the name of the interface whose IP address will be used as the source address of the tunnel. The interface name can be of a loopback interface or a physical interface. |
ip-address |
Specifies the IPv4 address to use as the source address for packets in the tunnel. |
None
interface configuration
Release |
Modification |
---|---|
Release 4.2.0 |
This command was introduced. |
Release 5.2.2 | The tunnel source can be an IPv6 address. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
It is recommended that the tunnel source is identified using the interface ID and not the IP address. Using the interface ID enables the router to mark the tunnel as down when the interface is down and the routing protocol tries to find and use an alternate route to the tunnel route.
Task ID |
Operations |
---|---|
interface |
read, write |
The following example shows how to configure interface tunnel:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 400 RP/0/RSP0/CPU0:router(config-if)# tunnel source 10.10.10.1
Command | Description |
| Specifies a tunnel interface's destination address. |
| Configures the encapsulation mode of the tunnel interface. |
| Specifies the value of the TOS field in the tunnel encapsulating packets. |
| Configures the Time-To-Live (TTL) for packets entering the tunnel. |
To specify the value of the TOS field in the tunnel encapsulating packets, use the tunnel tos command. To return to the default TOS value, use the no form of this command.
tunnel tos tos_value
no tunnel tos tos_value
tos_value |
Specifies the value of the TOS field in the tunnel encapsulating packets. The TOS value ranges between 0 to 255. |
Copies the TOS/COS bits of the internal IP header to the GRE IP header. In case of labeled payload, EXP bits are copied to TOS bits of the GRE IP header.
interface configuration
Release |
Modification |
---|---|
Release 4.2.0 | This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID |
Operations |
---|---|
interface |
read, write |
The following example shows how to configure interface tunnel:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 400 RP/0/RSP0/CPU0:router(config-if)# tunnel tos 100
Command | Description |
Specifies a tunnel interface's destination address. | |
Configures the encapsulation mode of the tunnel interface. | |
Sets a tunnel interface's source address. | |
Configures the Time-To-Live (TTL) for packets entering the tunnel. |
To configure the Time-To-Live (TTL) for packets entering the tunnel, use the tunnel ttl command. To undo the configuration, use the no form of this command.
tunnel ttl ttl_value
no tunnel ttl ttl_value
ttl_value |
Specifies the value of TTL for packets entering the tunnel. The TTL value ranges between 1 to 255. |
The default TTL value is set to 255.
interface configuration
Release |
Modification |
---|---|
Release 4.2.0 | This command was introduced. |
To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
This command specifies the Time-To-Live for packets entering the tunnel so that the packets are not dropped inside the carrier network before reaching the tunnel destination.
Task ID |
Operations |
---|---|
interface |
read, write |
The following example shows how to configure interface tunnel:
RP/0/RSP0/CPU0:router# configure RP/0/RSP0/CPU0:router(config)# interface tunnel-ip 400 RP/0/RSP0/CPU0:router(config-if)#tunnel source 10.10.10.1
Command | Description |
Specifies a tunnel interface's destination address. | |
Configures the encapsulation mode of the tunnel interface. | |
Specifies the value of the TOS field in the tunnel encapsulating packets. | |
Sets a tunnel interface's source address. |