GRE Tunnel Nedir?

GRE (Generic Routing Encapsulation), Cisco tarafından geliştirilen ve RFC 2784 ile standartlaştırılan bir tünelleme protokolüdür. GRE, bir ağ protokolünün paketlerini başka bir ağ protokolü içine kapsülleyerek (encapsulation) iki nokta arasında sanal bir tünel oluşturur.

Basit bir ifadeyle, GRE tunnel farklı lokasyonlardaki ağları internet üzerinden sanki aynı yerel ağdaymış gibi birbirine bağlar.

GRE Tunnel'ın Temel Özellikleri

  • Protokol Bağımsızlığı: IP, IPv6, IPX gibi farklı protokolleri taşıyabilir
  • Basit Yapılandırma: Karmaşık şifreleme gerektirmez
  • Düşük Overhead: Minimal ek yük ile yüksek performans
  • Multicast Desteği: OSPF, EIGRP gibi routing protokollerini destekler
  • Point-to-Point: İki uç nokta arasında doğrudan bağlantı

GRE Tunnel Ne İçin Kullanılır?

1. Site-to-Site VPN Bağlantıları

Farklı lokasyonlardaki ofisleri veya veri merkezlerini birbirine bağlamak için kullanılır.

code
[Ofis A] ----GRE Tunnel---- [İnternet] ----GRE Tunnel---- [Ofis B]
   |                                                          |
10.0.1.0/24                                            10.0.2.0/24

2. Veri Merkezi Bağlantısı

Birden fazla veri merkezi arasında güvenli ve hızlı bağlantı kurmak için idealdir.

Netlen Avantajı: Netlen veri merkezi altyapısında GRE tunnel desteği mevcuttur. Colocation ve bulut sunucu hizmetlerimizde özel ağ bağlantıları kurabilirsiniz.

3. Multicast Routing

GRE, IPsec'in desteklemediği multicast trafiğini taşıyabilir. Bu özellik özellikle:

  • Video streaming uygulamaları
  • OSPF/EIGRP routing protokolleri
  • Multicast tabanlı yedekleme sistemleri

için kritik öneme sahiptir.

4. IPv6 over IPv4 Geçişi

IPv4 altyapısı üzerinden IPv6 trafiği taşımak için kullanılabilir.

GRE Tunnel Nasıl Çalışır?

GRE tunnel, orijinal paketi yeni bir IP başlığı ve GRE başlığı ile kapsüller:

Katmanİçerik
Yeni IP BaşlığıTunnel endpoint IP adresleri
GRE BaşlığıProtokol bilgisi, flags
Orijinal IP BaşlığıKaynak ve hedef IP
VeriAsıl payload

GRE Paket Yapısı

code
+------------------------+
|  Delivery Header (IP)  |  <- Tunnel uç noktaları
+------------------------+
|      GRE Header        |  <- 4-8 byte
+------------------------+
|   Payload (Original)   |  <- Orijinal paket
+------------------------+

GRE Tunnel Yapılandırması

Linux'ta GRE Tunnel Kurulumu

bash
# Tunnel interface oluşturma
ip tunnel add gre1 mode gre remote 203.0.113.2 local 198.51.100.1 ttl 255

# Interface'i aktif etme
ip link set gre1 up

# IP adresi atama
ip addr add 192.168.100.1/30 dev gre1

# Route ekleme
ip route add 10.0.2.0/24 dev gre1

MikroTik RouterOS'ta GRE Tunnel

routeros
# GRE interface oluşturma
/interface gre add name=gre-tunnel1 remote-address=203.0.113.2 local-address=198.51.100.1

# IP adresi atama
/ip address add address=192.168.100.1/30 interface=gre-tunnel1

# Route ekleme
/ip route add dst-address=10.0.2.0/24 gateway=gre-tunnel1

Cisco IOS'ta GRE Tunnel

cisco
interface Tunnel0
 ip address 192.168.100.1 255.255.255.252
 tunnel source 198.51.100.1
 tunnel destination 203.0.113.2
 tunnel mode gre ip
!
ip route 10.0.2.0 255.255.255.0 Tunnel0

GRE vs IPsec: Hangisini Seçmeli?

ÖzellikGREIPsec
ŞifrelemeYokVar (AES, 3DES)
Multicast DesteğiVarYok
OverheadDüşük (4-8 byte)Yüksek (50-60 byte)
PerformansYüksekOrta
GüvenlikDüşükYüksek
YapılandırmaBasitKarmaşık

GRE over IPsec

En iyi çözüm genellikle ikisini birlikte kullanmaktır:

  • GRE: Multicast ve routing protokolü desteği sağlar
  • IPsec: Şifreleme ve güvenlik sağlar
code
[Paket] -> [GRE Encapsulation] -> [IPsec Encryption] -> [İnternet]

