IPsec VPN配置:IPsec VPN的高可用性

安全
对于IPsec VPN的基本配置我们已经有一个大概的了解了,那么这篇文章我们主要讨论IPsec VPN的高可用性及其相关配置。

通常情况下,我们希望IPsec VPN流量可以在主从路由器之间做到无缝切换,可以通过HSRP与SSO相结合的方式来达到此目的.HSRP用于保证接入流量的热备份.一旦主路由器down掉后,HSRP立即将IKE信息与SA传递给备份路由器;而SSO允许主从路由器之间共享IKE与SA信息.

IPsec VPN配置:IPsec VPN的高可用性

SPOKE配置如下:

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

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

2.全局启用ISAKMP并定义对等体及其PSK(预共享密钥):

  1. SPOKE(config)#crypto isakmp enable   
  2. SPOKE(config)#crypto isakmp key 91lab address 0.0.0.0 0.0.0.0 

3.定义IKE策略:

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

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

  1. SPOKE(config)#crypto ipsec transform-set nuaiko esp-aes 128 esp-sha-hmac   
  2. SPOKE(cfg-crypto-trans)#exit 

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

  1. SPOKE(config)#crypto map ccsp 10 ipsec-isakmp   
  2. SPOKE(config-crypto-map)#match address 100       
  3. SPOKE(config-crypto-map)#set peer 16.1.1.254    /---定义crypto map的对等体地址,这里为对端HSRP的虚拟IP地址---/  
  4. SPOKE(config-crypto-map)#set transform-set nuaiko     /---定义crypto map要应用的IPsec转换集---/  
  5. SPOKE(config-crypto-map)#exit  
  6. SPOKE(config)#interface serial0/0  
  7. SPOKE(config-if)#crypto map ccsp  
  8.  
  9. *Mar  1 00:08:31.131: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON  
  10.  
  11. SPOKE(config-if)#end  
  12. SPOKE# 

SPOKE配置完成.

HUB1配置如下:

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

  1. HUB1(config)#access-list 100 permit ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255  
  2. HUB1(config)#ip route 0.0.0.0 0.0.0.0 16.1.1.3  

2.全局启用ISAKMP并定义对等体及其PSK(预共享密钥):

  1. HUB1(config)#crypto isakmp enable   
  2. HUB1(config)#crypto isakmp key 91lab address 0.0.0.0 0.0.0.0 

3.定义IKE策略:

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

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

  1. HUB1(config)#crypto ipsec transform-set nuaiko esp-aes 128 esp-sha-hmac   
  2. HUB1(cfg-crypto-trans)#exit 

5.定义crypto map:

  1. HUB1(config)#crypto map ccsp 10 ipsec-isakmp   
  2. HUB1(config-crypto-map)#match address 100       
  3. HUB1(config-crypto-map)#set peer 173.1.1.1    /---定义要应用crypto map的对等体地址---/  
  4. HUB1(config-crypto-map)#set transform-set nuaiko     /---定义crypto map要应用的IPsec转换集---/  
  5. HUB1(config-crypto-map)#exit 

6.启用HSRP并应用crypto map:

  1. HUB1(config)#interface ethernet 0/0  
  2. HUB1(config-if)#standby 1 ip 16.1.1.254      /---定义HSRP组1的虚拟IP地址---/  
  3. HUB1(config-if)#standby 1 priority 105  
  4. HUB1(config-if)#standby 1 preempt              /---启用抢占特性---/  
  5.  
  6. *Mar  1 00:45:37.987: %HSRP-6-STATECHANGE: Ethernet0/0 Grp 1 state Speak -> Standby  
  7. *Mar  1 00:45:37.987: %HSRP-6-STATECHANGE: Ethernet0/0 Grp 1 state Standby -> Active  
  8.  
  9. HUB1(config-if)#standby 1 name ss1                       /---定义HSRP冗余组名---/  
  10. HUB1(config-if)#standby 1 track ethernet 0/1          /---定义HSRP接口跟踪特性---/  
  11. HUB1(config-if)#crypto map ccsp redundancy ss1 stateful        /---应用crypto map,并定义备份IPsec对等体---/  
  12.  
  13. *Mar  1 00:46:47.591: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON  
  14.  
  15. HUB1(config-if)#standby delay reload 120                  /---定义HSRP组初始化的延迟间隔,官方建议120秒---/  
  16. HUB1(config)#interface ethernet 0/1  
  17. HUB1(config-if)#standby 2 ip 10.2.2.254     
  18. HUB1(config-if)#standby 2 preempt   
  19.  
  20. *Mar  1 00:49:20.791: %HSRP-6-STATECHANGE: Ethernet0/1 Grp 2 state Speak -> Standby  
  21. *Mar  1 00:49:20.791: %HSRP-6-STATECHANGE: Ethernet0/1 Grp 2 state Standby -> Active  
  22.  
  23. HUB1(config-if)#standby 2 track ethernet 0/0  
  24. HUB1(config-if)#standby 2 name ss2 

