
İçindekiler
GRE Tunnel Nedir ve Ne İçin Kullanılır?
GRE (Generic Routing Encapsulation) tunnel, farklı ağlar arasında güvenli ve esnek bağlantı kurmak için kullanılan bir tünelleme protokolüdür. VPN, veri merkezi bağlantısı ve ağ genişletme için ideal bir çözümdür.

Doğuş ŞEKERCİ
Founder & CEO
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.
[Ofis A] ----GRE Tunnel---- [İnternet] ----GRE Tunnel---- [Ofis B]
| |
10.0.1.0/24 10.0.2.0/242. 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 |
| Veri | Asıl payload |
GRE Paket Yapısı
+------------------------+
| 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
# 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 gre1MikroTik RouterOS'ta GRE Tunnel
# 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-tunnel1Cisco IOS'ta GRE Tunnel
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 Tunnel0GRE vs IPsec: Hangisini Seçmeli?
| Özellik | GRE | IPsec |
|---|---|---|
| Şifreleme | Yok | Var (AES, 3DES) |
| Multicast Desteği | Var | Yok |
| Overhead | Düşük (4-8 byte) | Yüksek (50-60 byte) |
| Performans | Yüksek | Orta |
| Güvenlik | Düşük | Yüksek |
| Yapılandırma | Basit | Karmaşı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
[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ı
İ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ı
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.
[Office A] ----GRE Tunnel---- [Internet] ----GRE Tunnel---- [Office B]
| |
10.0.1.0/24 10.0.2.0/242. 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:
| Layer | Content |
|---|---|
| New IP Header | Tunnel endpoint IP addresses |
| GRE Header | Protocol info, flags |
| Original IP Header | Source and destination IP |
| Data | Actual payload |
GRE vs IPsec: Which to Choose?
| Feature | GRE | IPsec |
|---|---|---|
| Encryption | No | Yes (AES, 3DES) |
| Multicast Support | Yes | No |
| Overhead | Low (4-8 bytes) | High (50-60 bytes) |
| Performance | High | Medium |
| Security | Low | High |
| Configuration | Simple | Complex |
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!
Bu yazıyı paylaşın
Yorumlar
Bu yazı hakkında okuyucu yorumları

