重溫GRE VPN
GRE VPN(Generic Routing Encapsulation)是指通用路由封裝協定GRE協定。它提供了将一種協定的封包封裝在另一種協定封包中的機制,使封包能夠在tunnel(隧道)中傳輸。

- 支援多種協定和多點傳播
- 能夠用來建立彈性的VPN
- 支援多點隧道
- 缺乏加密機制
- 沒有标準的控制協定來保持GRE隧道(通常使用協定和keepalive)
- 隧道很消耗CPU
- 出現問題要進行DEBUG很困難
- MTU和IP分片是一個問題
Tunnel 是一個虛拟的點對點的連接配接,提供了一條通路使封裝的資料封包能夠在這個通路上傳輸,并且在一個Tunnel 的兩端分别對資料報進行封裝及解封裝。
1️⃣R2、R3運作GRE VPN
2️⃣R2、R3啟用EIGRP協定
3️⃣PC1、PC2通信走GRE隧道
IP位址配置過程與不再贅述
🐑R2配置
interface Ethernet0/0
ip address 12.1.1.2 255.255.255.0
interface Tunnel0
tunnel mode gre ip //預設封裝
ip address 172.16.1.2 255.255.255.0
tunnel source Ethernet0/0 //也可寫IP
tunnel destination 13.1.1.3
router eigrp 1
network 172.16.1.2 0.0.0.0
network 192.168.1.254 0.0.0.0
🐑R3配置
interface Ethernet0/1
ip address 13.1.1.3 255.255.255.0
interface Tunnel0
tunnel mode gre ip
ip address 172.16.1.3 255.255.255.0
tunnel source Ethernet0/0
tunnel destination 12.1.1.2
router eigrp 1
network 172.16.1.3 0.0.0.0
network 192.168.2.254 0.0.0.0
no auto-summary