搜索
首页运维安全基于IPsec的动态P2P-GRE是怎样的
基于IPsec的动态P2P-GRE是怎样的May 26, 2023 pm 12:21 PM
ipsecp2p-gre

基于IPsec的动态P2P-GRE是怎样的

R1(config)#int f0/0

R1(config-if)#ip add 12.1.1.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#exit

R1(config)#int f0/1

R1(config-if)#ip add 10.1.1.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#exit

R1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2

R3(config)#int f0/0

R3(config-if)#ip add 192.168.1.3 255.255.255.0

R3(config-if)#no sh

R3(config-if)#exit

R3(config)#int f0/1

R3(config-if)#ip address dhcp

R3(config-if)#no sh

R3(config-if)#exit

R3(config)#int loopback 0

R3(config-if)#ip add 3.3.3.3 255.255.255.255

R3(config-if)#exit

说明:在R3连Internet的接口F0/1上开启DHCP动态获得地址,所以F0/1上的IP地址是多少,事先是不知道的,并且创建一个Loopback 0(地址3.3.3.3/32)作为本端p2p GRE隧道的源点地址。

(1)在R1上配置终点为R3的p2p GRE隧道:

R1(config)#interface tunnel 1

R1(config-if)#ip address 1.1.1.1 255.255.255.0

R1(config-if)#tunnel source 12.1.1.1

R1(config-if)#tunnel destination 3.3.3.3

R1(config-if)#exit

R1(config)#ip route 3.3.3.3 255.255.255.255 12.1.1.2

说明:R1到R3的p2p GRE隧道接口号为1,隧道地址为1.1.1.1,隧道的源点为外网接口地址12.1.1.1,而隧道的终点为R3的Loopback 0接口地址3.3.3.3,虽然隧道终点地址在Internet上是不可路由的,但必须写静态路由将3.3.3.3/32指向自己的Internet出口,因为这是配置规则。

R3(config)#int tunnel 3

R3(config-if)#ip address 1.1.1.3 255.255.255.0

R3(config-if)#tunnel source loopback 0

R3(config-if)#tunnel destination 12.1.1.1

R3(config-if)#exit

说明:R3到R1的p2p GRE隧道接口号为3,隧道地址为1.1.1.3,隧道的源点为Loopback 0接口地址3.3.3.3,隧道的终点为R1的外网接口地址12.1.1.1。

R1(config)#crypto isakmp policy 1

R1(config-isakmp)#encryption 3des

R1(config-isakmp)#hash sha

R1(config-isakmp)#authentication pre-share

R1(config-isakmp)#group 2

R1(config-isakmp)#exit

R1(config)#crypto isakmp key 0 cisco123 address 0.0.0.0 0.0.0.0

R1(config)#crypto ipsec transform-set ccie esp-3des esp-sha-hmac

R1(cfg-crypto-trans)#exit

R1(config)#crypto dynamic-map ddd 10

R1(config-crypto-map)#set transform-set ccie

R1(config-crypto-map)#exit

R1(config)#crypto map mymap 10 ipsec-isakmp dynamic ddd

R1(config)#crypto map mymap local-address fastEthernet 0/0

R1(config)#

R1(config)#int f0/0

R1(config-if)#crypto map mymap

R1(config-if)#exit

*Mar 1 00:32:44.307: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON

R1(config)#

说明:静态IP方R1的配置和Dynamic LAN-to-LAN ×××稍微不同之处在于,多了这样一条命令“crypto map mymap local-address fastEthernet 0/0”,因为本实验环境使用的IOS版本高于12.2(13)T,所以Crypto map只在物理接口下应用即可,不需要在GRE隧道接口下应用。

R3(config)#crypto isakmp policy 1

R3(config-isakmp)#encryption 3des

R3(config-isakmp)#hash sha

R3(config-isakmp)#authentication pre-share

R3(config-isakmp)#group 2

R3(config-isakmp)#exit

R3(config)#crypto isakmp key 0 cisco123 address 12.1.1.1

R3(config)#crypto ipsec transform-set ccie esp-3des esp-sha-hmac

R3(cfg-crypto-trans)#exit

R3(config)#access-list 100 permit gre host 3.3.3.3 host 12.1.1.1 R3(config)#

R3(config)#crypto map l2l 1 ipsec-isakmp

R3(config-crypto-map)#set peer 12.1.1.1

R3(config-crypto-map)#set transform-set ccie

R3(config-crypto-map)#match address 100

R3(config-crypto-map)#exit

R3(config)#crypto map l2l local-address f0/1

R3(config)#int f0/1

R3(config-if)#crypto map l2l

R3(config-if)#

*Mar 1 00:32:58.907: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON

R3(config-if)#

说明:动态IP方R3和配置和普通LAN-to-LAN ×××的稍微不同之处在于,多了这样一条命令“crypto map l2l local-address f0/1”,因为本实验环境使用的IOS版本高于12.2(13)T,所以Crypto map只在物理接口下应用即可,不需要在GRE隧道接口下应用。

说明:无论如何发送流量,ISAKMP SA都无法建立,因为在Dynamic p2p GRE over IPsec环境下,必须先从动态IP方向静态IP方发送数据,否则GRE隧道无法建立,×××无法完成。

配置动态路由协议

以上是基于IPsec的动态P2P-GRE是怎样的的详细内容。更多信息请关注PHP中文网其他相关文章!

声明
本文转载于:亿速云。如有侵权,请联系admin@php.cn删除

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前By尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

功能强大的PHP集成开发环境

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

将Eclipse与SAP NetWeaver应用服务器集成。

mPDF

mPDF

mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

SecLists

SecLists

SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。