Sei sulla pagina 1di 3

GRE (Generic Routing Encapsulation):

GRE è un tunneling protocol di proprietà Cisco che:

- genera un tunnel point-to-point tra una coppia di Routers utile per trasportare traffico IP di qualsiasi natura
(unicast, multicast routing updates, multicast data stream) non supportato dalla porzione di rete interposta
tra le due terminazioni del tunnel
- gira direttamente su IP con number protocol 47
- con un header addizionale permette di supportare qualsiasi protocollo di routed (IPX, AppleTalk ecc..)
- supporta il trasporto degli updates di routing lungo il tunnel
- offre sicurezza solo minimale: potenzialmente può autenticare solo il payload e solo in chiaro testo
- il suo fine è quello di far transitare traffico non supportato nella parte di rete interposta tra le terminazioni del
tunnel (ad esempio multicast non abilitato o supportato dai routers/switches intermediari)

Formato del pacchetto GRE:

GRE introduce un overhead di 24 bytes


(20 byte di nuovo IP header + 4 bytes di
GRE header) 
 MSS = (1500 bytes MTU Ethernet – 24 bytes GRE overhead – 20 bytes IP header originale – 20 bytes TCP header) =
1436 Bytes

SOLUZIONE per evitare la frammentazione:

- introdurre il comando ip tcp adjust-mss 1436 lato interfaccia sorgente


- introdurre il commando ip mtu 1476 sotto le tunnel interfaces (di default già inserito dalle IOS più recenti)

(dove IP MTU del Tunnel = 1500 bytes MTU Ethernet – 24 bytes GRE overhead = 1476 bytes)

Il campo “Flags” ha lunghezza 2 bytes e contiene i seguenti sottocampi:

Checksum Present (bit 0): If Checksum Present bit is set to 1, the optional checksum field is present in the GRE header
Key Present (bit 2): If Key Present bit is set to 1, the optional Key field is present in the GRE header
Sequence Number Present (bit 3): If Sequence Number Present bit is set to 1, the optional Sequence Number field is present in the GRE header
Version Number (bits 13–15): Version Number indicates the GRE implementation version. A value of 0 is typically used for basic GRE implementation. Point-to-
Point Tunneling Protocol (PPTP) uses Version 1

Il campo “Protocol Type” ha lunghezza 2 bytes e contiene il valore del protocollo trasportato (ad esempio per trasportare il protocollo Ethernet utilizza il valore
0x800.
Configurazione GRE Tunnel:
(con le terminazioni del tunnel identificate dall’indirizzo IP dell’interfaccia fisica):

Ex di configurazione GRE Tunnel:


(per il trasporto del traffico multicast non supportato dal router R2 interposto tra R1 e R3)

R1# show run

Ip multicast-routing
!
interface Loopback0
ip address 150.1.2.2 255.255.255.0
!
Interface Loopback1
description * simulating LAN segment*
ip address 172.16.200.1 255.255.255.0
!
interface Tunnel0
ip address 192.168.201.2 255.255.255.0
tunnel source Loopback0
tunnel destination 150.1.3.3
ip pim sparse-dense-mode
ip mtu 1476
!
router ospf 1
network Wan Interface
network 150.1.2.2 0.0.0.0 area 0
!
router eigrp 10  per il trasporto dei routing updates EIGRP nel tunnel GRE (LAN network e indirizzo tunnel)
network 192.168.201.0 0.0.0.255
network 172.16.200.0 0.0.0.255

R3# show run

Ip multicast-routing
!
interface Loopback0
ip address 150.1.3.3 255.255.255.128
!
Interface Loopback1
description * simulating LAN segment*
ip address 10.0.0.1 255.255.255.0
!
interface Tunnel0
ip address 192.168.201.3 255.255.255.0
tunnel source Loopback0
tunnel destination 150.1.2.2
ip pim sparse-dense-mode
ip mtu 1476
!
router ospf 1
network Wan Interface
network 150.1.3.3 0.0.0.0 area 0
!
router eigrp 10
network 192.168.201.0 0.0.0.255
network 10.0.0.0 0.0.0.255

R3# show ip interface brief

Interface IP-Address OK? Method Status Protocol

Serial0/2 144.254.254.3 YES TFTP up up

Serial0/3 unassigned YES NVRAM up down

Virtual-Access1 unassigned YES unset up up

Loopback0 150.1.3.3 YES NVRAM up up

Tunnel0 192.168.201.3 YES manual up up

Potrebbero piacerti anche