A-A+

思科路由器L2L、EzVPN旁挂方式部署测试

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

一、概述:

在实际工作中经常可以看到深信服的SSL VPN可以旁路部署,并且支持路由模式和NAT模式:路由器模式需要内网对VPN分派的地址池地址可路由器;NAT模式,VPN客户端访问内网主机时,内网主机看到的地址为VPN接口地址,因此不需要VPN地址池的地址内网可路由。如是想测试一下思科的设备这种部署方式,先测试L2L和EzVPN,如果有时间准备再测试一下SSLVPN。

二、基本思路:

A.总部的L2L VPN和EzVPN都用Dynamic VTI方式配置
B.如果需要以NAT方式部署,在虚拟模板接口配置NAT
C.通过实验也可以很容易看出,通过DVTI方式配置的L2L和EzVPN不会相互干扰

三、测试拓扑:

四、基本配置:

  1. A.Inside_Router  
  2. interface Ethernet0/0  
  3. ip address 192.168.1.1 255.255.255.0  
  4. no shut  
  5. ip route 0.0.0.0 0.0.0.0 192.168.1.254  
  6. B.ASA842:  
  7. interface GigabitEthernet0  
  8. nameif Inside  
  9. security-level 100  
  10. ip address 192.168.1.254 255.255.255.0   
  11. no shut  
  12. interface GigabitEthernet1  
  13. nameif DMZ  
  14. security-level 50  
  15. ip address 10.1.1.254 255.255.255.0   
  16. no shut  
  17. interface GigabitEthernet2  
  18. nameif Outside  
  19. security-level 0  
  20. ip address 202.100.1.1 255.255.255.0   
  21. no sht  
  22. route Outside 0.0.0.0 0.0.0.0 202.100.1.10 1  
  23. C.DMZ_VPN:  
  24. interface Ethernet0/0  
  25. ip address 10.1.1.1 255.255.255.0  
  26. no shut  
  27. ip route 0.0.0.0 0.0.0.0 10.1.1.254  
  28. D.Internet:  
  29. interface Ethernet0/0  
  30. ip address 202.100.1.10 255.255.255.0  
  31. no shut  
  32. interface Ethernet0/1  
  33. ip address 202.100.2.10 255.255.255.0  
  34. no shut  
  35. E:Brach:  
  36.   
  37.   
  38. interface Loopback0  
  39. ip address 172.16.1.1 255.255.255.0  
  40. interface Ethernet0/0  
  41. ip address 202.100.2.1 255.255.255.0  
  42.  no shut  
  43. ip route 0.0.0.0 0.0.0.0 202.100.2.10  

四:NAT配置:

  1. A.动态PAT:  
  2. ①ASA842:  
  3. object network INSIDE_Net  
  4. subnet 192.168.1.0 255.255.255.0  
  5. nat (Inside,Outside) dynamic interface   
  6. object network DMZ_Net  
  7. subnet 10.1.1.0 255.255.255.0  
  8. nat (DMZ,Outside) dynamic interface  
  9. --开启ICMP审查:  
  10. policy-map global_policy  
  11. class inspection_default  
  12. inspect icmp  
  13. --测试:  
  14. Inside_Router#ping 202.100.1.10  
  15. Type escape sequence to abort.  
  16. Sending 5, 100-byte ICMP Echos to 202.100.1.10, timeout is 2 seconds:  
  17. !!!!!  
  18. Success rate is 100 percent (5/5), round-trip min/avg/max = 4/45/104 ms  
  19. DMZ_VPN#ping 202.100.1.10  
  20.   
  21. Type escape sequence to abort.  
  22. Sending 5, 100-byte ICMP Echos to 202.100.1.10, timeout is 2 seconds:  
  23. !!!!!  
  24. Success rate is 100 percent (5/5), round-trip min/avg/max = 1/48/88 ms  
  25. ②Branch:  
  26. interface Ethernet0/0  
  27. ip nat outside  
  28. interface Loopback0  
  29. ip nat inside  
  30. ip access-list extended PAT  
  31. deny   ip 172.16.1.0 0.0.0.255 192.168.1.0 0.0.0.255  
  32. permit ip 172.16.1.0 0.0.0.255 any  
  33. ip nat inside source list PAT interface Ethernet0/0 overload  
  34. ---测试:  
  35. Branch#PING 202.100.1.1 SOUrce L0     
  36.   
  37. Type escape sequence to abort.  
  38. Sending 5, 100-byte ICMP Echos to 202.100.1.1, timeout is 2 seconds:  
  39. Packet sent with a source address of 172.16.1.1   
  40. !!!!!  
  41. Success rate is 100 percent (5/5), round-trip min/avg/max = 1/36/168 ms  
  42. B.静态PAT:  
  43. ----只在ASA842配置  
  44. ①静态PAT设置:  
  45. object network DMZ_VPN  
  46. host 192.168.1.1  
  47. object network DMZ_VPN2  
  48. host 192.168.1.1  
  49. object network DMZ_VPN  
  50. nat (DMZ,Outside) static interface service udp 4500 4500   
  51. object network DMZ_VPN2  
  52. nat (DMZ,Outside) static interface service udp isakmp isakmp  
  53. ②防火墙策略配置:  
  54. access-list OUTSIDE extended permit udp host 202.100.2.1 object DMZ_VPN eq 4500   
  55. access-list OUTSIDE extended permit udp host 202.100.2.1 object DMZ_VPN2 eq isakmp   
  56. access-list OUTSIDE extended permit esp host 202.100.2.1 object DMZ_VPN   
  57. access-group OUTSIDE in interface Outside  