GRE Tunnel Avantajları ve Dezavantajları

Avantajları

  • Basit kurulum ve yönetim
  • Düşük overhead, yüksek performans
  • Multicast ve broadcast desteği
  • Farklı protokolleri taşıyabilme
  • Routing protokolleri ile uyumluluk

Dezavantajları

  • Yerleşik şifreleme yok (güvenlik için IPsec gerekli)
  • NAT traversal sorunları olabilir
  • Bazı firewall'lar GRE'yi engelleyebilir (Protocol 47)

GRE Tunnel Kullanım Senaryoları

Senaryo 1: İki Ofis Bağlantısı

code
İstanbul Ofisi (10.1.0.0/24)
         |
    GRE Tunnel
         |
Ankara Ofisi (10.2.0.0/24)

Senaryo 2: Veri Merkezi ve Bulut Bağlantısı

code
On-Premise DC (172.16.0.0/16)
         |
    GRE Tunnel
         |
Cloud VPS (192.168.0.0/24)

Sonuç

GRE tunnel, ağ yöneticileri için güçlü ve esnek bir tünelleme çözümüdür. Özellikle multicast routing gerektiren ortamlarda, site-to-site bağlantılarda ve veri merkezi bağlantılarında tercih edilmektedir.

Güvenlik gereksinimleri için GRE over IPsec kombinasyonu en iyi uygulamadır. Bu sayede hem GRE'nin esnekliğinden hem de IPsec'in güvenliğinden yararlanabilirsiniz.


Veri merkezi bağlantı çözümleri için Colocation hizmetlerimizi inceleyin!

`,

contentEn: `

What is GRE Tunnel?

GRE (Generic Routing Encapsulation) is a tunneling protocol developed by Cisco and standardized by RFC 2784. GRE creates a virtual tunnel between two points by encapsulating packets of one network protocol within another network protocol.

Simply put, GRE tunnel connects networks at different locations over the internet as if they were on the same local network.

Key Features of GRE Tunnel

  • Protocol Independence: Can carry different protocols like IP, IPv6, IPX
  • Simple Configuration: Does not require complex encryption
  • Low Overhead: High performance with minimal overhead
  • Multicast Support: Supports routing protocols like OSPF, EIGRP
  • Point-to-Point: Direct connection between two endpoints

What is GRE Tunnel Used For?

1. Site-to-Site VPN Connections

Used to connect offices or data centers at different locations.

code
[Office A] ----GRE Tunnel---- [Internet] ----GRE Tunnel---- [Office B]
   |                                                           |
10.0.1.0/24                                             10.0.2.0/24

2. Data Center Connectivity

Ideal for establishing secure and fast connections between multiple data centers.

Netlen Advantage: GRE tunnel support is available in Netlen data center infrastructure. You can set up private network connections in our colocation and cloud server services.

3. Multicast Routing

GRE can carry multicast traffic that IPsec does not support. This feature is critical for:

  • Video streaming applications
  • OSPF/EIGRP routing protocols
  • Multicast-based backup systems

4. IPv6 over IPv4 Transition

Can be used to carry IPv6 traffic over IPv4 infrastructure.

How Does GRE Tunnel Work?

GRE tunnel encapsulates the original packet with a new IP header and GRE header:

LayerContent
New IP HeaderTunnel endpoint IP addresses
GRE HeaderProtocol info, flags
Original IP HeaderSource and destination IP
DataActual payload

GRE vs IPsec: Which to Choose?

FeatureGREIPsec
EncryptionNoYes (AES, 3DES)
Multicast SupportYesNo
OverheadLow (4-8 bytes)High (50-60 bytes)
PerformanceHighMedium
SecurityLowHigh
ConfigurationSimpleComplex

GRE over IPsec

The best solution is usually to use both together:

  • GRE: Provides multicast and routing protocol support
  • IPsec: Provides encryption and security

Conclusion

GRE tunnel is a powerful and flexible tunneling solution for network administrators. It is especially preferred in environments requiring multicast routing, site-to-site connections, and data center connectivity.

For security requirements, the GRE over IPsec combination is the best practice. This way you can benefit from both GRE's flexibility and IPsec's security.


Check out our Colocation services for data center connectivity solutions!

gre tunnel
gre tüneli
vpn
ağ tünelleme
network tunnel
routing
encapsulation
veri merkezi bağlantısı
site-to-site vpn

Bu yazıyı paylaşın

Doğuş ŞEKERCİ

Yazar Hakkında

Doğuş ŞEKERCİ

Founder & CEO

13 yıllık deneyimimle veri merkezi hizmetleri, fintech altyapıları, bulut sunucu teknolojileri ve siber güvenlik alanında çalışıyorum.

Yorumlar

Bu yazı hakkında okuyucu yorumları