0

I am learning about networks and I have reached the topic of tunnels. At the same time, I have a need to set up a GRE (Generic Routing Encapsulation) tunnel between a remote server (to route addresses from it) and a workstation.

First, I am simulating the situation in Packet Tracer to understand how it works.

enter image description here

The setup is simple, the router at the top of this pyramid simulates the service provider network. A GRE tunnel is established between the other two routers. The routers have routes configured through this tunnel, as expected.

When the tunnel is established on both sides, it works. And it works like this:

  1. The computer sends a packet.
  2. The router, thanks to the static route, recognizes that the desired network is behind the tunnel.
  3. The router adds a GRE header.
  4. The router adds an IP header according to the tunnel configuration.
  5. The router sends the packet.
  6. ...
  7. The packet reaches the receiving router.
  8. It removes the outer IP header.
  9. It sees the GRE header and removes it.
  10. It continues to route the packet as usual.

However, if the tunnel is only established on one side, the receiving router does not remove the GRE header. At least in Packet Tracer.

Question: Why does this happen? And is it possible to make it work in such a scenario?

Correct me if I misunderstand gre logic

3
  • The router tunnel interface adds and removes GRE.
    – Ron Maupin
    Oct 25, 2023 at 17:43
  • How does the router understand which tunnel the packet belongs to? Oct 25, 2023 at 17:46
  • A tunnel interface is like any other router interface. Packets get switched to an interface based on the routing table.
    – Ron Maupin
    Oct 25, 2023 at 17:55

1 Answer 1

1

if the tunnel is only established on one side, the receiving router does not remove the GRE header.

Established means the tunnel is 'up' on both its end. If one side encapsulates but there's no termination, the packet is rejected or simply dropped by the supposed tunnel endpoint.

And is it possible to make it work in such a scenario?

You always need two tunnel endpoints, a single one doesn't work.

How does the router understand which tunnel the packet belongs to?

A received GRE packet is matched to the associated TUN interface by the far side's source IP.

2
  • so.... Tunnels have ip adresses. Why we must write tunnel ENDPOINT address in static route instead of start? Oct 25, 2023 at 18:06
  • You need to point the route beyond the far side into the tunnel, so either the interface itself, or for a numbered interface you can use the far side's tunnel interface IP.
    – Zac67
    Oct 25, 2023 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.