五.L2L VPN配置:

  1. A.DMZ_VPN:  
  2. ①第一阶段策略:   
  3. crypto keyring Branch   
  4.  pre-shared-key address 202.100.2.1 key cisco  
  5. crypto isakmp policy 10  
  6. encr 3des  
  7. hash md5  
  8. authentication pre-share  
  9. group 2  
  10. crypto isakmp profile isakmp_profile  
  11.   keyring Branch  
  12.   match identity address 202.100.2.1 255.255.255.255   
  13.   virtual-template 1  
  14. ②第二阶段转换集:  
  15. crypto ipsec transform-set transet esp-des esp-md5-hmac   
  16. ③配置ipsec profile  
  17. crypto ipsec profile ipsec_profile  
  18. set transform-set transet   
  19. set isakmp-profile isakmp_profile  
  20. ④配置虚拟模板接口并调用IPSEC Profile  
  21. interface Loopback100  
  22. ip address 1.1.1.1 255.255.255.0  
  23. interface Virtual-Template1 type tunnel  
  24. ip unnumbered Loopback100  
  25. tunnel source Ethernet0/0  
  26. tunnel mode ipsec ipv4  
  27. tunnel protection ipsec profile ipsec_profile  
  28. ⑤配置动态路由:  
  29. router ospf 1  
  30. router-id 1.1.1.1  
  31. log-adjacency-changes  
  32. network 1.1.1.0 0.0.0.255 area 0  
  33.   
  34. ---尝试过建Inside区域内网通过OSPF重分布给Branch路由器,不知为什么没有成功,Branch路由器的OSPF数据库里面是有该条目的。  
  35. B.Branch:  
  36. ①第一阶段策略:  
  37. crypto isakmp policy 10  
  38. encr 3des  
  39. hash md5  
  40. authentication pre-share  
  41. group 2  
  42. crypto isakmp key cisco address 202.100.1.1  
  43. ②第二阶段转换集:  
  44. crypto ipsec transform-set transet esp-des esp-md5-hmac   
  45. ③配置ipsec profile  
  46. crypto ipsec profile ipsec_profile  
  47. set transform-set transet   
  48. ④配置tunnel接口并在上面调用ipsec profile  
  49. interface Tunnel0  
  50. ip address 1.1.1.100 255.255.255.0  
  51. tunnel source Ethernet0/0  
  52. tunnel destination 202.100.1.1  
  53. tunnel mode ipsec ipv4  
  54. tunnel protection ipsec profile ipsec_profile  
  55. ⑤配置动态路由:  
  56. router ospf 1  
  57. router-id 1.1.1.100  
  58. passive-interface Loopback0  
  59. network 1.1.1.100 0.0.0.0 area 0  
  60. network 172.16.1.1 0.0.0.0 area 0  
  61. ⑥配置静态路由:  
  62. ----因为ASA的inside内网区域的网段无法通过动态路由学到,因此只能添加静态路由   
  63. ip route 192.168.1.0 255.255.255.0 tunnel 0  

