【RSR】RSR如何配置GRE | 您所在的位置:网站首页 › 锐捷路由器接口 › 【RSR】RSR如何配置GRE |
功能介绍 GRE(Generic Routing Encapsulation,通用路由封装)协议是对某些网络层协议(如IP 和IPX)的数据报文进行封装,使这些被封装的数据报文能够在另一个网络层协议(如IP)中传输。GRE采用了Tunnel(隧道)技术,是VPN(Virtual Private Network)的第三层隧道协议。 Tunnel 是一个虚拟的点对点的连接,提供了一条通路使封装的数据报文能够在这个通路上传输,并且在一个Tunnel 的两端分别对数据报进行封装及解封装。 应用场景 若总公司和分公司各自的内网之间要能够互相共享资料,并且对数据的安全性要求不高,此时您可以在总公司和分公司的网络设备上建立GRE VPN,它即能实现总公司和分公司之间能够直接互相访问资源。 一、组网需求 两个局域网分别通过出口路由器访问internet,同时要求这两台出口路由器使用GRE隧道实现两个局域网用户间的互访。 二、组网拓扑
三、配置要点 1、配置路由器R1和R2,使R1和R2能够正常访问互联网,并互相能够ping通。 2、在R1配置GRE隧道 3、在R1配置路由,将局域网2网段路由指向GRE隧道 4、在R2配置GRE隧道 5、在R2配置路由,将局域网1网段路由指向GRE隧道 注意:内网1和内网2需要互访的IP网段不能重叠 四、配置步骤 1、配置路由器R1和R2,使R1和R2能够正常访问互联网,并互相能够ping通。 R1: interface Fastethernet 0/0 ip ref ip address 222.100.100.1 255.255.255.252 ip route 0.0.0.0 0.0.0.0 222.100.100.2 R2: interface Fastethernet 0/0 ip ref ip address 222.200.200.1 255.255.255.252 ip route 0.0.0.0 0.0.0.0 222.200.200.2 2、在R1上配置GRE隧道 Ruijie>enable //进入特权模式 Ruijie#configure terminal //进入全局配置模式 Ruijie(config)#interface tunnel 1 Ruijie(config-if-Tunnel 1)# ip address 172.16.100.1 255.255.255.0 //配置GRE隧道地址 Ruijie(config-if-Tunnel 1)#tunnel source 222.100.100.1 //配置GRE隧道源IP(路由器R1的外接口IP) Ruijie(config-if-Tunnel 1)#tunnel destination 222.200.200.1 //配置GRE隧道目的IP(路由器R2的外接口IP) Ruijie(config-if-Tunnel 1)#exit 3、在R1配置路由,将局域网2网段路由指向GRE隧道 Ruijie(config)#ip route 192.168.2.0 255.255.255.0 Tunnel 1 172.16.100.2 //访问192.168.2.0/24的地址,从tunnel 1出去,转发给 172.16.100.2(对端GRE隧道地址) 4、在R2上配置GRE隧道 Ruijie>enable //进入特权模式 Ruijie#configure terminal //进入全局配置模式 Ruijie(config)#interface tunnel 1 Ruijie(config-if-Tunnel 1)# ip address 172.16.100.2 255.255.255.0 //配置GRE隧道地址 Ruijie(config-if-Tunnel 1)#tunnel source 222.200.200.1 //配置GRE隧道源IP(路由器R2的外接口IP) Ruijie(config-if-Tunnel 1)#tunnel destination 222.100.100.1 //配置GRE隧道目的IP(路由器R1的外接口IP) 5、在R2配置路由,将局域网1网段路由指向GRE隧道 Ruijie(config)#ip route 192.168.1.0 255.255.255.0 Tunnel 1 172.16.100.1 //访问192.168.1.0/24的地址,从tunnel 1出去,转发给 172.16.100.1(对端VPN隧道地址)
五、配置验证 1、在内网1的电脑上ping内网2的地址。 C:\Users\Administrator>ping 192.168.2.1 正在 Ping 192.168.2.1 具有 32 字节的数据: 来自 192.168.2.1 的回复: 字节=32 时间=2ms TTL=248 来自 192.168.2.1 的回复: 字节=32 时间=1ms TTL=248 来自 192.168.2.1 的回复: 字节=32 时间=1ms TTL=248 来自 192.168.2.1 的回复: 字节=32 时间=2ms TTL=248
192.168.2.1 的 Ping 统计信息: 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失), 往返行程的估计时间(以毫秒为单位): 最短 = 1ms,最长 = 2ms,平均 = 1ms 2、在路由器上查看GRE隧道状态 Ruijie#show interfaces tunnel 1 Index(dec):11 (hex):b Tunnel 1 is UP , line protocol is UP Hardware is Tunnel Interface address is: 172.16.100.2/24 MTU 1480 bytes, BW 9 Kbit Encapsulation protocol is Tunnel, loopback not set Keepalive interval is no set Carrier delay is 0 sec RXload is 1 ,Txload is 1 Tunnel source 222.200.200.1 (FastEthernet 0/0), destination 222.100.100.1 Tunnel TTL 255 Tunnel protocol/transport IPIP Queueing strategy: FIFO Output queue 0/40, 0 drops; Input queue 0/75, 0 drops 5 minutes input rate 0 bits/sec, 0 packets/sec 5 minutes output rate 0 bits/sec, 0 packets/sec 5 packets input, 500 bytes, 0 no buffer, 0 dropped //有数据包从GRE隧道进入 Received 0 broadcasts, 0 runts, 0 giants 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort 5 packets output, 600 bytes, 0 underruns , 0 dropped //有数据包从GRE隧道出去 0 output errors, 0 collisions, 0 interface resets
|
CopyRight 2018-2019 实验室设备网 版权所有 |