Setting up GRE Tunnels on Debian 🚇
Step-by-step guide to configuring a GRE tunnel on Debian between endpoints using specific tunnel IPs

Driving SD-WAN Adoption in South Africa
Search for a command to run...
Step-by-step guide to configuring a GRE tunnel on Debian between endpoints using specific tunnel IPs

Driving SD-WAN Adoption in South Africa
No comments yet. Be the first to comment.
Enhancing Security and Compliance with ManageEngine ADAudit Plus

Why Pings Aren't Enough & NMS is Essential

What is SD-WAN (Software Defined Wide Area Networking)? | The Mechanics of this Groundbreaking New Network Technology

Embracing First Principles & the Scientific Method

Ever Wondered | "Is My Internet Really 99.9% Reliable?" 🤔

To set up a GRE tunnel on Debian between two endpoints (102.219.109.8 and 102.222.161.20) using tunnel IPs 100.64.0.1/30 and 100.64.0.2/30, follow these steps.
| Host | Public IP | Tunnel IP |
| Host A | 102.219.109.8 | 100.64.0.1/30 |
| Host B | 102.222.161.20 | 100.64.0.2/30 |
You’ll need to do the following steps on both hosts, changing local/remote accordingly.
102.219.109.8)ip tunnel add gre1 mode gre local 102.219.109.8 remote 102.222.161.20 ttl 255
ip addr add 100.64.0.1/30 dev gre1
ip link set gre1 up
102.222.161.20)ip tunnel add gre1 mode gre local 102.222.161.20 remote 102.219.109.8 ttl 255
ip addr add 100.64.0.2/30 dev gre1
ip link set gre1 up
From Host A, ping Host B:
ping 100.64.0.2
From Host B, ping Host A:
ping 100.64.0.1
If you want to make the tunnel persistent across reboots, you can:
(not ideal unless scripted manually)
/etc/network/interfaces (legacy method)Edit /etc/network/interfaces on Host A:
auto gre1
iface gre1 inet static
address 100.64.0.1
netmask 255.255.255.252
pre-up ip tunnel add gre1 mode gre local 102.219.109.8 remote 102.222.161.20 ttl 255
up ip link set gre1 up
down ip link set gre1 down
post-down ip tunnel del gre1
Edit /etc/network/interfaces on Host B:
auto gre1
iface gre1 inet static
address 100.64.0.2
netmask 255.255.255.252
pre-up ip tunnel add gre1 mode gre local 102.222.161.20 remote 102.219.109.8 ttl 255
up ip link set gre1 up
down ip link set gre1 down
post-down ip tunnel del gre1
Then restart networking:
sudo systemctl restart networking
Ensure GRE (IP protocol 47) is allowed through any firewall (iptables, nftables, cloud firewall, etc.).
No NAT should be applied to the tunnel unless explicitly required.
GRE doesn't encrypt traffic — it's purely encapsulation.