
CÔNG TY CỔ PHẦN DỊCH VỤ CÔNG NGHỆ DATECH
Danh sách nội dung [Ẩn]
Hướng dẫn cấu hình ADVPN với OSPFv3 cho lưu lượng IPv6
Ví dụ này, DATECH sẽ hướng dẫn anh chị cách cấu hình một hệ thống ADVPN bao gồm một thiết bị trung tâm (hub) và hai thiết bị vệ tinh (spoke), nhằm tạo ra một đường hầm tắt (shortcut tunnel) giữa các spoke. Mục đích là thay đổi cấu trúc định tuyến để các thiết bị đầu cuối có thể truyền dữ liệu trực tiếp với nhau mà không cần đi qua thiết bị hub. Cấu hình này áp dụng cho môi trường mạng IPv6, sử dụng giao thức OSPFv3 để định tuyến các gói tin thông qua các đường hầm VPN.
Để thực hiện cấu hình này, hệ thống cần có các thành phần phần cứng và phần mềm sau:
Chuẩn bị trước khi cấu hình
Cần nắm vững giao thức định tuyến động được sử dụng để chuyển tiếp gói tin trong mạng VPN.
Tổng quan
Phần này trình bày cấu hình của một thiết bị ADVPN hub và các bước cấu hình tiếp theo cho hai thiết bị spoke.
Trong ví dụ này, bước đầu tiên là đăng ký chứng chỉ số (digital certificate) cho từng thiết bị bằng giao thức SCEP (Simple Certificate Enrollment Protocol). Các chứng chỉ cấp cho các thiết bị spoke phải chứa giá trị “SLT” trong trường OU (Organizational Unit) của trường chủ thể (subject); trong khi đó, thiết bị hub sẽ được cấu hình với một Group IKE ID sao cho khớp với giá trị “SLT” trong OU.
Sau khi cấu hình, các spoke sẽ thiết lập kết nối VPN IPsec đến thiết bị hub. Nhờ vậy, chúng có thể giao tiếp trực tiếp với nhau cũng như truy cập tài nguyên trên hub. Các tùy chọn IKE Phase 1 và Phase 2 của đường hầm được cấu hình trên thiết bị hub và tất cả các spoke phải giống nhau.
Bảng 1 minh họa các tùy chọn được sử dụng trong ví dụ cấu hình ADVPN cơ bản với OSPFv3.
Thành phần cấu hình | Giá trị |
IKE Proposal | |
Phương thức xác thực | Chứng chỉ số RSA (RSA digital certificates) |
Nhóm Diffie-Hellman (DH) | 19 |
Thuật toán xác thực | SHA-384 |
Thuật toán mã hóa | AES 256 CBC |
IKE Policy | |
Chế độ | Main |
IPsec Proposal | |
Giao thức | ESP (Encapsulating Security Payload) |
Thời gian sống (lifetime) | 3000 giây |
Thuật toán mã hóa | AES 256 GCM |
IPsec Policy | |
Nhóm PFS (Perfect Forward Secrecy) | 19 |
Tất cả các thiết bị đều được cấu hình sử dụng cùng một tổ chức cấp phát chứng chỉ (CA – Certificate Authority).
Bảng 2 trình bày các tùy chọn cấu hình ADVPN với OSPFv3 áp dụng cho cả thiết bị hub và các spoke.
Tùy chọn cấu hình | Hub | Tất cả các Spoke |
---|---|---|
IKE Gateway | ||
Địa chỉ IP phía xa (Remote IP address) | Dynamic (động) | 2001:db8:2000::1 |
Remote IKE ID | DN trên chứng chỉ của spoke, có chứa chuỗi SLT trong trường OU | DN trên chứng chỉ của hub |
Local IKE ID | DN trên chứng chỉ của hub | DN trên chứng chỉ của spoke |
Giao diện ngoài (External interface) | reth1 | Spoke 1: ge-0/0/0.0 Spoke 2: ge-0/0/0.0 |
VPN | ||
Giao diện ràng buộc (Bind interface) | st0.1 | st0.1 |
Thiết lập đường hầm (Establish tunnels) | (không cấu hình – mặc định) | establish-tunnels immediately (thiết lập đường hầm ngay lập tức) |
Bảng 3 trình bày các tùy chọn cấu hình khác nhau giữa các spoke trong cấu hình OSPFv3.
Bảng 3: So sánh giữa các cấu hình Spoke OSPFv3
Tùy chọn cấu hình | Spoke 1 | Spoke 2 |
---|---|---|
Giao diện st0.1 | 2001:db8:9000::2/64 | 2001:db8:9000::3/64 |
Giao diện mạng nội bộ | (ge-0/0/1.0) – 2001:db8:4000::1/64 | (ge-0/0/1.0) – 2001:db8:6000::1/64 |
Giao diện kết nối Internet | (ge-0/0/0.0) – 2001:db8:3000::2/64 | (ge-0/0/0.0) – 2001:db8:5000::2/64 |
Thông tin định tuyến giữa tất cả các thiết bị được trao đổi thông qua các đường hầm VPN.
Trong ví dụ này, tất cả các thiết bị đều sử dụng chính sách bảo mật mặc định, cho phép toàn bộ lưu lượng. Tuy nhiên, trong môi trường thực tế (production), nên cấu hình các chính sách bảo mật nghiêm ngặt hơn. Xem thêm tại mục Tổng quan về chính sách bảo mật (Security Policies Overview).
Hình 1 minh họa các thiết bị tường lửa dòng SRX của Juniper được cấu hình cho triển khai ADVPN với OSPFv3 trong ví dụ này.
Để cấu hình ADVPN, hãy thực hiện các bước sau:
Phần đầu tiên mô tả cách lấy chứng chỉ CA và chứng chỉ cục bộ thông qua giao thức SCEP (Simple Certificate Enrollment Protocol) trực tuyến trên các thiết bị hub và spoke.
Đăng ký chứng chỉ thiết bị với SCEP
Quy trình từng bước
Để đăng ký chứng chỉ số với SCEP trên thiết bị hub, bạn cần:
[edit] user@host# set security pki ca-profile ca-profile1 ca-identity ca-profile1 user@host# set security pki ca-profile ca-profile1 enrollment url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll user@host# set security pki ca-profile ca-profile1 revocation-check disable user@host# commit |
user@host> request security pki ca-certificate enroll ca-profile ca-profile1 |
Nhập 'yes' tại lời nhắc để tải chứng chỉ CA.
user@host> request security pki generate-key-pair certificate-id Local1 |
user@host> request security pki local-certificate enroll ca-profile ca-profile1 certificate-id Local1 domain-name example.net email hub@example.net ip-address 10.1.1.1 subject DC=example.net,CN=hub,OU=SLT,O=example,L=Bengaluru,ST=KA,C=IN challenge-password |
user@host> show security pki local-certificate detail Certificate identifier: Local1 Certificate version: 3 Serial number: 40a6d5f300000000258d Issuer: Common name: CASERVER1, Domain component: net, Domain component: internal Subject: Organization: example, Organizational unit: SLT, Country: IN, State: KA, Locality: Bengaluru, Common name: hub, Domain component: example.net Subject string: C=IN, DC=example.net, ST=KA, L=Bengaluru, O=example, OU=SLT, CN=hub Alternate subject: "hub@example.net", example.net, 10.1.1.1 Validity: Not before: 11- 6-2012 09:39 Not after: 11- 6-2013 09:49 Public key algorithm: rsaEncryption(1024 bits) 30:81:89:02:81:81:00:c9:c9:cc:30:b6:7a:86:12:89:b5:18:b3:76 01:2d:cc:65:a8:a8:42:78:cd:d0:9a:a2:c0:aa:c4:bd:da:af:88:f3 2a:78:1f:0a:58:e6:11:2c:81:8f:0e:7c:de:86:fc:48:4c:28:5b:8b 34:91:ff:2e:91:e7:b5:bd:79:12:de:39:46:d9:fb:5c:91:41:d1:da 90:f5:09:00:9b:90:07:9d:50:92:7d:ff:fb:3f:3c:bc:34:e7:e3:c8 ea:cb:99:18:b4:b6:1d:a8:99:d3:36:b9:1b:36:ef:3e:a1:fd:48:82 6a:da:22:07:da:e0:d2:55:ef:57:be:09:7a:0e:17:02:03:01:00:01 Signature algorithm: sha1WithRSAEncryption Distribution CRL: http://ca-server1/CertEnroll/CASERVER1.crl file://\\ca-server1\CertEnroll\CASERVER1.crl Fingerprint: e1:f7:a1:a6:1e:c3:97:69:a5:07:9b:09:14:1a:c7:ae:09:f1:f6:35 (sha1) a0:02:fa:8d:5c:63:e5:6d:f7:f4:78:56:ac:4e:b2:c4 (md5) Auto-re-enrollment: Status: Disabled Next trigger time: Timer not started |
Quy trình từng bước
Để đăng ký chứng chỉ số với SCEP trên spoke 1:
[edit] user@host# set security pki ca-profile ca-profile1 ca-identity ca-profile1 user@host# set security pki ca-profile ca-profile1 enrollment url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll user@host# set security pki ca-profile ca-profile1 revocation-check disable user@host# commit |
user@host> request security pki ca-certificate enroll ca-profile ca-profile1 |
Nhập 'yes' tại dấu nhắc để tải chứng chỉ CA.
user@host> request security pki generate-key-pair certificate-id Local1 |
user@host> request security pki local-certificate enroll ca-profile ca-profile1 certificate-id Local1 domain-name example.net email spoke1@example.net ip-address 10.2.2.1 subject DC=example.net,CN=spoke1,OU=SLT,O=example,L=Mysore,ST=KA,C=IN challenge-password |
user@host> show security pki local-certificate detail Certificate identifier: Local1 Certificate version: 3 Serial number: 40a7975f00000000258e Issuer: Common name: CASERVER1, Domain component: net, Domain component: internal Subject: Organization: example, Organizational unit: SLT, Country: IN, State: KA, Locality: Mysore, Common name: spoke1, Domain component: example.net Subject string: C=IN, DC=example.net, ST=KA, L=Mysore, O=example, OU=SLT, CN=spoke1 Alternate subject: "spoke1@example.net", example.net, 10.2.2.1 Validity: Not before: 11- 6-2012 09:40 Not after: 11- 6-2013 09:50 Public key algorithm: rsaEncryption(1024 bits) 30:81:89:02:81:81:00:d8:45:09:77:cd:36:9a:6f:58:44:18:91:db b0:c7:8a:ee:c8:d7:a6:d2:e2:e7:20:46:2b:26:1a:92:e2:4e:8a:ce c9:25:d9:74:a2:81:ad:ea:e0:38:a0:2f:2d:ab:a6:58:ac:88:35:f4 90:01:08:33:33:75:2c:44:26:f8:25:18:97:96:e4:28:de:3b:35:f2 4a:f5:92:b7:57:ae:73:4f:8e:56:71:ab:81:54:1d:75:88:77:13:64 1b:6b:01:96:15:0a:1c:54:e3:db:f8:ec:ec:27:5b:86:39:c1:09:a1 e4:24:1a:19:0d:14:2c:4b:94:a4:04:91:3f:cb:ef:02:03:01:00:01 Signature algorithm: sha1WithRSAEncryption Distribution CRL: http://ca-server1/CertEnroll/CASERVER1.crl file://\\ca-server1\CertEnroll\CASERVER1.crl Fingerprint: b6:24:2a:0e:96:5d:8c:4a:11:f3:5a:24:89:7c:df:ea:d5:c0:80:56 (sha1) 31:58:7f:15:bb:d4:66:b8:76:1a:42:4a:8a:16:b3:a9 (md5) Auto-re-enrollment: Status: Disabled Next trigger time: Timer not started |
Đơn vị tổ chức (OU) hiển thị trong trường chủ thể là SLT. Cấu hình IKE trên hub bao gồm ou=SLT để xác định spoke.
Quy trình từng bước
Để đăng ký chứng chỉ số với SCEP trên spoke 2:
[edit] user@host# set security pki ca-profile ca-profile1 ca-identity ca-profile1 user@host# set security pki ca-profile ca-profile1 enrollment url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll user@host# set security pki ca-profile ca-profile1 revocation-check disable user@host# commit |
user@host> request security pki ca-certificate enroll ca-profile ca-profile1 |
Nhập 'yes' tại dấu nhắc để tải chứng chỉ CA.
user@host> request security pki generate-key-pair certificate-id Local1 |
user@host> request security pki local-certificate enroll ca-profile ca-profile1 certificate-id Local1 domain-name example.net email spoke2@example.net ip-address 10.3.3.1 subject DC=example.net,CN=spoke2,OU=SLT,O=example,L=Tumkur,ST=KA,C=IN challenge-password |
user@host> show security pki local-certificate detail Certificate identifier: Local1 Certificate version: 3 Serial number: 40bb71d400000000258f Issuer: Common name: CASERVER1, Domain component: net, Domain component: internal Subject: Organization: example, Organizational unit: SLT, Country: IN, State: KA, Locality: Tumkur, Common name: spoke2, Domain component: example.net Subject string: C=IN, DC=example.net, ST=KA, L=Tumkur, O=example, OU=SLT, CN=spoke2 Alternate subject: "spoke2@example.net", example.net, 10.3.3.1 Validity: Not before: 11- 6-2012 10:02 Not after: 11- 6-2013 10:12 Public key algorithm: rsaEncryption(1024 bits) 30:81:89:02:81:81:00:b6:2e:e2:da:e6:ac:57:e4:5d:ff:de:f6:89 27:d6:3e:1b:4a:3f:b2:2d:b3:d3:61:ed:ed:6a:07:d9:8a:d2:24:03 77:1a:fe:84:e1:12:8a:2d:63:6e:bf:02:6b:15:96:5a:4f:37:a0:46 44:09:96:c0:fd:bb:ab:79:2c:5d:92:bd:31:f0:3b:29:51:ce:89:8e 7c:2b:02:d0:14:5b:0a:a9:02:93:21:ea:f9:fc:4a:e7:08:bc:b1:6d 7c:f8:3e:53:58:8e:f1:86:13:fe:78:b5:df:0b:8e:53:00:4a:46:11 58:4a:38:e9:82:43:d8:25:47:7d:ef:18:f0:ef:a7:02:03:01:00:01 Signature algorithm: sha1WithRSAEncryption Distribution CRL: http://ca-server1/CertEnroll/CASERVER1.crl file://\\ca-server1\CertEnroll\CASERVER1.crl Fingerprint: 1a:6d:77:ac:fd:94:68:ce:cf:8a:85:f0:39:fc:e0:6b:fd:fe:b8:66 (sha1) 00:b1:32:5f:7b:24:9c:e5:02:e6:72:75:9e:a5:f4:77 (md5) Auto-re-enrollment: Status: Disabled Next trigger time: Timer not started |
Đơn vị tổ chức (OU) hiển thị trong trường chủ thể là SLT. Cấu hình IKE trên hub bao gồm ou=SLT để nhận dạng spoke.
Cấu hình nhanh bằng CLI
Để cấu hình nhanh ví dụ này, hãy sao chép các lệnh sau, dán vào một tệp văn bản, xóa bất kỳ dòng ngắt nào, thay đổi các chi tiết cần thiết để phù hợp với cấu hình mạng của bạn, sau đó sao chép và dán các lệnh vào CLI ở cấp độ phân cấp [edit], và cuối cùng nhập commit trong chế độ cấu hình.
set chassis cluster reth-count 2 set chassis cluster node 0 set chassis cluster node 1 set chassis cluster redundancy-group 0 node 0 priority 254 set chassis cluster redundancy-group 0 node 1 priority 1 set chassis cluster redundancy-group 1 node 0 priority 254 set chassis cluster redundancy-group 1 node 1 priority 1 set security pki ca-profile ROOT-CA ca-identity ROOT-CA set security pki ca-profile ROOT-CA enrollment url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll set security pki ca-profile ROOT-CA enrollment retry 5 set security pki ca-profile ROOT-CA enrollment retry-interval 0 set security pki ca-profile ROOT-CA revocation-check disable set security ike proposal IKE_PROP authentication-method rsa-signatures set security ike proposal IKE_PROP dh-group group19 set security ike proposal IKE_PROP authentication-algorithm sha-384 set security ike proposal IKE_PROP encryption-algorithm aes-256-cbc set security ike proposal IKE_PROP lifetime-seconds 6000 set security ike policy IKE_POL mode main set security ike policy IKE_POL proposals IKE_PROP set security ike policy IKE_POL certificate local-certificate HUB set security ike gateway IKE_GWA_1 ike-policy IKE_POL set security ike gateway IKE_GWA_1 dynamic distinguished-name wildcard OU=SLT set security ike gateway IKE_GWA_1 dynamic ike-user-type group-ike-id set security ike gateway IKE_GWA_1 dead-peer-detection always-send set security ike gateway IKE_GWA_1 dead-peer-detection interval 10 set security ike gateway IKE_GWA_1 dead-peer-detection threshold 3 set security ike gateway IKE_GWA_1 local-identity distinguished-name set security ike gateway IKE_GWA_1 external-interface reth1 set security ike gateway IKE_GWA_1 advpn partner disable set security ike gateway IKE_GWA_1 version v2-only set security ipsec proposal IPSEC_PROP protocol esp set security ipsec proposal IPSEC_PROP encryption-algorithm aes-256-gcm set security ipsec proposal IPSEC_PROP lifetime-seconds 3000 set security ipsec policy IPSEC_POL perfect-forward-secrecy keys group19 set security ipsec policy IPSEC_POL proposals IPSEC_PROP set security ipsec vpn IPSEC_VPNA_1 bind-interface st0.1 set security ipsec vpn IPSEC_VPNA_1 ike gateway IKE_GWA_1 set security ipsec vpn IPSEC_VPNA_1 ike ipsec-policy IPSEC_POL set security policies default-policy permit-all set security zones security-zone untrust host-inbound-traffic system-services all set security zones security-zone untrust host-inbound-traffic protocols ospf3 set security zones security-zone untrust interfaces reth1.0 set security zones security-zone untrust interfaces st0.1 set security zones security-zone trust host-inbound-traffic system-services all set security zones security-zone trust host-inbound-traffic protocols ospf3 set security zones security-zone trust interfaces reth0.0 set interfaces ge-0/0/0 gigether-options redundant-parent reth1 set interfaces ge-0/0/1 gigether-options redundant-parent reth0 set interfaces ge-7/0/0 gigether-options redundant-parent reth1 set interfaces ge-7/0/1 gigether-options redundant-parent reth0 set interfaces reth0 redundant-ether-options redundancy-group 1 set interfaces reth0 unit 0 family inet set interfaces reth0 unit 0 family inet6 address 2001:db8:1000::1/64 set interfaces reth1 redundant-ether-options redundancy-group 1 set interfaces reth1 unit 0 family inet set interfaces reth1 unit 0 family inet6 address 2001:db8:2000::1/64 set interfaces st0 unit 1 multipoint set interfaces st0 unit 1 family inet6 address 2001:db8:9000::1/64 set routing-options rib inet6.0 static route 2001:db8:3000::0/64 next-hop 2001:db8:2000::2 set routing-options rib inet6.0 static route 2001:db8:5000::0/64 next-hop 2001:db8:2000::2 set protocols ospf3 area 0.0.0.0 interface reth0.0 set protocols ospf3 area 0.0.0.0 interface st0.1 interface-type p2mp set protocols ospf3 area 0.0.0.0 interface st0.1 dynamic-neighbors |
Quy trình từng bước
Ví dụ sau yêu cầu bạn điều hướng qua nhiều cấp độ trong hệ thống phân cấp cấu hình. Để biết hướng dẫn cách thực hiện điều đó, hãy xem phần Sử dụng trình chỉnh sửa CLI trong chế độ cấu hình.
Để cấu hình hub:
[edit interfaces] user@host# set ge-0/0/0 gigether-options redundant-parent reth1 user@host# set ge-0/0/1 gigether-options redundant-parent reth0 user@host# set ge-7/0/0 gigether-options redundant-parent reth1 user@host# set ge-7/0/1 gigether-options redundant-parent reth0 user@host# set reth0 redundant-ether-options redundancy-group 1 user@host# set reth0 unit 0 family inet user@host# set reth0 unit 0 family inet6 address 2001:db8:1000::1/64 user@host# set reth1 redundant-ether-options redundancy-group 1 user@host# set reth1 unit 0 family inet user@host# set reth1 unit 0 family inet6 address 2001:db8:2000::1/64 user@host# set st0 unit 1 multipoint user@host# set st0 unit 1 family inet6 address 2001:db8:9000::1/64 |
[edit protocols ospf3] user@host# set ospf3 area 0.0.0.0 interface reth0.0 user@host# set ospf3 area 0.0.0.0 interface st0.1 interface-type p2mp user@host# set ospf3 area 0.0.0.0 interface st0.1 dynamic-neighbors [edit routing-options] user@host# set rib inet6.0 static route 2001:db8:3000::0/64 next-hop 2001:db8:2000::2 user@host# set rib inet6.0 static route 2001:db8:5000::0/64 next-hop 2001:db8:2000::2 |
[edit security ike proposal IKE_PROP] user@host# set authentication-method rsa-signatures user@host# set dh-group group19 user@host# set authentication-algorithm sha-384 user@host# set encryption-algorithm aes-256-cbc user@host# set lifetime-seconds 6000 [edit security ike policy IKE_POL] user@host# set mode main user@host# set proposals IKE_PROP user@host# set certificate local-certificate HUB [edit security ike gateway IKE_GWA_1] user@host# set ike-policy IKE_POL user@host# set dynamic distinguished-name wildcard OU=SLT user@host# set ike-user-type group-ike-id user@host# set dead-peer-detection always-send user@host# set dead-peer-detection interval 10 user@host# set dead-peer-detection threshold 3 user@host# set local-identity distinguished-name user@host# set external-interface reth1 user@host# set version v2-only |
[edit security ipsec proposal IPSEC_PROP] user@host# set protocol esp user@host# set encryption-algorithm aes-256-gcm user@host# set lifetime-seconds 3000 [edit security ipsec policy IPSEC_POL] user@host# set perfect-forward-secrecy keys group19 user@host# set proposals IPSEC_PROP [edit security ipsec vpn IPSEC_VPNA_1] user@host# set bind-interface st0.1 user@host# set ike gateway IKE_GWA_1 user@host# set ike ipsec-policy IPSEC_POL |
[edit security zones security-zone untrust] user@host# set host-inbound-traffic system-services all user@host# set host-inbound-traffic protocols ospf3 user@host# set interfaces reth1.0 user@host# set interfaces st0.1 [edit security zones security-zone trust] user@host# set host-inbound-traffic system-services all user@host# set host-inbound-traffic protocols ospf3 user@host# set interfaces reth0.0 |
[edit security policies] user@host# set default-policy permit-all |
[edit security pki] user@host# set ca-profile ROOT-CA ca-identity ROOT-CA user@host# set ca-profile ROOT-CA enrollment url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll user@host# set ca-profile ROOT-CA enrollment retry 5 user@host# set ca-profile ROOT-CA enrollment retry-interval 0 user@host# set pki ca-profile ROOT-CA revocation-check disable |
[edit chassis cluster] set reth-count 2 set node 0 set node 1 set redundancy-group 0 node 0 priority 254 set redundancy-group 0 node 1 priority 1 set redundancy-group 1 node 0 priority 254 set redundancy-group 1 node 1 priority 1 |
Kết quả
Từ chế độ cấu hình, xác nhận cấu hình của bạn bằng cách nhập các lệnh: show interfaces
, show protocols
, show routing-options
, show security ike
, show security ipsec
, show security zones
, show security policies
, show security pki và
show chassis cluster
. Nếu kết quả đầu ra không hiển thị đúng cấu hình như mong muốn, hãy thực hiện lại các bước cấu hình trong ví dụ này để sửa lỗi.
[edit] user@host# show interfaces ge-0/0/0 { gigether-options { redundant-parent reth1;}} ge-0/0/1 { gigether-options { redundant-parent reth0;}} reth0 { redundant-ether-options { redundancy-group 1;} unit 0 { family inet; family inet6 { address 2001:db8:1000::1/64;}}} reth1 { redundant-ether-options { redundancy-group 1;} unit 0 { family inet; family inet6 { address 2001:db8:2000::1/64;}}} st0 { unit 1 { multipoint; family inet6 { address 2001:db8:9000::1/64 { primary;}}}} [edit] user@host# show protocols ospf3 { area 0.0.0.0 { interface st0.1 { interface-type p2mp; demand-circuit; dynamic-neighbors;} interface ge-0/0/1.0; interface reth0.0;}} [edit] user@host# show routing-options rib inet6.0 { static { route 2001:db8:3000::/64 next-hop 2001:db8:2000::2; route 2001:db8:5000::/64 next-hop 2001:db8:2000::2;}} [edit] user@host# show security ike proposal IKE_PROP { authentication-method rsa-signatures; dh-group group19; authentication-algorithm sha-384; encryption-algorithm aes-256-cbc; lifetime-seconds 6000;} policy IKE_POL { mode main; proposals IKE_PROP; certificate { local-certificate HUB;}} gateway IKE_GWA_1 { ike-policy IKE_POL; dynamic { distinguished-name { wildcard OU=SLT;} ike-user-type group-ike-id;} dead-peer-detection { always-send; interval 10; threshold 3;} local-identity distinguished-name; external-interface reth1; advpn { partner { disable;}} version v2-only;} [edit] user@host# show security ipsec proposal IPSEC_PROP { protocol esp; encryption-algorithm aes-256-gcm; lifetime-seconds 3000;} policy IPSEC_POL { perfect-forward-secrecy { keys group19;} proposals IPSEC_PROP;} vpn IPSEC_VPNA_1 { bind-interface st0.1; ike { gateway IKE_GWA_1; ipsec-policy IPSEC_POL;}} [edit] user@host# show security zones security-zone untrust { host-inbound-traffic { system-services { all;} protocols { ospf3;}} interfaces { st0.1; reth1.0;}} security-zone trust { host-inbound-traffic { system-services { all;} protocols { ospf3;}} interfaces { reth0.0;}} [edit] user@host# show security policies default-policy { permit-all;} [edit] user@host# show security pki ca-profile ROOT-CA { ca-identity ROOT-CA; enrollment { url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll; retry 5; retry-interval 0;} revocation-check { disable;}} |
Nếu bạn đã hoàn tất cấu hình thiết bị, hãy nhập lệnh commit từ chế độ cấu hình.
Cấu hình nhanh bằng CLI
Để cấu hình nhanh ví dụ này, hãy sao chép các lệnh sau, dán vào một tệp văn bản, xóa bất kỳ dòng ngắt nào, thay đổi các chi tiết cần thiết để phù hợp với cấu hình mạng của bạn, sau đó sao chép và dán các lệnh vào CLI ở cấp độ phân cấp [edit], và cuối cùng nhập commit trong chế độ cấu hình.
set security pki ca-profile ROOT-CA ca-identity ROOT-CA set security pki ca-profile ROOT-CA enrollment url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll set security pki ca-profile ROOT-CA enrollment retry 5 set security pki ca-profile ROOT-CA enrollment retry-interval 0 set security pki ca-profile ROOT-CA revocation-check disable set security ike proposal IKE_PROP authentication-method rsa-signatures set security ike proposal IKE_PROP dh-group group19 set security ike proposal IKE_PROP authentication-algorithm sha-384 set security ike proposal IKE_PROP encryption-algorithm aes-256-cbc set security ike proposal IKE_PROP lifetime-seconds 6000 set security ike policy IKE_POL mode main set security ike policy IKE_POL proposals IKE_PROP set security ike policy IKE_POL certificate local-certificate SPOKE1 set security ike gateway IKE_GW_SPOKE_1 ike-policy IKE_POL set security ike gateway IKE_GW_SPOKE_1 address 2001:db8:2000::1 set security ike gateway IKE_GW_SPOKE_1 dead-peer-detection always-send set security ike gateway IKE_GW_SPOKE_1 dead-peer-detection interval 10 set security ike gateway IKE_GW_SPOKE_1 dead-peer-detection threshold 3 set security ike gateway IKE_GW_SPOKE_1 local-identity distinguished-name set security ike gateway IKE_GW_SPOKE_1 remote-identity distinguished-name container OU=SLT set security ike gateway IKE_GW_SPOKE_1 external-interface ge-0/0/0.0 set security ike gateway IKE_GW_SPOKE_1 advpn suggester disable set security ike gateway IKE_GW_SPOKE_1 version v2-only set security ipsec proposal IPSEC_PROP protocol esp set security ipsec proposal IPSEC_PROP encryption-algorithm aes-256-gcm set security ipsec proposal IPSEC_PROP lifetime-seconds 3000 set security ipsec policy IPSEC_POL perfect-forward-secrecy keys group19 set security ipsec policy IPSEC_POL proposals IPSEC_PROP set security ipsec vpn IPSEC_VPN_SPOKE_1 bind-interface st0.1 set security ipsec vpn IPSEC_VPN_SPOKE_1 ike gateway IKE_GW_SPOKE_1 set security ipsec vpn IPSEC_VPN_SPOKE_1 ike ipsec-policy IPSEC_POL set security ipsec vpn IPSEC_VPN_SPOKE_1 establish-tunnels immediately set security policies default-policy permit-all set security zones security-zone trust host-inbound-traffic system-services all set security zones security-zone trust host-inbound-traffic protocols ospf3 set security zones security-zone trust interfaces ge-0/0/1.0 set security zones security-zone untrust host-inbound-traffic system-services all set security zones security-zone untrust host-inbound-traffic protocols ospf3 set security zones security-zone untrust interfaces st0.1 set security zones security-zone untrust interfaces ge-0/0/0.0 set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:3000::2/64 set interfaces ge-0/0/1 unit 0 family inet6 address 2001:db8:4000::1/64 set interfaces st0 unit 1 multipoint set interfaces st0 unit 1 family inet6 address 2001:db8:9000::2/64 set routing-options rib inet6.0 static route 2001:db8:2000::0/64 next-hop 2001:db8:3000::1 set protocols ospf3 area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf3 area 0.0.0.0 interface st0.1 interface-type p2mp set protocols ospf3 area 0.0.0.0 interface st0.1 dynamic-neighbors |
Quy trình từng bước
Ví dụ sau yêu cầu bạn điều hướng qua nhiều cấp trong hệ thống phân cấp cấu hình. Để biết hướng dẫn cách thực hiện, hãy xem phần Sử dụng trình chỉnh sửa CLI trong chế độ cấu hình.
Để cấu hình spoke 1:
[edit interfaces] user@host# set ge-0/0/0 unit 0 family inet6 address 2001:db8:3000::2/64 user@host# set ge-0/0/1 unit 0 family inet6 address 2001:db8:4000::1/64 user@host# set st0 unit 1 multipoint user@host# set st0 unit 1 family inet6 address 2001:db8:9000::2/64 |
[edit protocols ospf3] set area 0.0.0.0 interface ge-0/0/1.0 set area 0.0.0.0 interface st0.1 interface-type p2mp set area 0.0.0.0 interface st0.1 dynamic-neighbors [edit routing-options] user@host# set rib inet6.0 static route 2001:db8:2000::/64 next-hop 2001:db8:3000::1 |
[edit security ike proposal IKE_PROP] user@host# set authentication-method rsa-signatures user@host# set dh-group group19 user@host# set authentication-algorithm sha-384 user@host# set encryption-algorithm aes-256-cbc user@host# set lifetime-seconds 6000 [edit security ike policy IKE_POL] user@host# set mode main user@host# set proposals IKE_PROP user@host# set certificate local-certificate SPOKE1 [edit security ike gateway IKE_GW_SPOKE_1] user@host# set ike-policy IKE_POL user@host# set address 2001:db8:2000::1 user@host# set dead-peer-detection always-send user@host# set dead-peer-detection interval 10 user@host# set dead-peer-detection threshold 3 user@host# set local-identity distinguished-name user@host# set remote-identity distinguished-name container OU=SLT user@host# set external-interface ge-0/0/0.0 user@host# set advpn suggester disable user@host# set version v2-only |
[edit security ipsec proposal IPSEC_PROPl] user@host# set protocol esp user@host# set encryption-algorithm aes-256-gcm user@host# set lifetime-seconds 3000 [edit security ipsec policy IPSEC_POL] user@host# set perfect-forward-secrecy keys group19 user@host# set proposals IPSEC_PROP [edit security ipsec vpn IPSEC_VPN_SPOKE_1] user@host# set bind-interface st0.1 user@host# set ike gateway IKE_GW_SPOKE_1 user@host# set ike ipsec-policy IPSEC_POL user@host# set establish-tunnels immediately |
[edit security zones security-zone untrust] user@host# set host-inbound-traffic system-services all user@host# set host-inbound-traffic protocols ospf3 user@host# set interfaces st0.1 user@host# set interfaces ge-0/0/0.0 [edit security zones security-zone trust] user@host# set host-inbound-traffic system-services all user@host# set host-inbound-traffic protocols ospf3 user@host# set interfaces ge-0/0/1.0 |
[edit security policies] user@host# set default-policy permit-all |
[edit security pki] user@host# set ca-profile ROOT-CA ca-identity ROOT-CA user@host# set ca-profile ROOT-CA enrollment url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll user@host# set ca-profile ROOT-CA enrollment retry 5 user@host# set ca-profile ROOT-CA enrollment retry-interval 0 user@host# set ca-profile ROOT-CA revocation-check disable |
Kết quả
Từ chế độ cấu hình, xác nhận cấu hình của bạn bằng cách nhập các lệnh: show interfaces
, show protocols
, show routing-options
, show security ike
, show security ipsec
, show security zones
, show security policies
và show security pki
. Nếu kết quả đầu ra không hiển thị đúng cấu hình như mong muốn, hãy lặp lại các bước cấu hình trong ví dụ này để chỉnh sửa.
[edit] user@host# show interfaces ge-0/0/0 { unit 0 { family inet6 { address 2001:db8:3000::2/64;}}} ge-0/0/1 { unit 0 { family inet6 { address 2001:db8:4000::1/64;}}} st0 { unit 1 { multipoint; family inet6 { address 2001:db8:9000::2/64;}}} [edit] user@host# show protocols ospf3 { area 0.0.0.0 { interface st0.1 { interface-type p2mp; dynamic-neighbors;} interface ge-0/0/1.0;}} [edit] user@host# show routing-options rib inet6.0 { static { route 2001:db8:2000::/64 next-hop [ 2001:db8:3000::1 2001:db8:5000::1 ];}} [edit] user@host# show security ike proposal IKE_PROP { authentication-method rsa-signatures; dh-group group19; authentication-algorithm sha-384; encryption-algorithm aes-256-cbc; lifetime-seconds 6000;} policy IKE_POL { mode main; proposals IKE_PROP; certificate { local-certificate SPOKE1;}} gateway IKE_GW_SPOKE_1 { ike-policy IKE_POL; address 2001:db8:2000::1; dead-peer-detection { always-send; interval 10; threshold 3;} local-identity distinguished-name; remote-identity distinguished-name container OU=SLT; external-interface ge-0/0/0.0; advpn { suggester { disable;}} version v2-only;} [edit] user@host# show security ipsec proposal IPSEC_PROP { protocol esp; encryption-algorithm aes-256-gcm; lifetime-seconds 3000;} policy IPSEC_POL { perfect-forward-secrecy { keys group19;} proposals IPSEC_PROP;} vpn IPSEC_VPN_SPOKE_1 { bind-interface st0.1; ike { gateway IKE_GW_SPOKE_1; ipsec-policy IPSEC_POL;} establish-tunnels immediately;} [edit] user@host# show security zones security-zone untrust { host-inbound-traffic { system-services { all;} protocols { ospf3;}} interfaces { st0.1; ge-0/0/0.0;}} security-zone trust { host-inbound-traffic { system-services { all;} protocols { ospf3;}} interfaces { ge-0/0/1.0;}} [edit] user@host# show security policies default-policy { permit-all;} [edit] user@host# show security pki ca-profile ROOT-CA { ca-identity ROOT-CA; enrollment { url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll; retry 5; retry-interval 0;} revocation-check { disable;}} |
Nếu bạn đã hoàn tất cấu hình thiết bị, hãy nhập lệnh commit từ chế độ cấu hình.
Cấu hình nhanh bằng CLI
Để cấu hình nhanh ví dụ này, hãy sao chép các lệnh sau, dán vào một tệp văn bản, xóa bất kỳ dấu ngắt dòng nào, chỉnh sửa các thông tin cần thiết để phù hợp với cấu hình mạng của bạn, sau đó sao chép và dán các lệnh vào CLI tại cấp phân cấp [edit], rồi nhập lệnh commit trong chế độ cấu hình.
set security pki ca-profile ROOT-CA ca-identity ROOT-CA set security pki ca-profile ROOT-CA enrollment url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll set security pki ca-profile ROOT-CA enrollment retry 5 set security pki ca-profile ROOT-CA enrollment retry-interval 0 set security pki ca-profile ROOT-CA revocation-check disable set security ike proposal IKE_PROP authentication-method rsa-signatures set security ike proposal IKE_PROP dh-group group19 set security ike proposal IKE_PROP authentication-algorithm sha-384 set security ike proposal IKE_PROP encryption-algorithm aes-256-cbc set security ike proposal IKE_PROP lifetime-seconds 6000 set security ike policy IKE_POL mode main set security ike policy IKE_POL proposals IKE_PROP set security ike policy IKE_POL certificate local-certificate SPOKE2 set security ike gateway IKE_GW_SPOKE_2 ike-policy IKE_POL set security ike gateway IKE_GW_SPOKE_2 address 2001:db8:2000::1 set security ike gateway IKE_GW_SPOKE_2 dead-peer-detection always-send set security ike gateway IKE_GW_SPOKE_2 dead-peer-detection interval 10 set security ike gateway IKE_GW_SPOKE_2 dead-peer-detection threshold 3 set security ike gateway IKE_GW_SPOKE_2 local-identity distinguished-name set security ike gateway IKE_GW_SPOKE_2 remote-identity distinguished-name container OU=SLT set security ike gateway IKE_GW_SPOKE_2 external-interface ge-0/0/0.0 set security ike gateway IKE_GW_SPOKE_2 advpn suggester disable set security ike gateway IKE_GW_SPOKE_2 version v2-only set security ipsec proposal IPSEC_PROP protocol esp set security ipsec proposal IPSEC_PROP encryption-algorithm aes-256-gcm set security ipsec proposal IPSEC_PROP lifetime-seconds 3000 set security ipsec policy IPSEC_POL perfect-forward-secrecy keys group19 set security ipsec policy IPSEC_POL proposals IPSEC_PROP set security ipsec vpn IPSEC_VPN_SPOKE_2 bind-interface st0.1 set security ipsec vpn IPSEC_VPN_SPOKE_2 ike gateway IKE_GW_SPOKE_2 set security ipsec vpn IPSEC_VPN_SPOKE_2 ike ipsec-policy IPSEC_POL set security ipsec vpn IPSEC_VPN_SPOKE_2 establish-tunnels immediately set security policies default-policy permit-all set security zones security-zone trust host-inbound-traffic system-services all set security zones security-zone trust host-inbound-traffic protocols ospf3 set security zones security-zone trust interfaces ge-0/0/1.0 set security zones security-zone untrust host-inbound-traffic system-services all set security zones security-zone untrust host-inbound-traffic protocols ospf3 set security zones security-zone untrust interfaces st0.1 set security zones security-zone untrust interfaces ge-0/0/0.0 set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:5000::2/64 set interfaces ge-0/0/1 unit 0 family inet6 address 2001:db8:6000::1/64 set interfaces st0 unit 1 family inet6 address 2001:db8:9000::3/64 set routing-options rib inet6.0 static route 2001:db8:2000::/64 next-hop 2001:db8:5000::1 set protocols ospf3 area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf3 area 0.0.0.0 interface st0.1 interface-type p2mp set protocols ospf3 area 0.0.0.0 interface st0.1 dynamic-neighbors |
Quy trình từng bước
Ví dụ sau yêu cầu bạn điều hướng qua nhiều cấp trong hệ thống phân cấp cấu hình. Để biết hướng dẫn cách thực hiện, hãy xem phần Sử dụng trình chỉnh sửa CLI trong chế độ cấu hình.
Để cấu hình spoke 2:
[edit interfaces] user@host# set ge-0/0/0 unit 0 family inet6 address 2001:db8:5000::2/64 user@host# set ge-0/0/1 unit 0 family inet6 address 2001:db8:6000::1/64 user@host# set st0 unit 1 family inet6 address 2001:db8:9000::3/64 |
[edit protocols ospf3] user@host# set area 0.0.0.0 interface st0.1 interface-type p2mp user@host# set area 0.0.0.0 interface st0.1 dynamic-neighbors user@host# set area 0.0.0.0 interface ge-0/0/1.0 [edit routing-options] user@host# set rib inet6.0 static route 2001:db8:2000::/64 next-hop 2001:db8:5000::1 |
[edit security ike proposal IKE_PROP] user@host# set authentication-method rsa-signatures user@host# set dh-group group19 user@host# set authentication-algorithm sha-384 user@host# set encryption-algorithm aes-256-cbc user@host# set lifetime-seconds 6000 [edit security ike policy IKE_POL] user@host# set mode main user@host# set proposals IKE_PROP user@host# set certificate local-certificate SPOKE2 [edit security ike gateway IKE_GW_SPOKE_2] user@host# set ike-policy IKE_POL user@host# set address 2001:db8:2000::1 user@host# set dead-peer-detection always-send user@host# set dead-peer-detection interval 10 user@host# set dead-peer-detection threshold 3 user@host# set local-identity distinguished-name user@host# set remote-identity distinguished-name container OU=SLT user@host# set external-interface ge-0/0/0.0 user@host# set advpn suggester disable user@host# set version v2-only |
[edit security ipsec proposal IPSEC_PROPl] user@host# set protocol esp user@host# set encryption-algorithm aes-256-gcm user@host# set lifetime-seconds 3000 [edit security ipsec policy IPSEC_POL] user@host# set perfect-forward-secrecy keys group19 user@host# set proposals IPSEC_PROP [edit security ipsec vpn IPSEC_VPN_SPOKE_2] user@host# set bind-interface st0.1 user@host# set ike gateway IKE_GW_SPOKE_2 user@host# set ike ipsec-policy IPSEC_POL user@host# set establish-tunnels immediately |
[edit security zones security-zone untrust] user@host# set host-inbound-traffic system-services all user@host# set host-inbound-traffic protocols ospf3 user@host# set interfaces st0.1 user@host# set interfaces ge-0/0/0.0 [edit security zones security-zone trust] user@host# set host-inbound-traffic system-services all user@host# set host-inbound-traffic protocols ospf3 user@host# set interfaces ge-0/0/1.0 |
[edit security policies] user@host# set default-policy permit-all |
[edit security pki] user@host# set ca-profile ROOT-CA ca-identity ROOT-CA user@host# set ca-profile ROOT-CA enrollment url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll user@host# set ca-profile ROOT-CA enrollment retry 5 user@host# set ca-profile ROOT-CA enrollment retry-interval 0 user@host# set ca-profile ROOT-CA revocation-check disable |
Kết quả
Từ chế độ cấu hình, xác nhận cấu hình của bạn bằng cách nhập các lệnh: show interfaces
, show protocols
, show routing-options
, show security ike
, show security ipsec
, show security zones
, show security policies
và show security pki
. Nếu kết quả đầu ra không hiển thị đúng cấu hình như mong muốn, hãy lặp lại các bước cấu hình trong ví dụ này để chỉnh sửa.
[edit] user@host# show interfaces ge-0/0/0 { unit 0 { family inet6 { address 2001:db8:5000::2/64;}}} ge-0/0/1 { unit 0 { family inet6 { address 2001:db8:6000::1/64;}}} st0 { unit 1 { family inet6 { address 2001:db8:9000::3/64;}}} [edit] user@host# show protocols ospf3 { area 0.0.0.0 { interface st0.1 { interface-type p2mp; dynamic-neighbors;} interface ge-0/0/1.0;}} [edit] user@host# show routing-options rib inet6.0 { static { route 2001:db8:2000::/64 next-hop [ 2001:db8:3000::1 2001:db8:5000::1 ];}} [edit] user@host# show security ike proposal IKE_PROP { authentication-method rsa-signatures; dh-group group19; authentication-algorithm sha-384; encryption-algorithm aes-256-cbc; lifetime-seconds 6000;} policy IKE_POL { mode main; proposals IKE_PROP; certificate { local-certificate SPOKE2;}} gateway IKE_GW_SPOKE_2 { ike-policy IKE_POL; address 2001:db8:2000::1; dead-peer-detection { always-send; interval 10; threshold 3;} local-identity distinguished-name; remote-identity distinguished-name container OU=SLT; external-interface ge-0/0/0.0; advpn { suggester { disable}} version v2-only;} [edit] user@host# show security ipsec proposal IPSEC_PROP { protocol esp; encryption-algorithm aes-256-gcm; lifetime-seconds 3000;} policy IPSEC_POL { perfect-forward-secrecy { keys group19;} proposals IPSEC_PROP;} vpn IPSEC_VPN_SPOKE_2 { bind-interface st0.1; ike { gateway IKE_GW_SPOKE_2; ipsec-policy IPSEC_POL;} establish-tunnels immediately;} [edit] user@host# show security zones security-zone untrust { host-inbound-traffic { system-services { all;} protocols { ospf3;}} interfaces { ge-0/0/0.0; st0.1;}} security-zone trust { host-inbound-traffic { system-services { all;} protocols { ospf3;}} interfaces { ge-0/0/1.0;}} [edit] user@host# show security policies default-policy { permit-all;} [edit] user@host# show security pki ca-profile ROOT-CA { ca-identity ROOT-CA; enrollment { url http://2001:db8:1710:f00::2/certsrv/mscep/mscep.dll; retry 5; retry-interval 0;} revocation-check { disable;}} |
Nếu bạn đã hoàn tất cấu hình thiết bị, hãy nhập lệnh commit
từ chế độ cấu hình.
Chúc các bạn thực hiện thành công. Hi vọng bài viết này sẽ giúp ích cho các bạn trong công việc. Nếu bạn có vấn đề gì thắc mắc đừng ngần ngại liên hệ với chúng tôi theo thông tin dưới đây để được hỗ trợ thêm.
Hẹn gặp lại các bạn trong các bài viết tiếp theo!
CÔNG TY CỔ PHẦN DỊCH VỤ CÔNG NGHỆ DATECH
• Địa chỉ: Số 23E4 KĐT Cầu Diễn, Tổ 7, Phú Diễn, Bắc Từ Liêm, Hà Nội
• Điện thoại: 02432012368
• Hotline: 098 115 6699
• Email: info@datech.vn
• Website: https://datech.vn