采用积极模式并PSK的IPsec VPN配置

安全
对于IPsec VPN的概念我们已经有所了解了,那么对其配置我们还是需要掌握一下。所以现在我们就来讲解一下有关于IPsec VPN配置的内容。

在前面篇中,我们介绍了基于PSK的IPsec VPN配置的相关信息,接下来,我们继续讲解关于采用积极模式并PSK的IPsec VPN配置的内容。

采用积极模式并PSK的IPsec VPN配置

1.R1基本配置:

  1. R1(config)#interface loopback0  
  2. R1(config-if)#ip address 10.1.1.1 255.255.255.0  
  3. R1(config-if)#no shutdown  
  4. R1(config-if)#interface serial0/0  
  5. R1(config-if)#ip address  192.168.1.1 255.255.255.252  
  6. R1(config-if)#clock rate 56000  
  7. R1(config-if)#no shutdown  
  8. R1(config-if)#exit 

2.定义感兴趣流量与路由协议:

  1. R1(config)#access-list 100 permit ip 10.1.1.0 0.0.0.255 10.2.2.0 0.0.0.255  
  2. R1(config)#ip route 0.0.0.0 0.0.0.0 serial0/0  

3.全局启用ISAKMP并定义对等体及其PSK(预共享密钥),采用积极模式:

  1. R1(config)#crypto isakmp enable  
  2. R1(config)#crypto isakmp peer address 192.168.1.2  
  3. R1(config-isakmp-peer)#set aggressive-mode client-endpoint ipv4-address 192.168.1.1  
  4. R1(config-isakmp-peer)#set aggressive-mode password 91lab  

4.定义IKE策略:

  1. R1(config)#crypto isakmp policy 10  
  2. R1(config-isakmp)#encryption aes 128     /---默认是DES加密---/  
  3. R1(config-isakmp)#hash sha            /---默认是SHA-1---/  
  4. R1(config-isakmp)#authentication pre-share  
  5. R1(config-isakmp)#group 2             /---默认是768位的DH1---/  
  6. R1(config-isakmp)#lifetime 3600        /---默认是86400秒---/  
  7. R1(config-isakmp)#exit  

5.定义IPSec转换集(transform set):

  1. R1(config)#crypto ipsec transform-set tt esp-aes 128 esp-sha-hmac  
  2. R1(cfg-crypto-trans)#mode tunnel  
  3. R1(cfg-crypto-trans)#exit  

6.定义crypto map并应用在接口上:

  1. R1(config)#crypto map cisco 10 ipsec-isakmp  
  2. R1(config-crypto-map)#match address 100  
  3. R1(config-crypto-map)#set peer 192.168.1.2     /---定义要应用crypto map的对等体地址---/  
  4. R1(config-crypto-map)#set transform-set tt     /---定义crypto map要应用的IPsec转换集---/  
  5. R1(config-crypto-map)#exit  
  6. R1(config)#interface serial0/0  
  7. R1(config-if)#crypto map cisco  
  8. *Mar  1 00:08:31.131: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON  
  9. R1(config-if)#end  
  10. R1#  

R1配置完成.

同理,R2配置如下:

  1. !  
  2. !  
  3. crypto isakmp policy 10  
  4. encr aes  
  5. authentication pre-share  
  6. group 2  
  7. !  
  8. crypto isakmp peer address 192.168.1.1  
  9. set aggressive-mode password 91lab  
  10. set aggressive-mode client-endpoint ipv4-address 192.168.1.1  
  11. !  
  12. !  
  13. crypto ipsec transform-set tt esp-aes esp-sha-hmac  
  14. !  
  15. crypto map cisco 10 ipsec-isakmp  
  16. set peer 192.168.1.1  
  17. set transform-set tt  
  18. match address 100  
  19. !  
  20. !  
  21. !  
  22. !  
  23. interface Loopback0  
  24. ip address 10.2.2.1 255.255.255.0  
  25. !  
  26. interface Serial0/0  
  27. ip address 192.168.1.2 255.255.255.252  
  28. crypto map cisco  
  29. !  
  30. ip route 0.0.0.0 0.0.0.0 Serial0/0  
  31. !  
  32. access-list 100 permit ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255  
  33. !  

 

责任编辑:佟健 来源: 51CTO整理
相关推荐

2011-11-25 11:23:29

IPsec VPNIPsec VPN配置

2011-11-29 16:08:30

IPsec VPN

2011-11-25 13:24:56

2011-11-29 14:50:19

IPSecVPN

2011-11-25 13:49:17

2011-11-29 13:23:29

2009-12-30 11:12:13

VPN配置说明书

2011-11-25 14:15:02

IPsec VPNIPsec VPN配置

2011-11-25 13:34:56

IPsec VPNIPsec VPN协议

2011-11-25 14:01:05

VPNVPN设置IPsec VPN

2010-12-15 11:24:35

2012-09-28 09:44:32

2011-11-29 12:13:21

VPN

2012-09-26 09:49:44

2011-11-29 12:27:54

2011-11-07 10:49:16

IPsec VPNMPLS VPN

2012-09-27 13:12:17

2011-05-30 09:27:44

2011-11-29 13:42:55

2011-11-29 12:17:00

点赞
收藏

51CTO技术栈公众号