A-A+

关于神州数码路由器IPSEC不得不说的事

2015年11月26日 站长资讯 暂无评论

一句话总结,神码路由器的IPSEC很有特色。

实验环境:两台路由器直接相连一共3个网段:192.168.0.0 192.168.1.0 192.168.2.0 其中192.168.1.0模拟公网另外两个网段模拟私有网络通过启用IPSEC VPN实现这两个网段安全通信。

开始配置时两个路由器配置文件如下:

路由器R1

  1. show running-config   
  2. Building configuration...  
  3. Current configuration:  
  4. !  
  5. !version 1.3.3H  
  6. service timestamps log date  
  7. service timestamps debug date  
  8. no service password-encryption  
  9. !  
  10. hostname R1  
  11. crypto isakmp key 123456789 192.168.1.2 255.255.255.255  
  12. !  
  13. !  
  14. crypto isakmp policy 10  
  15. hash md5  
  16. !  
  17. crypto ipsec transform-set one  
  18. transform-type esp-des esp-md5-hmac  
  19. !  
  20. crypto map my 10 ipsec-isakmp  
  21. mode aggressive  
  22. set peer 192.168.1.2  
  23. set transform-set one  
  24. match address bendi   
  25. !  
  26. !  
  27. interface FastEthernet0/0  
  28. ip address 192.168.1.1 255.255.255.0  
  29. no ip directed-broadcast  
  30. crypto map my  
  31. ip nat outside  
  32. !  
  33. interface FastEthernet0/3  
  34. --More--         ip address 192.168.0.1 255.255.255.0  
  35. no ip directed-broadcast  
  36. ip nat inside  
  37. !  
  38. interface Serial0/1   
  39. no ip address  
  40. no ip directed-broadcast  
  41. !  
  42. interface Serial0/2  
  43. no ip address  
  44. no ip directed-broadcast  
  45. !  
  46. interface Async0/0  
  47. no ip address  
  48. no ip directed-broadcast  
  49. !  
  50. ip route 192.168.2.0 255.255.255.0 192.168.1.2  
  51.   
  52. !  
  53. ip access-list extended bendi  
  54. permit ip 192.168.0.0 255.255.255.0 192.168.2.0 255.255.255.0  
  55. !  
  56. ip access-list standard 123  
  57. permit ip any   
  58. !  
  59. ip nat inside source list 123 interface FastEthernet0/0  
  60. !  
  61. R1_config#  

路由器R2

  1. show run  
  2. Building configuration...  
  3. Current configuration:  
  4. !  
  5. !version 1.3.3H  
  6. service timestamps log date  
  7. service timestamps debug date  
  8. no service password-encryption  
  9. !  
  10. hostname R2  
  11.   
  12. !  
  13. gbsc group default  
  14. !      
  15. crypto isakmp key 123456789 192.168.1.1 255.255.255.255  
  16. !  
  17. !  
  18. crypto isakmp policy 10  
  19. hash md5  
  20. !  
  21. crypto ipsec transform-set one  
  22. transform-type esp-des esp-md5-hmac  
  23. !  
  24. crypto map my 10 ipsec-isakmp  
  25. mode aggressive  
  26. set peer 192.168.1.1  
  27. set transform-set one  
  28. match address bendi   
  29. !  
  30. !  
  31. interface FastEthernet0/0  
  32. ip address 192.168.1.2 255.255.255.0  
  33. no ip directed-broadcast  
  34. crypto map my  
  35. ip nat outside  
  36. !  
  37. interface FastEthernet0/3  
  38. --More--         ip address 192.168.2.1 255.255.255.0  
  39. no ip directed-broadcast  
  40. ip nat inside  
  41. !  
  42. interface Serial0/1  
  43. no ip address  
  44. no ip directed-broadcast  
  45. !  
  46. interface Serial0/2  
  47. no ip address  
  48. no ip directed-broadcast  
  49. !  
  50. interface Async0/0  
  51. no ip address   
  52. no ip directed-broadcast  
  53. !  
  54. ip route 192.168.0.0 255.255.255.0 192.168.1.1     
  55. !  
  56. ip access-list extended bendi  
  57. permit ip 192.168.2.0 255.255.255.0 192.168.0.0 255.255.255.0  
  58. !  
  59. ip access-list standard 123  
  60. permit ip any !  
  61.   
  62. ip nat inside source list 123 interface FastEthernet0/0  
  63.   
  64. !  
  65. R2_config#  

通过show crypto ipsec sa和show crypto iskmp sa发现不能正常建立IPSEC连接也就是IPSEC通道没有激活啥问题检查配置没有错误啊。算了去掉NAT测试通过show crypto ipsec sa和show crypto iskmp sa发现能正常建立IPSEC连接。不理解了。

