当前位置: 首页 > article >正文

DSVPN简介与应用

目录

简介

DSVPN

封装模式

Nomal(动态)方式建立DSVPN

一、配置缺省包过滤

二、划分区域(以总部为例)

三、配置IP地址(以R1为例)

四、配置DSVPN

简介

DSVPN

DSVPN(Dynamic Secure Virtual Private Network)动态智能VPN,应用于IP地址动态变化的网关之间建立VPN隧道技术,可以解决分部与分部间相互通信的需求。

方式一:分部与分部通过总部中转的方式,来实现通信。

方式二:分部与分部之间直接建立VPN隧道,来实现通信。

DSVPN组网方式:中心节点Hub,分支节点Spoke。分别在Hub与Spoke之间建立动态与静态的MGRE隧道。

封装模式

DSVPN采用封装协议GRE,传统的GRE是采用点对点(P2P)网络,而DSVPN是在GRE的基础上支持点到多点(P2MP)网络。

Nomal(全网学习)方式建立DSVPN(动态路由协议)

所有的tunnel地址必须在同一网段内,这样报文才能通过MGRE隧道的Tunnel接口发送出去。

一、配置缺省包过滤

#
security-policy
 default action permit
#

二、划分区域(以总部为例)

[Hub]display zone 
2024-10-17 12:04:09.520 
local
 priority is 100
 interface of the zone is (0):
#
trust
 priority is 85
 interface of the zone is (1):
    GigabitEthernet0/0/0
#
untrust
 priority is 5
 interface of the zone is (1):
    GigabitEthernet1/0/0
#
dmz
 priority is 50
 interface of the zone is (1):
    Tunnel1
#

三、配置IP地址(以R1为例)

<R1>display ip in b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              3.3.3.4/24           up         up        
GigabitEthernet0/0/1              1.1.1.4/24           up         up        
GigabitEthernet0/0/2              2.2.2.4/24           up         up        
NULL0                             unassigned           up         up(s) 
Virtual-if0                       unassigned           up         up(s)   

四、配置DSVPN

Hub

#
interface Tunnel1
 ip address 10.1.1.3 255.255.255.0
 tunnel-protocol gre p2mp     ## 指定隧道协议为GRE,并支持点对多点的连接
 source GigabitEthernet1/0/0  ##指定该GRE隧道使用的源接口
 ospf network-type broadcast  ##配置OSPF网络类型为广播模式
 nhrp entry multicast dynamic ##生成组播成员列表
#
return
#
ospf 1 router-id 3.3.3.3
 area 0.0.0.0
  network 10.1.1.0 0.0.0.255
  network 192.168.3.0 0.0.0.255
#
return
#
ip route-static 0.0.0.0 0.0.0.0 3.3.3.4  ##配置默认路由指向路由器
#

Spoke_A

#
interface Tunnel1
 ip address 10.1.1.1 255.255.255.0
 tunnel-protocol gre p2mp
 source GigabitEthernet1/0/0
 ospf network-type broadcast
 ospf dr-priority 0  ##降低该优先级是Hub成为DR
 nhrp entry multicast dynamic
 nhrp entry 10.1.1.3 3.3.3.3 register  
##将IP地址10.1.1.3与下一跳IP地址3.3.3.3注册到NHRP。
#
return
#
ospf 1 router-id 1.1.1.1
 area 0.0.0.0
  network 10.1.1.0 0.0.0.255
  network 192.168.1.0 0.0.0.255
#
return
#
ip route-static 0.0.0.0 0.0.0.0 1.1.1.4
#

Spoke_B

#
interface Tunnel1
 ip address 10.1.1.2 255.255.255.0
 tunnel-protocol gre p2mp
 source GigabitEthernet1/0/0
 ospf network-type broadcast
 ospf dr-priority 0
 nhrp entry multicast dynamic
 nhrp entry 10.1.1.3 3.3.3.3 register
#
return
#
ospf 1 router-id 2.2.2.2
 area 0.0.0.0
  network 10.1.1.0 0.0.0.255
  network 192.168.2.0 0.0.0.255
#
return
#
ip route-static 0.0.0.0 0.0.0.0 2.2.2.4
#

五、查看nhrp是否建立成功

六、Normal方式的DSVPN原理

Hub与Spoke建立静态隧道

  1. Spoke向Hub发送NHRP注册消息,消息包含自身的Tunnel地址与公网地址
  2. Hub注册并提取Spoke的Tunnel地址与公网地址,初始化NHRP映射表。

Spoke与Spoke建立动态隧道

  1. 隧道接口下配置OSPF动态协议,能够学习到对方的路由。
  2. 在Spoke与Spoke触发流量,建立动态隧道

七、查看路由表

发现192.168.2.0/24的路由的下一条地址指向分部2的tunnel地址,其公网接口地址为2.2.2.2。

Shortcut (路由汇聚)方式建立DSVPN(动态路由协议)

只需要在上面Nomal方式下,把OSPF网络改成P2MP,在Hub配置应该重定向,Spoke配置隧道方式改成shortcut

Spoke

#
interface Tunnel1
 ospf network-type p2mp
 nhrp shortcut
#

Hub

