A. Cấu hình trên Pfsense 

1. Trên pfSense VPN server, vào VPN >> IPsec, nhấn add P1 tạo mới IPsec VPN profile.

2. Cấu hình phase 1 như bên dưới:

  • Key Exchange version:  Chọn IKEv2
  • Interface: Chọn WAN cho phép nhận kết nối VPN
  • Remote Gateway: Điền IP WAN Vigor Router
  • Description:  Đặt tên profile
  • Authentication Method: Chọn Mutual PSK
  • Nhấn Generate PreShared Key và copy lưu lại

  • Chọn chế độ mã hóa Phase 1 proposal. Trong ví dụ này, chúng ta sử dụng thuật toán mã hóa mạnh nhất AES256 SHA256 DH Group 14.
  • Life Time: điề life time của phase 1 là  28800 giây

  • Trong Advanced Options, Child SA Start Action, Chọn “None (Responder Only)” để giữ kết nối IKEv2 ổn định với Vigor Router. Nhấn Save lưu lại cấu hình phase 1.

3. Chọn VPN profile vừa tạo và nhấn Add P2 để cấu hình phase 2

  • Local Network chọn lớp mạng nội bộ pfSense
  • Remote Network: điền lớp mạng lan Vigor Router

  • Protocol: chọn ESP
  • encryption Algorithms: chọn AES 256bits/ SHA256
  • PFS key group chọn Group 14,
  • Life Time: chọn Life time phase 2 86400 giây

  • Trong Advanced IPsec Settings, Make before Break check Enable.

B. Cấu hình trên Vigor Router

4. vào VPN and Remote Access >> LAN to LAN, nhấn index bất kì và cấu hình profile như bên dưới

Trong Common Settings,

  • Check Enable this profile
  • Đặt tên Profile
  • Call Direction chọn "Dial-Out"
  • Dial-Out Through, chọn WAN kết nối vpn
  • Always on: chọn Enable

Trong Dial-Out Settings,

  • Chọn IPsec Tunnel, và chọn IKEv2
  • Server IP/ host name: Điền IP WAN pfSense
  • Pre-Shared Key điền key VPN đã copy trên Pfsense.
  • Chọn chế đọ mã hóa  AES256/G14/SHA256 cho phase 1 và phase 2

Trong IKE Advanced Settings,

  • Cấu hình Phase 2 Key Lifetime là 600 giây
  • Check  enable the Perfect Forward Secret

Trong TCP/IP Network Settings,

  • Local Network: điền lớp mạng LAN của Vigor Router’s LAN
  • Remote Networ: điền lớp mạng LAN của pfSense
  • Nhấn OK để hoàn tất cấu hình

5. Vào VPN and Remote Access >> Connection Management kiểm tra trạng thái kết nối kênh VPN.