A-A+

思路路由器与ASA防火墙第一阶段: aggressive-mode建立VPN测试

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

一.概述:

L2L VPN第一阶段可以配置成aggressive-mode,因为aggressive-mode没有Main-mode安全,所以一般用在客户端拨号中。

参考链接:

http://networkology.net/2013/06/24/ios-site-to-site-vpn-aggressive-mode-ccie-notes/

http://wenku.baidu.com/view/2bc4751f59eef8c75fbfb3ae.html

http://bbs.51cto.com/thread-918833-1.html

二.基本思路:

A.测试路由器与防火墙以第一阶段aggressive-mode建立 L2L VPN

B.通过抓包确认协商过程中是否带有主机名

三.测试拓扑:

四.基本配置:

  1. A.R1:  
  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.2  
  6. B.R2:  
  7. interface Ethernet0/0  
  8.      ip address 192.168.1.2 255.255.255.0  
  9.      ip nat inside  
  10.      no shut  
  11. interface Ethernet0/1  
  12.      ip address 202.100.1.2 255.255.255.0  
  13.      ip nat outside  
  14.      no shut  
  15. ip route 0.0.0.0 0.0.0.0 202.100.1.3  
  16. ip access-list extended PAT  
  17.      deny   ip 192.168.1.0 0.0.0.255 172.16.1.0 0.0.0.255  
  18.      permit ip 192.168.1.0 0.0.0.255 any  
  19. ip nat inside source list PAT interface Ethernet0/1 overload  
  20. C.R3:  
  21. interface Ethernet0/0  
  22.      ip address 202.100.1.3 255.255.255.0  
  23.      no shut  
  24.   
  25.   
  26. interface Ethernet0/1  
  27.      ip address 202.100.2.3 255.255.255.0  
  28.      no shut  
  29. D.ASA842:  
  30. interface GigabitEthernet0  
  31.      nameif Inside  
  32.      security-level 100  
  33.      ip address 172.16.1.10 255.255.255.0  
  34.      no shut  
  35. interface GigabitEthernet1  
  36.      nameif Outside  
  37.      security-level 0  
  38.      ip address 202.100.2.10 255.255.255.0  
  39.      no shut  
  40. route Outside 0.0.0.0 0.0.0.0 202.100.2.3  
  41. object network Inside_net  
  42.      subnet 172.16.1.0 255.255.255.0  
  43.      nat (Inside,Outside) dynamic interface  
  44. policy-map global_policy  
  45.      class inspection_default  
  46.            inspect icmp  
  47. E.R4:   
  48. interface Ethernet0/0  
  49.      ip address 172.16.1.4 255.255.255.0  
  50.      no shut  
  51. ip route 0.0.0.0 0.0.0.0 172.16.1.10  

五.VPN配置:

A.R2:

①第一阶段策略:

  1. crypto isakmp policy 10  
  2.      encr 3des  
  3.      hash md5  
  4.      authentication pre-share  
  5.      group 2  
  6. crypto isakmp key cisco123 hostname ASA842  (这个是多余的,不需要配置)  
  7. crypto isakmp identity hostname  
  8. crypto isakmp keepalive 10 periodic  
  9. crypto isakmp peer address 202.100.2.10  
  10.      set aggressive-mode password cisco123  
  11.      set aggressive-mode client-endpoint ipv4-address 202.100.1.2 (这个必须有,否则无法从路由器这侧主动发起VPN)  

②第二阶段策略:

crypto ipsec transform-set transet esp-3des esp-md5-hmac

③配置感兴趣流:

ip access-list extended VPN

permit ip 192.168.1.0 0.0.0.255 172.16.1.0 0.0.0.255

④配置crypto map并在接口应用:

  1. crypto map crymap 10 ipsec-isakmp  
  2.      set peer 202.100.2.3   
  3.      set transform-set transet  
  4.      set pfs group2  
  5.      match address VPN  
  6.      reverse-route  

B.ASA842:

①第一阶段策略:

  1. crypto ikev1 policy 10  
  2.      authentication pre-share  
  3.      encryption 3des  
  4.      hash md5  
  5.      group 2  
  6. crypto isakmp identity hostname  
  7. tunnel-group 202.100.1.2 type ipsec-l2l  
  8. tunnel-group 202.100.1.2 ipsec-attributes  
  9.      ikev1 pre-shared-key cisco123  

