Static point-to-point GRE tunnels
A tunnel interface is not a link; it is a route wearing an interface's clothes. GRE encapsulates a passenger protocol, IPv4 or IPv6, and the transport is IP. A tunnel works until the transport network is advertised across it: the best path to the tunnel destination becomes the tunnel itself, the tunnel goes down, the route goes with it, and it flaps. Keep the two routings apart.
By Arif, founder of Daveth · Updated
The full 6 min walkthrough is in Daveth Pro (Network). See what the plan opens
What this page answers
What causes recursive routing on a GRE tunnel?
The best path to the tunnel destination becomes the tunnel itself, usually after the transport network is advertised across it. The tunnel goes down, the route is withdrawn, it comes back, and it flaps. Read it in “Then somebody advertises the transport network”
How do you prevent GRE recursive routing?
Keep the routing that resolves the tunnel destination separate from the routing over the tunnel: use a different autonomous system number or tag, a different routing protocol, or static routes to override the first hop. Read it in “Three documented ways to say one thing”
What are the passenger, carrier and transport protocols?
The passenger is the protocol encapsulated, IPv4 or IPv6; the carrier is the encapsulating protocol, such as GRE or MPLS; the transport carries the encapsulated packet, IP. Read it in “What is a tunnel interface, actually?”
What is a tunnel interface, actually?
Not a link. A route wearing an interface's clothes, and everything odd about tunnels follows from that.
Tunneling encapsulates data packets from one protocol within a different protocol and transports the packets on a foreign network.
| Role | What it is | For example |
|---|---|---|
| passenger | The protocol that you are encapsulating. | IPv4 and IPv6 |
| carrier | The protocol that encapsulates. | GRE, and MPLS |
| transport | The protocol that carries the encapsulated protocol. | IP |
Learn the three names here and you get MPLS's shape for free: the label stack in 3.2 is the same arrangement with a different carrier.
GRE encapsulates a payload, that is, an inner packet that needs to be delivered to a destination network inside an outer IP packet.
And one sentence from the tech note on tunnel states that the last part of this page spends:
GRE tunnels are designed to be completely stateless. This means that each tunnel endpoint does not keep any information about the state or availability of the remote tunnel endpoint.
Three lines, and none of them is a cable
Two sites, a provider between them, and a default route at each end. R1 has nothing else towards 203.0.113.6. The same on R2, mirrored.
R1# configure terminal R1(config)# interface Tunnel0 R1(config-if)# ip address 10.255.0.1 255.255.255.252 R1(config-if)# ipv6 address 2001:db8:ff::1/64 R1(config-if)# tunnel source GigabitEthernet0/0/0 R1(config-if)# tunnel destination 203.0.113.6 R1(config-if)# tunnel mode gre ip R1(config-if)# end
Is the tunnel up, and what is that up resting on?
This course's output on R1, computed from the scenario in the layout the samples print.
R1# show interfaces tunnel 0 Tunnel0 is up, line protocol is up ! Up because this router has a route to 203.0.113.6 that doesn't point back through Tu0. With no keepalive, that is all it means. Hardware is Tunnel Internet address is 10.255.0.1/30 ! Two lines are not drawn after this one: the interface MTU, bandwidth and delay, and the reliability and load. the two samples print different values there. Encapsulation TUNNEL, loopback not set Keepalive not set Tunnel source 203.0.113.1 (GigabitEthernet0/0/0), destination 203.0.113.6, fastswitch TTL 255 Tunnel protocol/transport GRE/IP, key disabled, sequencing disabled Tunnel TTL 255
The layout is the one in the IOS XE 17.x chapter's sample; the addresses are this scenario's. Two lines after the address aren't drawn, because the two samples print different MTU and bandwidth values there, and neither says which a 17.9 router prints.
Proves: the interface and line protocol state, the configured source and destination, the mode, and whether a keepalive is set.
Does not prove: that the far end exists, or has a tunnel. With no keepalive, up means this router has a route to the destination that doesn't point through the tunnel.
So when is it down? the tech note on tunnel states gives three reasons, and only three, for a point-to-point tunnel to be up/down:
There is no route, which includes the default route, to the tunnel destination address. The interface that anchors the tunnel source is down. The route to the tunnel destination address is through the tunnel itself, which results in recursion.
Every one of them is about this router. None is about the far end.
To check that a route exists to the remote endpoint address, use the show ip route command.
Does R1 have a route to 203.0.113.6?
This course's output on R1, computed from the scenario in the layout the samples print.
R1# show ip route 203.0.113.6 % Network not in table ! The default route carries 203.0.113.6. This command looks for a route more specific than the default, and there isn't one.
So is the destination missing? No. show ip route 203.0.113.6 looks for a route more specific than the default, and there isn't one; the default carries it. The tech note makes the same point with the same output: A valid tunnel destination is one which is routable. However, it does not have to be reachable.
The mode names the transport, not the passenger. tunnel mode gre ip means the outer packet is IPv4. The chapter's own example runs IPv6 and IS-IS over tunnel mode gre ip, which is why this tunnel carries an address in both families.
GRE tunnels can also carry multiple packet types such as unicast and multicast.
With OSPF over the tunnel, each site learns the other's LAN: 192.168.10.0/24 and 192.168.20.0/24, across a provider that has never heard of either.
One thing to be exact about before that sentence gets over-read. A provider that has never heard of those LANs still carries every byte of them. The inner packet is wrapped, not altered: the original addresses, the routing protocol between the two sites and the application data all travel in the payload exactly as they were written, and anything able to read the transport can read them. GRE solves reachability, which is a real problem and the one this page is about. Confidentiality is a different problem with a different mechanism, and a design that treats the tunnel as private has read the word into the picture rather than off it.
Then somebody advertises the transport network
The tunnel works. So the obvious next move is to put everything into OSPF, including the networks the tunnel endpoints live on. Nobody would write that change up as risky.
A tunnel may have a recursive routing problem if routing is not configured accurately. The best path to a tunnel destination is via the tunnel itself; therefore recursive routing causes the tunnel interface to flap.
This course's reading, computed from the scenario: how each end resolved its tunnel destination.
destination resolved by out of line protocol R1 203.0.113.6 203.0.113.4/30 ospf Tu0 up/down R2 203.0.113.1 203.0.113.0/30 ospf Tu0 up/down
Read that table, not the interface. 203.0.113.4/30 reached R1 across the tunnel, where R1's only other route towards 203.0.113.6 was the default. Longest prefix wins, so the best path to the tunnel destination pointed out of Tu0.
What do R1's tunnel interface and its log say about it?
This course's output on R1, computed from the scenario in the layout the samples print.
R1# show interfaces tunnel 0 Tunnel0 is up, line protocol is down ! Down for the third: The route to the tunnel destination address is through the tunnel itself, which results in recursion. Nothing about the tunnel's own configuration changed. Hardware is Tunnel Internet address is 10.255.0.1/30 ! Two lines are not drawn after this one: the interface MTU, bandwidth and delay, and the reliability and load. the two samples print different values there. Encapsulation TUNNEL, loopback not set Keepalive not set Tunnel source 203.0.113.1 (GigabitEthernet0/0/0), destination 203.0.113.6, fastswitch TTL 255 Tunnel protocol/transport GRE/IP, key disabled, sequencing disabled Tunnel TTL 255
This course's output on R1, computed from the scenario in the layout the samples print.
R1# show logging | include TUN %TUN-RECURDOWN Interface Tunnel 0 temporarily disabled due to recursive routing ! The message as the chapter prints it. It names the interface and the cause, and the cause is in the routing table.
Read the message as a sentence about the routing table. The source, the destination and the mode are exactly what they were when it worked. What changed is which route resolves the destination.
The interface went down because it worked. It came up, carried a routing protocol, the protocol did its job, and the result pulled out the interface's own foundation.
Why it comes back, and why that's worse
With the tunnel down, the routes learned across it are gone, including the one that took it down. The default resolves the destination again, and the interface comes back. Then OSPF learns the transport network across it again. What does R1 find now when it looks up its tunnel destination?
This course's output on R1, computed from the scenario in the layout the samples print.
R1# show ip route 203.0.113.6
Routing entry for 203.0.113.4/30
Known via "ospf 1", distance 110, metric 1001
Last update from 10.255.0.2 on Tunnel0, 00:00:12 ago
Routing Descriptor Blocks:
* 10.255.0.2, from 10.0.0.2, 00:00:12 ago, via Tunnel0
! Back, via Tunnel0. The next time R1 resolves its tunnel destination, this is the route it finds.
Route metric is 1001, traffic share count is 1That is the flap: not an interface failing, but a routing table swinging between two states, each correct given the other.
Why is that worse than a tunnel that's simply down? A tunnel that's down stays diagnosable. A tunnel that flaps catches every command in one of the two states, so the table you're reading is evidence for whichever theory you already had. How long temporarily disabled lasts, the chapter doesn't say, and neither does this page.
Three documented ways to say one thing
To avoid recursive routing problems, keep the control-plane routing separate from the tunnel routing by using the following methods: Use a different autonomous system number or tag. Use a different routing protocol. Ensure that static routes are used to override the first hop (watch for routing loops).
The sentence before the list is the instruction; the list is three ways of obeying it. Keep the routing that resolves the tunnel destination out of the routing that runs over the tunnel. The first two keep the two apart. The third makes the underlay route unbeatable.
R1# configure terminal R1(config)# ip route 203.0.113.6 255.255.255.255 203.0.113.2 R1(config)# end
R2 gets the mirror image: a /32 to 203.0.113.1 through 203.0.113.5. Which route does R1 find for 203.0.113.6 now, and which way out does it point?
This course's output on R1, computed from the scenario in the layout the samples print.
R1# show ip route 203.0.113.6
Routing entry for 203.0.113.6/32
Known via "static", distance 1, metric 0
! A /32 beats the /30 the overlay advertises, whatever OSPF does next.
Routing Descriptor Blocks:
* 203.0.113.2
Route metric is 0, traffic share count is 1This course's reading, computed from the scenario: how each end resolved its tunnel destination.
destination resolved by out of line protocol R1 203.0.113.6 203.0.113.6/32 static Gi0/0/0 up/up R2 203.0.113.1 203.0.113.1/32 static Gi0/0/0 up/up
The static entry's last three lines are built from the fields in the command reference samples; no sample of a next-hop static route was read for this page.
Which of the three should you reach for? Whichever your design already implies. A separate protocol or tag stops the problem existing. The static route fixes this tunnel and leaves a routing protocol that can learn its own transport, waiting for the next tunnel. And the chapter's own caveat stands: watch for routing loops.
Continue the lesson
The whole lesson, with its drawings and its questions. 5 more sections after the ones above.

