Hôm nay rảnh rỗi, ngủ dậy không có việc gì làm. Nhớ lại có 1 a/e trên forum nhờ làm cái VPN client to site trên ASA 802 xác thực user với Active Directory trên Windows server 2008R2. Thế là bắt tay vào lab thôi. Hy vọng bài lab có ích với mọi người, nếu cần hỗ trợ gì thì cứ để lại comment trên forum hoặc facebook:https://www.facebook.com/pages/Svuit/248785748660011?ref=hl mình hay lên face hơn
I. Mô hình
- Mô hình
- Yêu cầu
1. Cấu hình IP và Active Directory
- Cấu hình IP trên ASA
- Về việc cấu hình Active Directory trên Windows server 2008R2 thì các bạn tự làm nhé! Nó khá đơn giản, các bạn thể tham khảo trên Forum này.
- Đảm bảo AD và ASA thấy nhau
- Và đây là AD của mình cấu hình
2. Cấu hình VPN
- Cấu hình VPN trên ASA 8.02, các bạn có thể xem lại các bài lab cũ về cấu hình VPN client-to-site trên ASA 8.02 tại đây http://svuit.vn/lab-71/lab-17-1-ipsec-vpn-client-site-asa-8-02-a-626.html
- Cấu hình VPN client to site Phase 1:
- Cấu hình VPN client to site Phase 2:
- Cấu hình VPN client-to-site chứng thực với Active Directory của Windows Server 2008R2
- Thêm 1 cái Group Policy để áp các chính xác cho user khi quay VPN vào cty
III. Kiểm tra
1. Test chứng thực trên ASA
- Các bạn có thể sử dụng lệnh sau để kiểm tra xem ASA có chứng thực với Active Directory 2008R2 thành công không. Như của mình là ok, đã chứng thực thành công
2. kiểm tra VPN Client authentication với Active Directory 2008R2
- Bây giờ các bạn qua máy client và thực hiện quay VPN
- Các bạn điền username/password mà các bạn tạo trên Active Directory của Windows server 2008R2 nhé
- Và mình đã VPN thành công với user và pass mình đã tạo trên AD
- Client VPN được phép truy cập những tài nguyên có subnet: 192.168.10.0/24
- Các bạn kiểm tra sẽ thấy IP-Pool VPN mà ASA cấp, và client VPN có thể truy cập tới inside của ASA. Ví dụ mình ping tới AD2k8 nằm trong inside của ASA thành công
I. Mô hình
- Mô hình
- Yêu cầu
- cấu hình IP như sơ đồ
- cấu hình VPN client to site trên ASA 802 sử dụng pre-share key:svuit.vn
- cấu hình ASA để khi client VPN vào ASA sẽ sử dụng user trên Active Directory của Windows 2008R2 xác thực
- Cấu hình để VPN client có thể truy cập vào vùng inside của ASA
1. Cấu hình IP và Active Directory
- Cấu hình IP trên ASA
ciscoasa(config)# int e0/0 ciscoasa(config-if)# ip address 192.168.80.254 ciscoasa(config-if)# nameif outside ciscoasa(config-if)# no shut ciscoasa(config-if)# int e0/1 ciscoasa(config-if)# nameif inside ciscoasa(config-if)# ip add 192.168.10.254 255.255.255.0 ciscoasa(config-if)# no shut ciscoasa(config-if)# fixup protocol icmp |
- Đảm bảo AD và ASA thấy nhau
- Và đây là AD của mình cấu hình
2. Cấu hình VPN
- Cấu hình VPN trên ASA 8.02, các bạn có thể xem lại các bài lab cũ về cấu hình VPN client-to-site trên ASA 8.02 tại đây http://svuit.vn/lab-71/lab-17-1-ipsec-vpn-client-site-asa-8-02-a-626.html
- Cấu hình VPN client to site Phase 1:
// Cấu hình VPN client to site Phase 1 ciscoasa(config)# isakmp policy 1 authentication pre-share ciscoasa(config)# isakmp policy 1 encryption 3des ciscoasa(config)# isakmp policy 1 hash sha ciscoasa(config)# isakmp policy 1 group 2 ciscoasa(config)# isakmp policy 1 lifetime 86400 ciscoasa(config)# isakmp enable outside |
// pool cấp IP cho VPN client ciscoasa(config)# ip local pool VPN-POOL 10.0.0.10-10.0.0.20 // ACL cho phép VPN client truy cập vào đâu ciscoasa(config)# access-list ACL-VPN extended permit ip 192.168.10.0 255.255.255.0 10.0.0.0 255.255.255.0 ciscoasa(config)# crypto ipsec transform-set Phase1-SET esp-3des esp-md5-hmac ciscoasa(config)# tunnel-group REMOTE-VPN type ipsec-ra ciscoasa(config)# tunnel-group REMOTE-VPN general-attributes ciscoasa(config-general)# address-pool VPN-POOL ciscoasa(config)# tunnel-group REMOTE-VPN ipsec-attributes ciscoasa(config-ipsec)# pre-shared-key svuit.vn ciscoasa(config)# crypto dynamic-map DYNAMIC1 1 set transform-set Phase1-SET ciscoasa(config)# crypto dynamic-map DYNAMIC1 1 set reverse-route ciscoasa(config)# crypto map MYMAP 1 ipsec-isakmp dynamic DYNAMIC1 ciscoasa(config)# crypto map MYMAP interface outside |
ciscoasa(config)# aaa-server LDAP protocol ldap // IP của Active Directory Windows Server 2008R2 ciscoasa(config-aaa-server-group)#aaa-server LDAP (inside) host 192.168.10.10 // Active Directory của mình có domain là: svuit.org ciscoasa(config-aaa-server-host)# ldap-base-dn dc=svuit, dc=org // chứng thực với Active Directory với OU Users trên domain svuit.org ciscoasa(config-aaa-server-host)# ldap-login-dn CN=Administrator,CN=Users,DC=svuit,DC=org // Nhập passowrd của administrator trên AD 2008R2 ciscoasa(config-aaa-server-host)# ldap-login-password svuit.vn ciscoasa(config-aaa-server-host)# ldap-naming-attribute sAMAccountName ciscoasa(config-aaa-server-host)# ldap-scope subtree ciscoasa(config-aaa-server-host)# server-type microsoft |
// Tạo group policy cho user VPN ciscoasa(config)# group-policy POLICY-VPN internal ciscoasa(config)# group-policy POLICY-VPN attributes ciscoasa(config-group-policy)# split-tunnel-policy tunnelspecified ciscoasa(config-group-policy)# split-tunnel-network-list value ACL-VPN ciscoasa(config-group-policy)# dns-server value 8.8.8.8 8.8.4.4 // Áp phê các policy trên vào group REMOTE-VPN và thực hiện chứng thực bằng AD với group này ciscoasa(config)#tunnel-group REMOTE-VPN general-attributes ciscoasa(config-tunnel-general)# default-group-policy POLICY-VPN ciscoasa(config-tunnel-general)#authentication-server-group LDAP |
1. Test chứng thực trên ASA
- Các bạn có thể sử dụng lệnh sau để kiểm tra xem ASA có chứng thực với Active Directory 2008R2 thành công không. Như của mình là ok, đã chứng thực thành công
Code:
ciscoasa#[COLOR=#ff0000] test aaa-server authentication LDAP host 192.168.10.10[/COLOR]
Username: Administrator
Password: ***********
INFO: Attempting Authentication test to IP address <192.168.10.10> (timeout: 12 seconds)
INFO: [I][COLOR=#00ff00]Authentication Successful[/COLOR][/I]
- Bây giờ các bạn qua máy client và thực hiện quay VPN
- Các bạn điền username/password mà các bạn tạo trên Active Directory của Windows server 2008R2 nhé
- Và mình đã VPN thành công với user và pass mình đã tạo trên AD
- Client VPN được phép truy cập những tài nguyên có subnet: 192.168.10.0/24
- Các bạn kiểm tra sẽ thấy IP-Pool VPN mà ASA cấp, và client VPN có thể truy cập tới inside của ASA. Ví dụ mình ping tới AD2k8 nằm trong inside của ASA thành công