②第二阶段策略:

crypto ipsec ikev1 transform-set transet esp-3des esp-md5-hmac

③配置感兴趣流并做NAT免除:

  1. access-list VPN extended permit ip 172.16.1.0 255.255.255.0 192.168.1.0 255.255.255.0  
  2. object network Inside_net  
  3.      subnet 172.16.1.0 255.255.255.0  
  4. object network Remote_net  
  5.      subnet 192.168.1.0 255.255.255.0   
  6. nat (Inside,Outside) source static Inside_net Inside_net destination static Remote_net Remote_net  

③配置crypto map 并在接口调用:

  1. crypto map crymap 10 match address VPN  
  2. crypto map crymap 10 set pfs  
  3. crypto map crymap 10 set peer 202.100.1.2  
  4. crypto map crymap 10 set ikev1 phase1-mode aggressive  
  5. crypto map crymap 10 set ikev1 transform-set transet  
  6. crypto map crymap 10 set reverse-route  
  7. crypto map crymap interface Outside  

④在接口启用IKEV1:

crypto ikev1 enable Outside

六.抓包测试:

A.第一阶段,aggressive mode一共三个包,第三个包才是加密的

B.路由器 set aggressive-mode client-endpoint设置的是fqdn还是IP地址,只能决定路由器主动发起连接时使用的是什么

-----如果防火墙侧主动发起,路由器都是以自己的主机名作为回复,而部署配置中的FQDN或IP

C.路由器如果client-endpoint用的是IP,则路由器主动发起aggressive mode时用的是IP地址

D.路由器如果client-endpoint用的是fqdn,则路由器主动发起aggressive mode时用的是设置的FQDN地址

E.不管client-endpoint用的是fqdn,还是IP,如果由防火墙侧主动发起,路由器回复的identity都是自己的主机名

七.PIX8.0的配置:

---如果将ASA842改为PIX8.0,PIX的配置如下:

A.基本配置:

  1. interface Ethernet0  
  2.      nameif Inside  
  3.      security-level 100  
  4.      ip address 172.16.1.10 255.255.255.0  
  5.      no shut  
  6. interface Ethernet1  
  7.      nameif Outside  
  8.      security-level 0  
  9.      ip address 202.100.2.10 255.255.255.0  
  10.      no shut  
  11. route Outside 0.0.0.0 0.0.0.0 202.100.2.3  
  12. access-list PAT extended permit ip 172.16.1.0 255.255.255.0 any  
  13. nat (Inside) 1 access-list PAT  
  14. global (Outside) 1 interface  
  15.   
  16.   
  17. access-list OUTSIDE extended permit icmp any any    
  18. access-group OUTSIDE in interface Outside  

B.VPN配置:

①第一阶段策略:

  1. crypto isakmp policy 10  
  2.      authentication pre-share  
  3.      encryption 3des  
  4.      hash md5  
  5.      group 2  
  6. crypto isakmp identity hostname  
  7. tunnel-group 202.100.1.2 type ipsec-l2l  
  8. tunnel-group 202.100.1.2 ipsec-attributes  
  9.      pre-shared-key cisco  

---备注:tunnel-group也可以用对方的FQDN,

②第二阶段策略:

crypto map crymap 10 set transform-set transet

③配置感兴趣流并做NAT免除:

access-list VPN extended permit ip 172.16.1.0 255.255.255.0 192.168.1.0 255.255.255.0

access-list NONAT extended permit ip 172.16.1.0 255.255.255.0 192.168.1.0 255.255.255.0

nat (Inside) 0 access-list NONAT

④配置crypto map 并在接口调用:

  1. crypto map crymap 10 match address VPN   
  2. crypto map crymap 10 set pfs  
  3. crypto map crymap 10 set peer 202.100.1.2  
  4. crypto map crymap 10 set transform-set transet  
  5. crypto map crymap 10 set phase1-mode aggressive group2(group2为默认值,show不会出现)  
  6. crypto map crymap 10 set reverse-route  
  7. crypto map crymap interface Outside  

⑤在接口启用isakmp:

crypto isakmp enable Outside

标签:

给我留言