路由技术之 ×××家族 GRE隧道
1.GRE介绍
- ××× 技术中的一种,称为通用路由交换协议
- 能够实现互联网中,两个内网网段互通
2.实验目的
- 实现类似上海公司 和 北京公司的内网互通
3.实验拓扑

4.实验配置信息
ip 信息统计 | ||
---|---|---|
R1 上海路由器 | gig0/1 公网接口 | 10.1.1.1 |
gig0/0 内网接口 | 192.168.1.254 | |
tunnel100 | 1.1.1.1 | |
上海内网机器 | ip:192.168.1.1 | sg:192.168.1.254 |
R2 北京路由器 | ||
1.1.1.2 | ||
北京内网机器 | ip:192.168.2.1 | sg:192.168.2.254 |
5.隧道参数解析
- tunnel source:指的是本路由器的互联网出口ip地址(或者出接口)
- tunnel destination:指的是互联网的下一跳IP(即对端路由器的互联网IP)
- 注意:本实验的两端路由器都没有配置默认路由器(0.0.0.0),不要忘记加到达对端的静态路由,隧道两端都需要做。
6.实验配置
- R1上海路由器配置
Router#sh running-config
interface Tunnel100
ip address 1.1.1.1 255.255.255.0
tunnel source GigabitEthernet0/1
tunnel destination 10.1.1.2
tunnel mode gre ip
interface GigabitEthernet0/0
ip address 192.168.1.254 255.255.255.0
duplex auto
speed auto
interface GigabitEthernet0/1
ip address 10.1.1.1 255.255.255.0
duplex auto
speed auto
ip route 192.168.2.0 255.255.255.0 1.1.1.2
Router#
- R2北京路由器配置
Router#show running-config
interface Tunnel100
ip address 1.1.1.2 255.255.255.0
tunnel source GigabitEthernet0/0
tunnel destination 10.1.1.1
tunnel mode gre ip
interface GigabitEthernet0/0
ip address 10.1.1.2 255.255.255.0
duplex auto
speed auto
interface GigabitEthernet0/1
ip address 192.168.2.254 255.255.255.0
duplex auto
speed auto
ip route 192.168.1.0 255.255.255.0 1.1.1.1
Router#
7.实验检测
PC>ipconfig
FastEthernet0 Connection:(default port)
Link-local IPv6 Address.........: FE80::250:FFF:FEA4:393D
IP Address......................: 192.168.1.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.254
PC>tracert 192.168.2.1
Tracing route to 192.168.2.1 over a maximum of 30 hops:
1 1 ms 0 ms 0 ms 192.168.1.254
2 11 ms 0 ms 0 ms 1.1.1.2
3 0 ms 13 ms 15 ms 192.168.2.1
Trace complete.
PC>