Cannot Delete GRE Tunnel

Solution 1:

I believe I've found myself an answer to this problem.

After tinkering for a while, I decided to reproduce the problem in a clean installation.

The ip_gre module is not inserted by default in the kernel after installing Debian. ip tunnel show does not display any tunnel. After inserting the ip_gre module, but without creating any tunnel, gre0 appears and is undeletable and unchangeable as expected. Thus gre0 seems to be a dummy tunnel created by default by the ip_gre module.

The frustrating part is that this 'feature' is totally undocumented, and is even an unexpected one, since it might be natural to attempt to create a gre0 tunnel as the first (and only) GRE tunnel in a system.

Solution 2:

The gre0 tunnel interface is named as the fallback interface and has special meaning. It's created by ip_gre kernel module at initialization of module. You cannot disable this feature.

When the host receives gre packets for which the suitable tunnel interface isn't found, this fallback interface will be used. Unfortunately, it's really undocumented feature. Only in the source code this is described.

Same logic is used for other types of tunneling.

So you cannot remove it completely without lost of other gre tunnels. But you can rename it with command ip link set dev gre0 name gre_fallback. And then you can create the other gre tunnel with gre0 name.