MGRE及实验
tunnel 隧道:一种的简单的VPN技术; 普通的tunnel为点到点网络类型;
生成隧道接口,流量通过路由查询后,若通过隧道接口转发时,需要在原有的三层报头前,再添加一个公有地址间的报头;
将两个仅可以通过WAN通讯的LAN,合成一个;
r1(config)#interface tunnel 0
r1(config-if)#ip address 10.1.1.1 255.255.255.0
r1(config-if)#tunnel source 12.1.1.1
r1(config-if)#tunnel destination 23.1.1.2
切记:建立tunnel,还需要编辑路由表,来将流量引向隧道接口;
MGRE 多点GRE--NBMA网路类型
若需要将多个网络VPN为一个,普通的tunnel将成指数配置接口和路由;
MGRE可以将多个网络通过一条tunnel来实现;
优点:1、每个站点仅需配置一个tunnel接口;所有分支站点ip地址可以动态变化;
2、所有分支节点仅和中心节点建立tunnel,但也可以直接和其他分支站点直接通讯;
原理:1、中心站点,固定的公有ip地址;建议定义为NHRP的server为中心站点;
2、tunnel配置完成,所有的分支站点将自己当下的信息发送到NHRP的server处,生成映射列表;
3、此时中心站点可以直接和所有的分支站点进行GRE通讯;分支站点间直接GRE 通讯时,需要先到NHRP的server处下载映射列表,之后再进行GRE通讯;
中心站点:
r1(config)#interface tunnel 0
r1(config-if)#ip address 10.1.1.1 255.255.255.0
r1(config-if)#tunnel source serial 1/2
r1(config-if)#tunnel mode gre multipoint
r1(config-if)#ip nhrp map multicast dynamic 本地成为NHRP的server;
r1(config-if)#ip nhrp network-id 100 所有站点必须处于同一ID内;
multicast 让本设备在目标地址为组播或广播时,将流量基于表中所有的目标单独发送一次;
分支站点:
r2(config)#interface tunnel 0
r2(config-if)#ip address 10.1.1.2 255.255.255.0
r2(config-if)#tunnel source serial 1/2
r2(config-if)#tunnel mode gre multipoint
r2(config-if)#ip nhrp nhs 10.1.1.1 定义NHRP的server,此处必须为tunnel口地址
r2(config-if)#ip nhrp map 10.1.1.1 15.1.1.1 映射tunnel的公网地址
r2(config-if)#ip nhrp network-id 100
注:以上配置完成后,构建NBMA网络成功;
NBMA是在同一个网段内节点数量不做限制,但是当目标ip地址为组播或广播地址时,流量必须逐一发送到每个节点;
若希望分支节点可以以组播或广播地址为目标ip,那么需要定义流量的具体目标
r2(config-if)#ip nhrp map multicast 15.1.1.1
若在MGRE中运行EIGRP协议,若邻居关系不是全部建立,那么可能由于水平分割导致无法正常共享路由条目;
r1(config)#interface tunnel 0
r1(config-if)#no ip split-horizon eigrp 90
R1:静态配置
R1(config)#int s2/0
R1(config-if)#ip address 14.1.1.2 255.255.255.0
R1(config-if)#no shutdown
R1(config)#int s2/1
R1(config-if)#ip address 15.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#int lo 1
R1(config-if)#ip address 172.16.1.1 255.255.255.0
R1(config)#ip route 0.0.0.0 0.0.0.0 15.1.1.2
R2:静态配置
R2(config)#int s2/2
R2(config-if)#ip address 25.1.1.1 255.255.0
R2(config-if)#no shutdown
R2(config-if)#int lo 1
R2(config-if)#ip address 172.16.2.1 255.255.255.0
R2(config)#ip route 0.0.0.0 0.0.0.0 25.1.1.2
R3:静态配置
:R3(config)#int s2/3
R3(config-if)#ip address 35.1.1.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#int lo 1
R3(config-if)#ip address 172.16.3.1 255.255.255.0
R3(config)#ip route 0.0.0.0 0.0.0.0 35.1.1.2
R5(ISP):静态配置
R5(config)#int s2/1
R5(config-if)#ip address 15.1.1.2 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#int s2/2
R5(config-if)#ip address 25.1.1.2 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#int s2/3
R5(config-if)#ip address 35.1.1.2 255.255.255.0
R5(config-if)#no shutdown
R3(config-if)#int lo 1
R3(config-if)#ip address 172.16.5.1 255.255.255.0
R4:静态配置
R4(config)#int s2/0
R4(config-if)#ip address 14.1.1.1 255.255.255.0
R4(config-if)#int lo 1
R4(config-if)#ip address 172.16.4.1 255.255.255.0
MGRE环境配置:
R1(中心站点):
R1(config)#int tun 1
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#tunnel source s2/1
R1(config-if)#tunnel mode gre multipoint
R1(config-if)#ip nhrp map multicast dynamic
R1(config-if)#ip nhrp network-id 100
R2(分支站点):
R2(config)#int tun 1
R2(config-if)#ip address 10.1.1.2 255.255.255.0
R2(config-if)#tunnel source s2/2
R2(config-if)#tunnel mode gre multipoint
R2(config-if)#ip nhrp nhs 10.1.1.1
R2(config-if)#ip nhrp map 10.1.1.1 15.1.1.1
R2(config-if)#ip nhrp network-id 100
R3(分支站点):
R2(config)#int tun 1
R2(config-if)#ip address 10.1.1.3 255.255.255.0
R2(config-if)#tunnel source s2/3
R2(config-if)#tunnel mode gre multipoint
R2(config-if)#ip nhrp nhs 10.1.1.1
R2(config-if)#ip nhrp map 10.1.1.1 15.1.1.1
R2(config-if)#ip nhrp network-id 100
分支站点R2,R3开启伪广播
R2(config)#int tun 1
R2(config-if)#ip nhrp map multicast 15.1.1.1
R3(config)#int tun 1
R3(config-if)#ip nhrp map multicast 15.1.1.1
关闭水平分割
R1(config)#int tun 1
R1(config-if)#no ip split-horizon ei
R1(config-if)#no ip split-horizon eigrp 100
运行EIGRP协议:
R1(config)#router eigrp 100
R1(config-router)#no auto-summary
R1(config-router)#network 172.16.1.0
R1(config-router)#network 10.0.0.0
R2(config)#router eigrp 100
R2(config-router)#no auto-summary
R2(config-router)#network 172.16.2.0
R2(config-router)#network 10.0.0.0
R3(config)#router eigrp 100
R3(config-router)#no auto-summary
R3(config-router)#network 172.16.3.0
R3(config-router)#network 10.0.0.0
R4(config)#router eigrp 100
R4(config-router)#no auto-summary
R4(config-router)#network 14.1.1.0
R4(config-router)#network 172.16.4.0
R1上做NAT:
R1(config)#access-list 1 permit 14.0.0.0 0.255.255.255
R1(config)#ip nat inside source list 1 int s2/1 overload
R1(config)#int s2/0
R1(config-if)#ip nat inside
R1(config-if)#int s2/1
R1(config-if)#ip nat outside
1、认证
1)接口认证
【1】接口明文
r1(config)#interface s1/1 连接邻居的接口上配置
r1(config-if)#ip ospf authentication 开启接口明文认证需要,开启后本地hello包中认证类型字段被修改,若邻居间不一致,将无法建立邻居关系
r1(config-if)#ip ospf authentication-key cisco 定义明文认证的秘钥
【2】接口密文
r2(config)#interface s1/1
r2(config-if)#ip ospf authentication message-digest 开启密文认证需要
r2(config-if)#ip ospf message-digest-key 1 md5 cisco123 配置秘钥及编号
2)区域认证---例:在R1上开启关于区域0的明文或密文认证;实际就是在R1上所有的区域0接口配置了明文或密文的认证需求,修改了认证类型字段而已
接口的秘钥还需要到各个接口上逐一匹配
r2(config)#router ospf 1
r2(config-router)#area 1 authentication 区域明文
r2(config-router)#area 1 authentication message-digest 区域密文
3)虚链路认证
r2(config-router)#area 1 virtual-link 4.4.4.4 authentication 先开启明文认证需求
r2(config-router)#area 1 virtual-link 4.4.4.4 authentication-key cisco 在配明文认证密码
密文认证
r2(config-router)#area 1 virtual-link 4.4.4.4 authentication message-digest
r2(config-router)#area 1 virtual-link 4.4.4.4 message-digest-key 1 md5 cisco123
chap认证
R5(主认证方):
R5(config)#int s2/1
R5(config-if)#encapsulation ppp
R5(config-if)#ppp authentication chap
R5(config)#username bt password 123
R1(被认证方):
R1(config)#int s2/1
R1(config-if)#encapsulation ppp
R1(config-if)#ppp chap hostname LN
R1(config-if)#ppp chap password 5486
MGRE及实验的更多相关文章
- MGRE综合实验
实验要求: 实验拓扑: 一. R1-2-3构建星型结构的MGRE结构,R1为中心站点,假设R1的共有IP为固定地址 1. 配置IP地址 2. 配置缺省 3. 配置MGRE环境 在中心站点上: 在分支站 ...
- MGRE实验--内网为OSPF
实验要求: R2为ISP,只能配置IP地址 R1.R3.R4之间构建MGRE环境,仅R1IP地址固定 内网使用OSPF获取路由,全网可达 拓扑: 1.配置IP地址 2.配置缺省 3.配置MGRE环境 ...
- 华为---MGRE实验--内网为RIP
数据链路层封装技术总结: 实验要求与拓扑: 1. 配置IP地址 公网IP地址:12.1.1.0/24.23.1.1.0/24.24.1.1.0/24 tunnel地址:1.1.1.1/24.1.1.1 ...
- OSPF综合实验
实验要求: 1.R4为ISP,其上只能配置IP地址,R4与其他所有直连设备间使用共有IP 2.R3--R5/6/7为MGRE环境,R3为中心站点 3.整个OSPF环境IP地址为172.16.0.0/1 ...
- CCNP之OSPF实验报告
OSPF实验报告 一.实验要求 1.R4为ISP,其上只能配置IP地址:R4与其它所有直连设备间使用公有IP2.R3--R5/6/7为MGRE环境,R3为中心站点3.整个OSPF环境IP地址为172. ...
- CCNP之MERG实验报告
MGRE实验报告 一.实验要求: 1.R5为ISP,只能配置IP地址 2.R1--R3间建立MGRE环境,且使用EIGRP来学习各自环回 3.R4可以正常访问R5的环回 4.R1与R5进行chap认证 ...
- [原] 利用 OVS 建立 VxLAN 虚拟网络实验
OVS 配置 VxLAN HOST A ------------------------------------------ | zh-veth0(10.1.1.1) VM A | | ---|--- ...
- Android中Activity的四大启动模式实验简述
作为Android四大组件之一,Activity可以说是最基本也是最常见的组件,它提供了一个显示界面,从而实现与用户的交互,作为初学者,必须熟练掌握.今天我们就来通过实验演示,来帮助大家理解Activ ...
- SEED实验系列文章目录
美国雪城大学SEEDLabs实验列表 SEEDLabs是一套完整的信息安全实验,涵盖本科信息安全教学中的大部分基本原理.项目组2002年由杜文亮教授创建,目前开发了30个实验,几百所大学已采用.实验楼 ...
随机推荐
- Linux图形界面安装Oracle11G(Centos7)
以Centos7为列 创建运行Oracle数据库的系统用户和用户组 #切换root用户 [px@localhost /]$ su - root [px@localhost /]$ su - root ...
- python官网打不开
这可能是因为该站点使用过期的或不安全的 TLS 安全设置. 解决:依次打开IE的Internet选项.高级,往下拉,找到安全模块,勾上四个使用:使用SSL 3.0.使用TLS 1.0.使用TLS 1. ...
- 2个案例带你快速实现Response返回值
今天先来学习一下Response的相关知识. 所有返回前台的内容其实都应该是Response的对象或者其子类,我们看到如果返回的是字符串直接可以写成return u'字符串内容'的形式,但是其实这个字 ...
- C++入门记-大纲
缘来 由于某个不可告人的目标以及想趁着还有精力的年龄,开始了C++学习之路.C++ 诞生很多年了,但依然具有强大的生命力. 我们来看下2020年8月TIOBE 8 月编程语言排行榜. 可以看到C以及C ...
- Android开发之java代码中获取当前系统的时间工具类
/** * 获取当前时间 * * @return */ public String getTime() { Date date = new Date();// 创建一个时间对象,获取到当前的时间 Si ...
- Java 实例 - 三目条件运算符
package guyu.day0903; /** * @Author: Fred * @Date: 2020/9/3 10:59 */ public class Demo01 { public st ...
- Redis锁实现防重复提交和并发问题
@Slf4j @Component public class RedisLock { public static final int LOCK_EXPIRE = 5000; @Autowired pr ...
- MySQL 增删查改 必知必会
MySQL 数据库中的基础操作 3.表的修改 对表的表名.字段.字段类型.字段长度.约束等进行修改. 3.1 表的名称修改 -- 语法: ALTER TABLE 库名.表名 RENAME TO 新表名 ...
- 【小白学PyTorch】6 模型的构建访问遍历存储(附代码)
文章转载自微信公众号:机器学习炼丹术.欢迎大家关注,这是我的学习分享公众号,100+原创干货. 文章目录: 目录 1 模型构建函数 1.1 add_module 1.2 ModuleList 1.3 ...
- SSM框架中添加写日志功能
前提:要导入log4j的jar包 在web.xml中输入: <!--日志加载--> <context-param> <param-name>log4jConfigL ...