六.L2L VPN效果测试:

  1. A.配置ASA842策略:  
  2. access-list DMZ extended permit icmp any any   
  3. access-list DMZ extended permit tcp 172.16.1.0 255.255.255.0 host 192.168.1.1 eq telnet   
  4. access-list DMZ extended permit tcp host 10.1.1.1 host 192.168.1.1 eq telnet   
  5. ---第三条ACE是为了后面NAT方式测试而添加的  
  6. access-group DMZ in interface DMZ  
  7. B.路由模式测试:  
  8. ①ASA842添加Branch身后网段的路由到DMZ_VPN:  
  9. route DMZ 172.16.1.0 255.255.255.0 10.1.1.1 1  
  10. ②测试:  
  11. Branch#telnet 192.168.1.1 /source-interface l0  
  12. Trying 192.168.1.1 ... Open  
  13. User Access Verification  
  14. Password:   
  15. Password:   
  16. Inside_Router>show user  
  17. *Mar  1 06:56:11.082: RT: NET-RED 0.0.0.0/0s  
  18.    Line       User       Host(s)              Idle       Location   
  19.   0 con 0                idle                 02:27:46     
  20. *130 vty 0                idle                 00:00:00 172.16.1.1  
  21.  Interface    User               Mode         Idle     Peer Address  
  22. B.NAT模式测试:  
  23. ①DMZ_VPN配置动态PAT:  
  24. interface Ethernet0/0  
  25. ip nat outside  
  26. interface Virtual-Template1 type tunnel  
  27. ip nat inside  
  28. ip access-list extended VPN_TO_INSIDE  
  29. permit ip 172.16.1.0 0.0.0.255 192.168.1.0 0.0.0.255  
  30. ip nat inside source list VPN_TO_INSIDE interface Ethernet0/1 overload  
  31. ②测试:  
  32. Branch#telnet 192.168.1.1 /source-interface l0  
  33. Trying 192.168.1.1 ... Open  
  34. User Access Verification  
  35.   
  36. Password:   
  37. Inside_Router>show users   
  38.    Line       User       Host(s)              Idle       Location  
  39.   0 con 0                idle                 00:09:23     
  40. *130 vty 0                idle                 00:00:00 10.1.1.1  
  41.   
  42.  Interface    User               Mode         Idle     Peer Address  
  43. ---可以看到连接的地址变成了DMZVPN路由器的接口地址了。  

七.EzVPN配置:

  1. A.DMZ_VPN:  
  2. ①第一阶段策略:  
  3. crypto isakmp policy 10  
  4. encr 3des  
  5. hash md5  
  6. authentication pre-share  
  7. group 2crypto isakmp client configuration group Ezvpn_group  
  8. key cisco  
  9. ②第1.5阶段XAUTH配置:  
  10. aaa new-model  
  11. aaa authentication login noacs line none  
  12. line console 0  
  13. login authentication noacs  
  14. line aux 0  
  15. login authentication noacs  
  16. username xll password xll  
  17. aaa authentication login Xauth local  
  18. ③第1.5阶段MODE-CFG配置:  
  19. ip local pool ippool 123.1.1.100 123.1.1.200  
  20. ip access-list extended Split_INSIDE  
  21. permit ip 192.168.1.0 0.0.0.255 any  
  22. aaa authorization network Mcfg local  
  23.   
  24. crypto isakmp client configuration group Ezvpn_group  
  25. pool  MYPool  
  26. acl Split_INSIDE  
  27. ④第2阶段转换集配置:  
  28. crypto ipsec transform-set ezvpnset esp-des esp-md5-hmac  
  29. ----可以与L2L VPN共用  
  30. ⑤配置isakmp profile:  
  31. crypto isakmp profile isakmp_profile  
  32.   match identity group cisco  
  33.   isakmp authorization list default  
  34.   client authentication list Xauth  
  35.   client configuration address respond  
  36.   virtual-template 2  
  37. -----注意模板编号不能与L2L VPN相同  
  38. ⑥配置ipsec profile:  
  39. crypto ipsec profile EzVPN_ipsec_profile  
  40. set transform-set transet   
  41. set isakmp-profile EzVPN_isakmp_profile  
  42. ⑦配置虚拟模板并调用ipsec profile:  
  43. interface Virtual-Template2 type tunnel  
  44. ip unnumbered Ethernet0/0  
  45. tunnel source Ethernet0/0  
  46. tunnel mode ipsec ipv4  
  47. tunnel protection ipsec profile EzVPN_ipsec_profile    
  48. B.EzVPN客户端:  
  49. ---不知道是否是EzVPN客户端原因,拨通之后没有隧道分割对应路由,需要手工添加:  
  50. route add 192.168.1.0 mask 255.255.255.0 123.1.1.100  

八.EzVPN效果测试:

  1. A.配置ASA842策略:  
  2. access-list DMZ extended permit icmp any any   
  3. access-list DMZ extended permit tcp 123.1.1.0 255.255.255.0 host 192.168.1.1 eq telnet   
  4. access-list DMZ extended permit tcp host 10.1.1.1 host 192.168.1.1 eq telnet   
  5. ---第三条ACE是为了后面NAT方式测试而添加的  
  6. B.路由模式效果测试:  
  7. ①ASA842添加路由:  
  8. route dmz 123.1.1.0 255.255.255.0 10.1.1.1  
  9. ②客户端连接测试:  
  10.   
  11. ----可以看到连接的地址为VPN地址池的地址  
  12. B.NAT模式效果测试:  
  13. ①DMZ_VPN配置动态PAT:  
  14. interface Ethernet0/0  
  15. ip nat outside  
  16. interface Virtual-Template2 type tunnel  
  17. ip nat inside  
  18. ip access-list extended VPN_TO_INSIDE  
  19. permit ip 123.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255  
  20. ip nat inside source list VPN_TO_INSIDE interface Ethernet0/1 overload  
  21. ②测试:  
  22.   
  23. ----可以看到,telnet到Inside路由器,路由器看到的地址为DMZ_VPN的接口地址。  
标签:

给我留言