实验说明:GRE(Generic Routing Encapsulation,通用路由封装协议)是对某些网络层协议(如IP和IPX)的数据报文进行封装,使这些被封装的数据报文能够在另一个网络层协议(如IP)中传输。GRE采用了Tunel(隧道)技术,是VPN(Virtual Private Network)的第三层隧道协议。Tunnel是一个虚拟的点对点连接,提供了一条通道使封装的数据报文能够在这个通路上传输,并且在一个Tunnel的两端分别对数据进行封装及解封装,一个X协议的报文要想穿越IP网络在Tunnel中传输,必须要经过封装与解封装的过程。
R1的配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | interface Loopback0 ip address 192.168.1.1 255.255.255.0 ! interface Tunnel0 ip address 1.1.1.1 255.255.255.0 tunnel source Serial1/0 tunnel destination 23.1.1.1 ! interface Serial1/0 ip address 12.1.1.1 255.255.255.0 serial restart-delay 0 ! router rip version 2 network 12.0.0.0 no auto-summary ! ip route 192.168.2.0 255.255.255.0 1.1.1.2 ! |
R2的配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | interface Serial1/0 ip address 12.1.1.2 255.255.255.0 serial restart-delay 0 clock rate 64000 ! interface Serial1/1 ip address 23.1.1.2 255.255.255.0 serial restart-delay 0 clock rate 64000 ! router rip version 2 network 12.0.0.0 network 23.0.0.0 no auto-summary ! |
R3的配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | interface Loopback0 ip address 192.168.2.1 255.255.255.0 ! interface Tunnel0 ip address 1.1.1.2 255.255.255.0 tunnel source Serial1/1 tunnel destination 12.1.1.1 ! interface Serial1/1 ip address 23.1.1.1 255.255.255.0 serial restart-delay 0 ! router rip version 2 network 23.0.0.0 no auto-summary ! |