GRE隧道的配置

GRE隧道的配置

1,构建如图所示拓扑图;

2,分别为5台路由器配置IP地址,将R2R3模拟为外网与内网的边界路由器,R1------R2属于分支1R4----R5属于分支2。在分支1和分支2内采用OSPF协议,在外网采用EIGRP协议。

3,对R2开启GPE隧道,配置如下

R2#conf

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#interface tunnel 0

R2(config-if)#tunnel source 23.23.23.1              

R2(config-if)#tunnel destination 34.34.34.2

R2(config-if)#ip address 24.24.24.1 255.255.255.0

R2(config-if)#exit

R2上通告新的OSPF网段

R2(config)#router ospf 10

R2(config-router)#network 24.24.24.0 0.0.0.255 area 0

4,对R4开启GPE隧道,配置如下

R4(config)#interface tunnel 0

R4(config-if)#tunnel source 34.34.34.2          /*源地址目的地址对换*/            

R4(config-if)#tunnel destination 23.23.23.1

R4(config-if)#ip address 24.24.24.2 255.255.255.0

R4(config-if)#exit

R4上通告新的OSPF网段

R4(config)#router ospf 10

R4(config-router)#network 24.24.24.0 0.0.0.255 area 0

5,配合wireshark转包软件来说明数据包从分支1到分支2整个过程中协议的封装转换

通过测试,R1能顺利通过GRE隧道到达分支2

     由此可见,IP数据包在边界路由器进行了再次封装,改变了其源IP地址和目的IP地址。






發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章