当前位置:文档之家› 项目13-GRE隧道协议[24页]

项目13-GRE隧道协议[24页]

ruijie(config)#interface tunnel 0 ruijie(config-if)#tunnel destination 61.154.101.3
12
项目13 GRE隧道协议
(4)设置Tunnel封装格式(可选)
指定Tunnel封装形式
ruijie(config-if)#tunnel mode { gre |ipip }
10
项目13 GRE隧道协议
(3)设置Tunnel接口目的地址
指定Tunnel目的地址
ruijie(config-if)#tunnel destination ip-address
设备名称为ruijie 处于接口配置模式
11
项目13 GRE隧道协议
在Tunnel 0接口上配置目标的IP 地址 61.154.101.3。
13.2 相关知识 1.GRFra bibliotek工作原理GRE(Generic Routing Encapsulation,通用路由协议封装)是 用于传输三层网络协议的隧道协议。
原始报文的协议被称为乘客协议,GRE 被称为封装协议,而负责转发的IP协议被 称为传输协议。
4
项目13 GRE隧道协议
传输协议 封装协议 乘客协议
设备名称为ruijie 处于接口配置模式
用接口方式指定Tunnel源地址
9
项目13 GRE隧道协议
在Tunnel 0接口上设置命令tunnel source指 定串口2/0为源地址接口。
ruijie(config)#interface tunnel 0 ruijie(config-if)#tunnel source serial 2/0
设备名称为ruijie 处于接口配置模式
13
项目13 GRE隧道协议
在Tunnel 0接口上封装IPIP协议。
ruijie(config)#interface tunnel 0 ruijie(config-if)#tunnel mode ipip
14
项目13 GRE隧道协议
(5)设置认证密码(可选)
ruijie(config)#interface tunnel 1 ruijie(config-if)#ip address 192.168.1.1 255.255.255.0
8
项目13 GRE隧道协议
(2)设置Tunnel接口源地址
用IP地址方式指定Tunnel 源地址
ruijie(config-if)#tunnel source { ip-address | interface-type interface-number }
5
项目13 GRE隧道协议
6
项目13 GRE隧道协议
2.GRE配置命令 (1)创建Tunnel接口
指定接口类型为Tunnel
ruijie(config)#interface tunnel tunnel-number
设备名称为ruijie 处于全局配置模式
接口编号
7
项目13 GRE隧道协议
创建隧道接口Tunnel 1,并设置该接口IP地 址为192.168.1.1。
16
项目13 GRE隧道协议
(6)查看Tunnel接口配置情况
Tunnel接口编号
ruijie#show interfaces tunnel tunnel-number
设备名称为ruijie 处于特权模式
17
项目13 GRE隧道协议
ruijie#show interfaces tunnel 1 Tunnel 1 is UP , line protocol is UP Hardware is Tunnel Interface address is: 1.1.1.1/24 MTU 1500 bytes, BW 9 Kbit Encapsulation protocol is Tunnel, loopback not set Keepalive interval is 0 sec , no set Carrier delay is 0 sec RXload is 1 ,Txload is 1 Tunnel source 192.168.200.200 (FastEthernet 0/0), destination 192.168.200.100
项目13 GRE隧道协议
项目13 GRE隧道协议
知识目标、技能要求 1.了解GRE工作原理; 2.掌握GRE配置技能。
2
项目13 GRE隧道协议
13.1 问题提出
通过公共网络将总公司与分公司连接起来 ,如何实现全网络路由互通,可以通过建 立GRE隧道,实现网络路由信息交换。
3
项目13 GRE隧道协议
18
项目13 GRE隧道协议
3.GRE配置实例
路由器R1与R2之间建立Tunnel,路由器R1背 后的子网202.126.101.0/24与路由器R2背后 的子网67.151.69.0/24通过R1与R2之间的 Tunnel进行通讯。
19
项目13 GRE隧道协议
路由器 R1 的相关配置:
R1(config)#interface Tunnel0 R1(config-if)#ip address 21.21.21.3 255.255.255.0 R1(config-if)#tunnel source 179.208.12.221 R1(config-if)#tunnel destination 179.208.12.55 R1(config-if)#exit
20
项目13 GRE隧道协议
R1(config)#interface FastEthernet0/0 R1(config-if)#ip address 179.208.12.221 255.255.255.0 R1(config-if)#exit R1(config)#interface FastEthernet0/1 R1(config-if)#ip address 202.106.101.2 255.255.255.0
指定Tunnel认证密码
ruijie(config-if)#tunnel key value
设备名称为ruijie 处于接口配置模式
15
项目13 GRE隧道协议
在Tunnel 0接口中设置密钥1234。
ruijie(config)#interface tunnel 0 ruijie(config-if)#tunnel key 1234
相关主题