GRE (Generic Routing Encapsulation) atau IP tunneling (IP encapsulation) adalah teknik enkapsulasi packet IP di dalam packet IP. Lebih mudahnya, dengan GRE kita bisa menciptakan "terowongan" sebagai jalur data khusus untuk meneruskan sebuah packet melalui jaringan komputer, baik itu jaringan komputer pribadi ataupun publik. Jadi, walaupun "terowongan" tadi melewati banyak hop, namun oleh packet ybs dianggap sebagai 1 hop saja, yaitu pintu masuk tunnel dan pintu keluar tunnel.
* Konfigurasinya :
Router>en
Router>enable
Router#conf
Router#configure ter
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fa7/0
Router(config-if)#no sh
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet7/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet7/0, changed state to up
Router(config-if)#interface fa7/0.10
%LINK-5-CHANGED: Interface FastEthernet7/0.10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet7/0.10, changed state to up
Router(config-subif)#enc
Router(config-subif)#encapsulation dt
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q ?
<1-1005> IEEE 802.1Q VLAN ID
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip ad
Router(config-subif)#ip address 70.70.70.1 255.255.255.0
Router(config-subif)#interface fa7/0.20
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet7/0.20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet7/0.20, changed state to up
Router(config-subif)#en
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip ad
Router(config-subif)#ip address 80.80.80.1 255.255.255.0
Router(config-subif)#
Router(config-subif)#interface fa7/0.30
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet7/0.30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet7/0.30, changed state to up
Router(config-subif)#en
Router(config-subif)#encapsulation dot
Router(config-subif)#encapsulation dot1Q 30
Router(config-subif)#ip ad
Router(config-subif)#ip address 90.90.90.1 255.255.255.0