经过拨打神码400电话后更改配置如下:

路由器R1

  1. show running-config   
  2. Building configuration...  
  3. Current configuration:  
  4. !  
  5. !version 1.3.3H  
  6. service timestamps log date  
  7. service timestamps debug date  
  8. no service password-encryption  
  9. !  
  10. hostname R1  
  11. crypto isakmp key 123456789 192.168.1.2 255.255.255.255  
  12. !  
  13. !  
  14. crypto isakmp policy 10  
  15. hash md5  
  16. !  
  17. crypto ipsec transform-set one  
  18. transform-type esp-des esp-md5-hmac  
  19. !  
  20. crypto map my 10 ipsec-isakmp  
  21. mode aggressive  
  22. set peer 192.168.1.2  
  23. set transform-set one  
  24. match address bendi   
  25. !  
  26. !  
  27. interface FastEthernet0/0  
  28. ip address 192.168.1.1 255.255.255.0  
  29. no ip directed-broadcast  
  30. crypto map my  
  31. ip nat outside  
  32. !  
  33. interface FastEthernet0/3  
  34. --More--         ip address 192.168.0.1 255.255.255.0  
  35. no ip directed-broadcast  
  36. ip nat inside  
  37. !   
  38. interface Serial0/1  
  39. no ip address  
  40. no ip directed-broadcast  
  41. !  
  42. interface Serial0/2  
  43. no ip address  
  44. no ip directed-broadcast  
  45. !  
  46. interface Async0/0  
  47. no ip address  
  48. no ip directed-broadcast  
  49. !  
  50. ip route 192.168.2.0 255.255.255.0 192.168.1.2  
  51. www.xiaoxiongboke.com  
  52. !  
  53. ip access-list extended bendi  
  54. permit ip 192.168.0.0 255.255.255.0 192.168.2.0 255.255.255.0  
  55. !  
  56. ip access-list extended 123  
  57. deny   ip 192.168.0.0 255.255.255.0 192.168.2.0 255.255.255.0  
  58. permit ip any any  
  59.   
  60. !  
  61. ip nat inside source list 123 interface FastEthernet0/0  
  62. !  
  63. R1_config#  

路由器R2

  1. show run  
  2. Building configuration...  
  3. Current configuration:  
  4. !  
  5. !version 1.3.3H  
  6. service timestamps log date  
  7. service timestamps debug date  
  8. no service password-encryption  
  9. !  
  10. hostname R2  
  11.   
  12. !  
  13. gbsc group default  
  14. !      
  15. crypto isakmp key 123456789 192.168.1.1 255.255.255.255  
  16. !  
  17. !  
  18. crypto isakmp policy 10  
  19. hash md5  
  20. !  
  21. crypto ipsec transform-set one  
  22. transform-type esp-des esp-md5-hmac  
  23. !  
  24. crypto map my 10 ipsec-isakmp  
  25. mode aggressive  
  26. set peer 192.168.1.1  
  27. set transform-set one  
  28. match address bendi   
  29. !  
  30. !  
  31. interface FastEthernet0/0  
  32. ip address 192.168.1.2 255.255.255.0  
  33. no ip directed-broadcast  
  34. crypto map my  
  35. ip nat outside  
  36. !  
  37. interface FastEthernet0/3  
  38. --More--         ip address 192.168.2.1 255.255.255.0  
  39. no ip directed-broadcast  
  40. ip nat inside  
  41. !  
  42. interface Serial0/1  
  43. no ip address  
  44. no ip directed-broadcast  
  45. !  
  46. interface Serial0/2  
  47. no ip address  
  48. no ip directed-broadcast  
  49. !  
  50. interface Async0/0  
  51. no ip address  
  52.   
  53. no ip directed-broadcast  
  54. !  
  55. ip route 192.168.0.0 255.255.255.0 192.168.1.1     
  56. !  
  57. ip access-list extended bendi  
  58. permit ip 192.168.2.0 255.255.255.0 192.168.0.0 255.255.255.0  
  59. !  
  60. ip access-list extended 123  
  61. deny   ip 192.168.2.0 255.255.255.0 192.168.0.0 255.255.255.0  
  62. permit ip any any  
  63. !  
  64. ip nat inside source list 123 interface FastEthernet0/0  
  65.   
  66. !  
  67. R2_config#  

也就是在上面的配置和初始的配置差别在NAT的访问控制列表上面的配置中扩展的访问控制列表先拒绝192.168.0.0和192.168.2.0网段数据进行NAT然后允许所有。经过这样配置IPSEC的通道就能ACTIVE。

事后分析,神码路由的操作系统内部流程nat优先于IPSEC。

标签:

给我留言