7.启用基于状态的转换SSO:

  1. HUB1(config)#redundancy inter-device  
  2. HUB1(config-red-interdevice)#scheme standby ss2  
  3. HUB1(config-red-interdevice)#exit  
  4. HUB1(config)#ipc zone default  
  5. HUB1(config-ipczone)#association 1  
  6. HUB1(config-ipczone)#no shutdown  
  7. HUB1(config-ipczone-assoc)#protocol sctp   
  8. HUB1(config-ipc-protocol-sctp)#local-port 5000  
  9. HUB1(config-ipc-local-sctp)#local-ip 10.2.2.1  
  10. HUB1(config-ipc-local-sctp)#exit  
  11. HUB1(config-ipc-protocol-sctp)#remote-port 5000   
  12. HUB1(config-ipc-remote-sctp)#remote-ip 10.2.2.2 

同理,HUB2相关配置如下:

  1. !   
  2. crypto isakmp policy 10  
  3. encr aes  
  4. authentication pre-share  
  5. group 2  
  6. crypto isakmp key cisco1234 address 0.0.0.0 0.0.0.0  
  7. !  
  8. crypto ipsec transform-set nuaiko esp-aes esp-sha-hmac  
  9. !  
  10. crypto map cisco 10 ipsec-isakmp  
  11. set peer 173.1.1.2  
  12. set transform-set ccsp  
  13. match address 100  
  14. !  
  15. interface ethernet 0/0  
  16. standby 1 ip 16.1.1.254  
  17. standby 1 priority 105  
  18. standby 1 preempt  
  19. standby 1 name ss1  
  20. standby 1 track ethernet 0/0  
  21. crypto map cisco redundancy ss1 stateful  
  22. standby delay reload 120  
  23. !  
  24. interface ethernet 0/1  
  25. ip address 10.2.2.2 255.255.255.0  
  26. standby 2 ip 10.2.2.254  
  27. standby 2 priority 105  
  28. standby 2 preempt  
  29. standby 2 name ss2  
  30. standby 2 track ethernet 0/0  
  31. standby delay reload 120  
  32. !  
  33. ip route 0.0.0.0 0.0.0.0 16.1.1.3  
  34. !  
  35. access-list 100 permit ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255  
  36. !  
  37. redundancy inter-device  
  38. scheme standby ss2  
  39. !  
  40. ipc zone default  
  41. association 1  
  42. no shutdown  
  43. protocol sctp  
  44. local-port 5000  
  45. local-ip 10.2.2.2  
  46. remote-port 5000  
  47. remote-ip 10.2.2.1 

HUB2配置完成.
 

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

2011-11-29 16:08:30

IPsec VPN

2011-11-25 13:49:17

2011-11-25 13:34:56

IPsec VPNIPsec VPN协议

2011-11-29 14:50:19

IPSecVPN

2011-11-25 11:23:29

IPsec VPNIPsec VPN配置

2012-09-26 09:49:44

2012-09-28 09:44:32

2011-11-29 13:23:29

2011-11-29 12:27:54

2010-12-15 11:24:35

2011-11-07 10:49:16

IPsec VPNMPLS VPN

2011-11-29 12:13:21

VPN

2011-11-25 14:15:02

IPsec VPNIPsec VPN配置

2011-11-25 14:01:05

VPNVPN设置IPsec VPN

2011-11-25 11:31:40

IPsec VPNIPsec VPN配置

2011-05-30 09:27:44

2009-12-30 11:12:13

VPN配置说明书

2011-07-18 10:40:39

2009-04-08 10:34:00

IPSec VPN协议

2011-11-29 12:17:00

点赞
收藏

51CTO技术栈公众号