I. Sơ đồ
1. Sơ đồ mô hình
2. Sơ đồ IP
3. Yêu cầu
- Cấu hình VPN site-to-site xác thực bằng RSA (sử dụng CA trên windows server 2008R2 )
- Đảm bảo 2 mạng ra inside của 2 ASA: 192.168.10.0/24 và 192.168.20.0/24 thấy nhau và đi ra internet thành công
II. Triển khai
1. Cấu hình ISP
- Ở đây mình sẽ dùng 1 Router giả lập làm ISP cho phép ra internet
2. Cấu hình ASA1
- Cấu hình IP và default-route
- Đảm bảo ASA ra internet thành công
- Cấu hình xin CA từ CA server
- Cấu hình hostname và map IP của CA 2k8 thành tên CASERVER
- Tạo RSA key thành công
- Dùng 1 PC truy cập CA server để lây password enrollment challenge. Ở đây bạn có thể dùng chính AD2k8 truy cập = localhost thay vì dùng IP như dưới đây. Để nhìn thực tế xíu thì mình sẽ dùng IP để truy cập vào CA. Và bạn phải cấu hình DNS cho CA để nó phân giải tên
- Bạn copy Password enrollment challenge trong khung màu đỏ dưới đây
- Cấu hình thông tin CA.
- Bây giờ trên máy CA 2k8 bạn kiểm tra trạng thái Pending bạn sẽ thấy 1 certificate mới. Và chúng ta cần issued để chấp nhận chứng chỉ này
- Qua trình cấp phép thành công
- Sau khi CA 2k8 issue chứng chỉ thì bạn quay lại ASA sẽ xuất hiện dòng dưới đây cho biết certificate đã được cấp và quá trình enroll thành công
- Công việc cấu hình IPSEC-VPN trên ASA 8.4 các bạn thực hiện tương tự các bài lab trước. Tuy nhiên có vài điểm thay đổi. Trước kia chúng ta xác thực với nhau bằng pre-share key nhưng bây giờ chúng ta xác thực bằng CA
3. Trên ASA2
- Các bạn cấu hình tương tự trên ASA2 nhé
- Cấu hình IP và default-route
- Cấu hình map IP CA sang tên, tạo RSA key và cấu hình thông tin xác thực CA
- Cấu hình xác thực với CA
- Thực hiện Enroll CA.
- Chấp nhận Certificate mới của ASA2
- Trên CA 2k8 lúc này sẽ có cả 2 Certificate của ASA1 và ASA2
- Cấu hình IPSEC-VPN trên ASA2 chứng thực bằng RSA
1. Sơ đồ mô hình
2. Sơ đồ IP
ASA1 | g0: outside: 151.1.1.1/24 g1: inside: 192.168.10.1/24 |
PC1 | IP: 192.168.10.10/24 Gateway: 192.168.10.1 |
ISP | f0/0: 151.1.1.254/24 f0/1: 152.2.2.254/24 f1/0: 10.1.1.254/24 f2/0: DHCP |
ASA2 | g0: outside, 152.2.2.2/24 g1: inside, 192.168.20.2/24 |
PC2 | IP: 192.168.20.20/24 Gateway: 192.168.20.2/24 |
- Cấu hình VPN site-to-site xác thực bằng RSA (sử dụng CA trên windows server 2008R2 )
- Đảm bảo 2 mạng ra inside của 2 ASA: 192.168.10.0/24 và 192.168.20.0/24 thấy nhau và đi ra internet thành công
II. Triển khai
1. Cấu hình ISP
- Ở đây mình sẽ dùng 1 Router giả lập làm ISP cho phép ra internet
ISP(config)#int f0/0 ISP(config-if)#ip address 150.1.1.254 255.255.255.0 ISP(config-if)#no shutdown ISP(config-if)#int f0/1 ISP(config-if)#ip address ISP(config-if)#ip address 152.2.2.254 255.255.255.0 ISP(config-if)#no shutdown ISP(config-if)#int f1/0 ISP(config-if)#ip address 10.1.1.254 255.255.255.0 ISP(config-if)#no shutdown // Lấy IP được cấp từ model xuống ISP(config-if)#int f2/0 ISP(config-if)#ip address dhcp ISP(config-if)#no shutdown ISP(config-if)#exit //NAT ra internet ISP(config)#access-list 1 permit any ISP(config)#ip nat inside source list 1 interface f2/0 overload ISP(config)#int f2/0 ISP(config-if)#ip nat outside ISP(config-if)#int f1/0 ISP(config-if)#ip nat inside ISP(config-if)#int f0/0 ISP(config-if)#ip nat inside ISP(config-if)#int f0/1 ISP(config-if)#ip nat inside |
- Cấu hình IP và default-route
ASA1(config)# int g0 ASA1(config-if)# nameif outside ASA1(config-if)# ip address 151.1.1.1 255.255.255.0 ASA1(config-if)# no shutdown ASA1(config)# int g1 ASA1(config-if)# nameif inside ASA1(config-if)# ip address 192.168.10.1 255.255.255.0 ASA1(config-if)# no shutdown ASA1(config)# route outside 0 0 151.1.1.254 ASA1(config-if)# fixup protocol icmp |
ASA1(config)# ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 100/126/140 ms
- Cấu hình hostname và map IP của CA 2k8 thành tên CASERVER
ASA1(config)# domain-name svuit.com ASA1(config)# name 10.1.1.10 CASERVER |
Code:
ASA1(config)#[COLOR=#ff0000] crypto ca authenticate CA[/COLOR]
INFO: Certificate has the following attributes:
Fingerprint: 6c68062d 92188438 fc44cd32 918bda27
Do you accept this certificate? [yes/no]: [COLOR=#ff0000]yes[/COLOR]
[COLOR=#ff0000]Trustpoint CA certificate accepted.[/COLOR]
- Bạn copy Password enrollment challenge trong khung màu đỏ dưới đây
- Cấu hình thông tin CA.
Code:
ASA1(config)# [COLOR=#ff0000]crypto ca enroll CA[/COLOR]
%
% Start certificate enrollment ..
% Create a challenge password. You will need to verbally provide this
password to the CA Administrator in order to revoke your certificate.
For security reasons your password will not be saved in the configuration.
Please make a note of it.
[COLOR=#ff0000]Password: **************** [/COLOR][I][COLOR=#00ff00]// điền password enrollment challenge mà bạn đã lấy được ở trên[/COLOR][/I]
[COLOR=#ff0000]Re-enter password: ****************[/COLOR]
% The subject name in the certificate will be: cn=svuit O=svuit ou=svuit e=svuit.com
% The fully-qualified domain name in the certificate will be: ASA1.svuit.com
% Include the device serial number in the subject name? [yes/no]: [COLOR=#ff0000]no[/COLOR]
Request certificate from CA? [yes/no]: [COLOR=#ff0000]yes[/COLOR]
[COLOR=#ff0000]% Certificate request sent to Certificate Authority[/COLOR]
- Qua trình cấp phép thành công
- Sau khi CA 2k8 issue chứng chỉ thì bạn quay lại ASA sẽ xuất hiện dòng dưới đây cho biết certificate đã được cấp và quá trình enroll thành công
ASA1(config)# The certificate has been granted by CA!
- Công việc cấu hình IPSEC-VPN trên ASA 8.4 các bạn thực hiện tương tự các bài lab trước. Tuy nhiên có vài điểm thay đổi. Trước kia chúng ta xác thực với nhau bằng pre-share key nhưng bây giờ chúng ta xác thực bằng CA
ASA1(config)# crypto ikev1 policy 10 ASA1(config-ikev1-policy)# authentication rsa-sig ASA1(config-ikev1-policy)# encryption 3des ASA1(config-ikev1-policy)# hash md5 ASA1(config-ikev1-policy)# group 2 ASA1(config-ikev1-policy)# lifetime 86400 ASA1(config)# crypto ipsec ikev1 transform-set SVUIT esp-3des esp-md5-hmac ASA1(config-if)# object network INSIDE-ASA1 ASA1(config-network-object)# subnet 192.168.10.0 255.255.255.0 ASA1(config)# object network INSIDE-ASA2 ASA1(config-network-object)# subnet 192.168.20.0 255.255.255.0 ASA1(config)# access-list VPN-TRAFFIC permit ip object INSIDE-ASA1 object INSIDE-ASA2 ASA1(config)# crypto map ASA-VPN 10 match address VPN-TRAFFIC ASA1(config)# crypto map ASA-VPN 10 set peer 152.2.2.2 ASA1(config)# crypto map ASA-VPN 10 set ikev1 transform-set SVUIT ASA1(config)# crypto map ASA-VPN 10 set trustpoint CA ASA1(config)# crypto map ASA-VPN interface outside ASA1(config)# crypto ikev1 enable outside ASA1(config)# tunnel-group 152.2.2.2 type ipsec-l2l ASA1(config)# tunnel-group 152.2.2.2 ipsec-attributes ASA1(config-tunnel-ipsec)# ikev1 trust-point CA |
- Các bạn cấu hình tương tự trên ASA2 nhé
- Cấu hình IP và default-route
ASA2(config-if)# int g0 ASA2(config-if)# nameif outside ASA2(config-if)# ip address 152.2.2.2 255.255.255.0 ASA2(config-if)# no shutdown ASA2(config)# interface g1 ASA2(config-if)# nameif inside ASA2(config-if)# ip address 192.168.20.2 255.255.255.0 ASA2(config-if)# no shutdown ASA2(config)# route outside 0 0 152.2.2.254 ASA2(config-if)# fixup protocol icmp |
ASA2(config)# domain-name svuit.com ASA2(config)# name 10.1.1.10 CASERVER ASA2(config)# crypto key generate rsa general-keys ASA2(config)# crypto ca trustpoint CA ASA2(config-ca-trustpoint)# enrollment url http://CASERVER:80/certsrv/mscep/mscep.dll ASA2(config-ca-trustpoint)# subject-name cn=svuit O=svuit ou=svuit e=svuit.com |
Code:
ASA2(config)# [COLOR=#ff0000]crypto ca authenticate CA[/COLOR]
INFO: Certificate has the following attributes:
Fingerprint: 6c68062d 92188438 fc44cd32 918bda27
Do you accept this certificate? [yes/no]: [COLOR=#ff0000]yes[/COLOR]
Trustpoint CA certificate accepted.
Code:
ASA2(config)# [COLOR=#ff0000]crypto ca enroll CA[/COLOR]
%
% Start certificate enrollment ..
% Create a challenge password. You will need to verbally provide this
password to the CA Administrator in order to revoke your certificate.
For security reasons your password will not be saved in the configuration.
Please make a note of it.
[COLOR=#ff0000]Password: ****************[/COLOR] [I][COLOR=#00ff00]//password này khác với password ở trên, bạn thực hiện lấy pass giống như ở trên[/COLOR][/I]
Re-enter password: ****************
% The subject name in the certificate will be: cn=svuit O=svuit ou=svuit e=svuit.com
% The fully-qualified domain name in the certificate will be: ASA2.svuit.com
% Include the device serial number in the subject name? [yes/no]: [COLOR=#ff0000]no[/COLOR]
Request certificate from CA? [yes/no]: [COLOR=#ff0000]yes[/COLOR]
% Certificate request sent to Certificate Authority
ASA1(config)# [COLOR=#ff0000]The certificate has been granted by CA![/COLOR]
- Trên CA 2k8 lúc này sẽ có cả 2 Certificate của ASA1 và ASA2
- Cấu hình IPSEC-VPN trên ASA2 chứng thực bằng RSA
ASA2(config)# crypto ikev1 policy 10 ASA2(config-ikev1-policy)# authentication rsa-sig ASA2(config-ikev1-policy)# encryption 3des ASA2(config-ikev1-policy)# hash md5 ASA2(config-ikev1-policy)# group 2 ASA2(config-ikev1-policy)# lifetime 86400 ASA2(config)# crypto ipsec ikev1 transform-set SVUIT esp-3des esp-md5-hmac ASA2(config-if)# object network INSIDE-ASA1 ASA2(config-network-object)# subnet 192.168.10.0 255.255.255.0 ASA2(config)# object network INSIDE-ASA2 ASA2(config-network-object)# subnet 192.168.20.0 255.255.255.0 ASA2(config)# access-list VPN-TRAFFIC permit ip object INSIDE-ASA2 object INSIDE-ASA1 ASA2(config)# crypto map ASA-VPN 10 match address VPN-TRAFFIC ASA2(config)# crypto map ASA-VPN 10 set peer 151.1.1.1 ASA2(config)# crypto map ASA-VPN 10 set ikev1 transform-set SVUIT ASA2(config)# crypto map ASA-VPN 10 set trustpoint CA ASA2(config)# crypto map ASA-VPN interface outside ASA2(config)# crypto ikev1 enable outside ASA2(config)# tunnel-group 151.1.1.1 type ipsec-l2l ASA2(config)# tunnel-group 151.1.1.1 ipsec-attributes ASA2(config-tunnel-ipsec)# ikev1 trust-point CA |