#
interface Tunnel1
 ospf network-type p2mp
 nhrp redirect

一、Shortcut 方式的DSVPN原理

查看Spoke 1路由信息

之前的ospf网络类型是 broadcast ,源spoke到达目的spoke私网路由的下一条会指向目的spoke的tunnel接口地址。而现在的网络类型为P2MP,源spoke到达目的spoke私网路由的下一条路由都指向了Hub的tunnel地址。

Nomal(全网学习)方式建立DSVPN(静态路由协议)

Hub

#
ip route-static 0.0.0.0 0.0.0.0 3.3.3.4  ##用于到达各公网的tunnel默认路由
ip route-static 192.168.1.0 255.255.255.0 10.1.1.1  ##配置到达Spoke私网路由,下一跳为tunnel地址
ip route-static 192.168.2.0 255.255.255.0 10.1.1.2
#
interface Tunnel1
 ip address 10.1.1.3 255.255.255.0
 tunnel-protocol gre p2mp
 source GigabitEthernet1/0/0
#

Spoke_A

#
interface Tunnel1
 ip address 10.1.1.1 255.255.255.0
 tunnel-protocol gre p2mp
 source GigabitEthernet1/0/0
 nhrp entry 10.1.1.3 3.3.3.3 register
#
ip route-static 0.0.0.0 0.0.0.0 1.1.1.4
ip route-static 192.168.2.0 255.255.255.0 10.1.1.2
ip route-static 192.168.3.0 255.255.255.0 10.1.1.3
#

Spoke_B

#
interface Tunnel1
 ip address 10.1.1.2 255.255.255.0
 tunnel-protocol gre p2mp
 source GigabitEthernet1/0/0
 nhrp entry 10.1.1.3 3.3.3.3 register
#
return
#
ip route-static 0.0.0.0 0.0.0.0 2.2.2.4
ip route-static 192.168.1.0 255.255.255.0 10.1.1.1
ip route-static 192.168.3.0 255.255.255.0 10.1.1.3
#

查看路由表与NHRP映射表信息和检验结果

 

 Shortcut (路由汇聚)方式建立DSVPN(静态路由协议)

Hub

ip route-static 192.168.1.0 255.255.255.0 10.1.1.1
ip route-static 192.168.2.0 255.255.255.0 10.1.1.2
ip route-static 0.0.0.0 0.0.0.0 3.3.3.4
#
interface Tunnel1
 ip address 10.1.1.3 255.255.255.0
 tunnel-protocol gre p2mp
 source GigabitEthernet1/0/0
 nhrp redirect  ##消息重定向
#

Spoke_A

ip route-static 192.168.0.0 16 10.1.1.3
ip route-static 0.0.0.0 0.0.0.0 1.1.1.4
#
interface Tunnel1
 ip address 10.1.1.1 255.255.255.0
 tunnel-protocol gre p2mp
 source GigabitEthernet1/0/0
 nhrp shortcut  ##隧道建立方式
 nhrp entry 10.1.1.3 3.3.3.3 register
#

Spoke_B

ip route-static 192.168.0.0 16 10.1.1.3
ip route-static 0.0.0.0 0.0.0.0 1.1.1.4
#
interface Tunnel1
 ip address 10.1.1.2 255.255.255.0
 tunnel-protocol gre p2mp
 source GigabitEthernet1/0/0
 nhrp shortcut
 nhrp entry 10.1.1.3 3.3.3.3 register
#

查看路由表与NHRP映射表


http://www.kler.cn/news/362279.html

相关文章:

  • 折腾记:arm上的mono和.net
  • three.js 使用geojson ,实现中国地图区域,边缘流动效果
  • 计算机专业大学四年的学习路线(非常详细),零基础入门到精通,看这一篇就够了
  • SpringBoot实现的汽车票在线预订系统
  • 写一个 qq自动回话的程序
  • verilog实现一个5bit序列检测器
  • Stable Diffusion Web UI 大白话术语解释 (二)
  • 中小型医院网站:Spring Boot开发技巧
  • 【Jmeter】jmeter指定jdk版本启动
  • 利用grid sample优化BevDet
  • ACM CCS 2024现场直击:引爆通信安全新纪元
  • 通过conda install -c nvidia cuda=“11.3.0“ 安装低版本的cuda,但是却安装了高版本的12.4.0
  • PHP 任务管理:跨行业的科技驱动力量
  • rabbitmq 工作队列模式
  • Cloudera Hue深度解析:安装、配置到高级用法
  • 请求第三方接口有反斜杠和双引号怎么处理,且做格式校验?
  • 九、pico+Unity交互开发——触碰抓取
  • ABAP 静态与动态搜索帮助
  • 太速科技-426-基于XC7Z100+TMS320C6678的图像处理板卡
  • Leetcode 3200. 三角形的最大高度
  • 滑动窗口数据采集
  • [漏洞挖掘与防护] 04.Windows系统安全缺陷之5次Shift漏洞启动计算机机理分析
  • java设计模式--行为型模式
  • 【Linux】磁盘文件系统(inode)、软硬链接
  • “避免序列化灾难:掌握实现 Serializable 的真相!(二)”
  • 优化UVM环境(九)-将interface文件放在env pkg外面