码迷,mamicode.com
首页 > 其他好文 > 详细

P2P GRE over IPsec

时间:2015-11-18 19:52:03      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:interface   address   policy   source   

技术分享

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 23.1.1.3

R1(config-if)#exit

R3(config)#int tunnel 3

R3(config-if)#ip address 1.1.1.3 255.255.255.0

R3(config-if)#tunnel source 23.1.1.3

R3(config-if)#tunnel destination 12.1.1.1

R3(config-if)#exit

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 23.1.1.3

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

R1(cfg-crypto-trans)#exit

R1(config)#access-list 100 permit gre host 12.1.1.1 host 23.1.1.3 R1(config)#crypto map l2l 1 ipsec-isakmp

R1(config-crypto-map)#set peer 23.1.1.3

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

R1(config-crypto-map)#match address 100 R1(config-crypto-map)#exit

R1(config)#int f0/0 R1(config-if)#crypto map l2l

R1(config-if)#exit

R1(config)#

*Mar 1 00:21:45.171: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON

R1(config)#

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 23.1.1.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)#

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)#

R1(config)#router eigrp 1

R1(config-router)#no auto-summary

R1(config-router)#network 1.1.1.1 0.0.0.0

R1(config-router)#network 10.1.1.1 0.0.0.0

R1(config-router)#exit

R3(config)#router eigrp 1

R3(config-router)#no auto-summary

R3(config-router)#network 1.1.1.3 0.0.0.0

R3(config-router)#network 192.168.1.3 0.0.0.0

R3(config-router)#

说明:IPsec默认的modeTunnel mode,这个应该是大家都不会有疑问的。

1)测试将R3IPsec Mode改为transport mode:

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

R3(cfg-crypto-trans)#mode transport

清除双方SA

R3#clear crypto sa

R3#

说明:改变mode后,清除双方SA以便重新连接

虽然已经将R3IPsec Mode改为transport mode,但还是工作在Tunnel mode,因为对方没有改,只有双方都改时,才会改变最终工作的mode

说明:将双方的IPsec Mode改为transport mode后,最终双方工作在了transport mode,在此还需要强烈说明和提醒,只有在p2p GRE over IPsec的情况下,IPsec Mode的工作模式才能是transport mode,否则即使强制改变双方的modetransport mode,最终双方也会依然工作在Tunnel mode



本文出自 “计算机网络技术” 博客,请务必保留此出处http://370220760.blog.51cto.com/6469179/1714393

P2P GRE over IPsec

标签:interface   address   policy   source   

原文地址:http://370220760.blog.51cto.com/6469179/1714393

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!