I/. Tìm hiểu về Route-Based IPsec VPNs trên Firewall Juniper SRX : - Với phương pháp Route-based VPN, bạn có thể cấu hình hàng chục Security Policy để điều chỉnh lưu lượng truy cập qua một VPN tunnel giữa 2 site, và chỉ cần một bộ IKE và các IPSec SA để làm việc. Không giống với Policy-based VPN, đối với Route-based VPN, một Policy tương ứng cho một địa chỉ đích, không phải một VPN tunnel. Khi Junos OS tra một định tuyến để tìm cổng Interface gửi traffic đến điểm đích, nó tìm một route thông qua một Secure Tunnel Interface (st0.x). Tunnel interface được liên kết một VPN tunnel cụ thể, và traffic được chuyển tới tunnel nếu Policy cho phép. - Một Secure tunnel (st0) interface chỉ hỗ trợ duy nhất 1 địa chỉ IPv4 và 1 IPv6 trong cùng thời điểm. Điều này áp dụng cho tất cả các Route-based VPN. Tùy chọn vô hiệu hóa không hỗ trợ trên các st0 interfaces. - Một số trường hợp thực tế các Route-based VPN có thể được áp dụng vào : Có nhiều Subnet chồng chéo nhau hoặc Các địa chỉ IP giữa 2 mạng LAN. Trong mạng sử dụng VPN dạng Hub-and-Spoke, và bắt buộc cho traffic của mô hình Spoke-to-Spoke. Triển khai các VPN có Primary và Backup rà bắt buộc. Một giao thức định tuyến động (vd, OSPF, RIP hoặc BGP) đang chạy trong VPN. Cấu hình yêu cầu vòng cho định tuyến RIP qua Point-to-Multipoint VPN không hỗ trợ. - Route-based VPN được khuyến khích cho triển khai cho kết nối tới nhiều Remote Site. Route-based VPN cho phép định tuyến giữa các Spoke giữa nhiều Remote Site với nhau, nó dễ dàng để cấu hình, giám sát và tshoot. II/.Mô hình triển khai : III/. Các chi tiết cấu hình trong VPN : - Site 1: "DHK SRX" ___VPN Gateway IP (WAN): "1.1.1.2/30" ___ LAN IP: "10.1.1.0/24" ___ Tunnel Interface IP (St0.0): 192.168.0.1/30. - Site 2: "CTG SRX" ___ VPN Gateway IP (WAN): "2.2.2.2/30" ___ LAN IP: "172.16.1.0/24" ___ Tunnel Interface IP (St0.0): 192.168.0.2/30. IV/. Những tham số để thiết lập VPN : - Phase 1: ___ Authentication Method: Pre-Shared Key ___ Authentication-algorithm: sha-256 ___ Diffie-Hellman Group: Group 5 ___ Encryption Algorithm: 3des-cbc ___ Lifetime (for renegotiation SEC): 86400 ___ Main or Aggressive Mode: Main ___ Pre Shared Key: info@tgm - Phase 2: ___ Encapsulation (ESP or AH): ESP ___ Encryption Algorithm: 3des-cbc ___ Authentication Algorithm: hmac-sha1-96 ___ Perfect Forward Secrecy: No PFS ___ Lifetime (for renegotiation): 28800 V/. Bước cấu hình: - Giả sử, các cấu hình về network đều đã có ngoại trừ cấu hình về IPSec VPN. Có nghĩa là, cả 2 site DHK srx và CTG srx có thể ping thấy nhau. - Vì vậy, trươc khi cấu hình có thể ping thử từ DNK đến CTG bằng IP. root@DHK> ping 2.2.2.2 PING 2.2.2.2 (2.2.2.2): 56 data bytes 64 bytes from 2.2.2.2: icmp_seq=0 ttl=63 time=11.684 ms 64 bytes from 2.2.2.2: icmp_seq=1 ttl=63 time=10.274 ms 64 bytes from 2.2.2.2: icmp_seq=2 ttl=63 time=10.190 ms 64 bytes from 2.2.2.2: icmp_seq=3 ttl=63 time=10.640 ms ^C --- 2.2.2.2 ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max/stddev = 10.190/10.697/11.684/0.594 ms root@DHK> - Kết quả Ping, khả năng truy cập đầy đủ với IPSec qua IP. Lúc này, chúng ta cần kiểm tra đến system-service ike được cho phép trên Ext-Interface hay chưa? DHK: root@DHK# run show config | match UNTRUST | match system-services | display set set security zones security-zone UNTRUST host-inbound-traffic system-services ike CTG: root@CTG# run show config | match UNTRUST | match system-services | display set set security zones security-zone UNTRUST host-inbound-traffic system-services ike - Lúc này, cấu hình cho st0.0 (tunnel interface) cho cả hai thiết bị SRX ở hai site. DHK: root@DHK# set interfaces st0.0 family inet address 192.168.0.1/30 CTG: root@CTG# set interfaces st0.0 family inet address 192.168.0.2/30 - Đến bước này, chỉ định Zone cho st0.0 interface. Trong bài lab, đặt tên là VPN và để đơn giản, sẽ cho phép tất cả các giao thức và các dịch vụ trên VPN zone. Cấu hình VPN zone trên Juniper SRX: DHK & CTG: set security zones security-zone VPN host-inbound-traffic system-services all set security zones security-zone VPN host-inbound-traffic protocols all set security zones security-zone VPN interfaces st0.0 - Tiếp đến, bước cấu hình các Policy riêng biệt cho zone VPN. Theo bài lab này, Policy mặc định sẽ cho phép tất cả các dịch vụ. Cần phải thực hiện bước này trên mỗi thiết bị. DHK: root@DHK# run show configuration security policies | display set set security policies default-policy permit-all CTG: root@CTG# run show configuration security policies | display set set security policies default-policy permit-all - Cấu hình các tham số IKE proposal & IKE policy : Proposal cho cả 2 thiết bị SRX tại DHK & CTG: set security ike proposal OUR-IKE-PROPOSAL authentication-method pre-shared-keys set security ike proposal OUR-IKE-PROPOSAL dh-group group5 set security ike proposal OUR-IKE-PROPOSAL authentication-algorithm sha-256 set security ike proposal OUR-IKE-PROPOSAL encryption-algorithm 3des-cbc set security ike proposal OUR-IKE-PROPOSAL lifetime-seconds 86400 Policy cho cả 2 thiết bị SRX tại DHK & CTG: set security ike policy OUR-IKE-POLICY mode main set security ike policy OUR-IKE-POLICY proposals OUR-IKE-PROPOSAL set security ike policy OUR-IKE-POLICY pre-shared-key ascii-text info@tgm - IKE gateway, chỉ định policy và gateway với external interface. Thực hiện theo lệnh commands-line sau: DHK: set security ike gateway OUR-IKE-GATEWAY ike-policy OUR-IKE-POLICY set security ike gateway OUR-IKE-GATEWAY address 2.2.2.2 set security ike gateway OUR-IKE-GATEWAY external-interface ge-0/0/0.0 CTG: set security ike gateway OUR-IKE-GATEWAY ike-policy OUR-IKE-POLICY set security ike gateway OUR-IKE-GATEWAY address 1.1.1.2 set security ike gateway OUR-IKE-GATEWAY external-interface ge-0/0/0.0 - Cấu hình thêm DPD để tối ưu cho liên kết VPN, cũng có thể bỏ qua bước này. Lệnh cli để cấu hình DPD: set security ike gateway OUR-IKE-GATEWAY dead-peer-detection interval 20 set security ike gateway OUR-IKE-GATEWAY dead-peer-detection threshold 5 - Bây giờ, đến bước cấu hình cho IPSec proposal một IPSec policy cho cả DHK và CTG. Proposal cho DHK & CTG: set security ipsec proposal OUR-IPSEC-PROPOSAL protocol esp set security ipsec proposal OUR-IPSEC-PROPOSAL authentication-algorithm hmac-sha1-96 set security ipsec proposal OUR-IPSEC-PROPOSAL encryption-algorithm 3des-cbc set security ipsec proposal OUR-IPSEC-PROPOSAL lifetime-seconds 28800 Policy cho DHK & CTG: set security ipsec policy OUR-IPSEC-POLICY proposals OUR-IPSEC-PROPOSAL - Sau khi xong bước cấu hình IPsec proposal & policy, chúng ta cần cấu hình IPSec VPN. Cấu hình này thực hiện giống nhau trên 2 thiết bị SRX ở cả DHK và CTG. set security ipsec vpn OUR-VPN bind-interface st0.0 set security ipsec vpn OUR-VPN ike gateway OUR-IKE-GATEWAY set security ipsec vpn OUR-VPN ike ipsec-policy OUR-IPSEC-POLICY set security ipsec vpn OUR-VPN establish-tunnels immediately - Cuối cùng, cần cấu hình thêm route giữa 10.1.1.0/24 & 172.16.1.0/24. Đây sẽ là static route và next-hop sẽ là interface st0.0. DHK: set routing-options static route 17.16.1.0/24 next-hop st0.0 CTG: set routing-options static route 10.1.1.0/24 next-hop st0.0 VI/. Kiểm tra kết quả VPN: - Trước tiên, bạn cần tạo traffic giữa các site. Nếu không, bạn có thể tìm trên IKE & IPSec security-associations và kiểm tra trang thái của chúng trên Firewall Juniper SRX. - Trong trường hợp này , sau khi ping từ 10.1.1.10 sang 172.16.1.10 và kết quả: C:\>ping 172.16.1.10 Pinging 172.16.1.10 with 32 bytes of data: Reply from 172.16.1.10: bytes=32 time=14ms TTL=126 Reply from 172.16.1.10: bytes=32 time=12ms TTL=126 Reply from 172.16.1.10: bytes=32 time=12ms TTL=126 Reply from 172.16.1.10: bytes=32 time=14ms TTL=126 Ping statistics for 172.16.1.10: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 12ms, Maximum = 14ms, Average = 13ms - Dưới đây là 2 lệnh commands để kiểm tra trạng thái cho phase-1 và phase-2. show security ike security-associations show security ipsec security-associations Phase-1: root@DHK# run show security ike security-associations Index State Initiator cookie Responder cookie Mode Remote Address 4585457 UP 5410b5bbf9ead488 06e72f5214e7aa5a Main 2.2.2.2 Phase-2: root@DHK# run show security ipsec security-associations Total active tunnels: 1 ID Algorithm SPI Life:sec/kb Mon lsys Port Gateway <131073 ESP:3des/sha1 a4ca610 28518/unlim - root 500 2.2.2.2 >131073 ESP:3des/sha1 d7d57d73 28518/unlim - root 500 2.2.2.2