Overviews
Initial Setup
Hướng dẫn nhanh (Quick Starts)
Hướng dẫn chi tiết (Tutorials)
FAQs
VPN Site to Site (new version)
Bài viết này hướng dẫn build thiết bị Router để đấu nối VPN_S2S với dịch vụ VPN Site-to-site của FPT Smart Cloud.
Cần đảm bảo các điều kiện sau:
* Lưu ý: Để build strongSwan, chỉ tiến hành chọn cách 1.1 hoặc cách 1.2
1.1: Build strongSwan 5.9.14 from source (tiến tới làm chủ công nghệ)
apt-get update apt-get install vim git wget traceroute ngrep net-tool gcc g++ libgmp-dev build-essential devscripts debhelper dh-make autoconf automake libtool checkinstall nmap curl
wget https://github.com/strongswan/strongswan/releases/download/5.9.14/strongswan-5.9.14.tar.gz tar -xzvf strongswan-5.9.14.tar.gz cd strongswan-5.9.14/
./configure --prefix=/usr --sysconfdir=/etc make checkinstall
apt-get update apt install strongswan strongswan-pki
1.2: Cài đặt strongSwan từ Repo
apt-get update
apt install strongswan strongswan-pki
Truy cập và tạo VPN Site To Site trên trang https://console.fptcloud.com/
- Tạo Customer Gateway:
+Remote private network: dãy Lan Subnet cần peering của Vyos
+Remote IP public: IP public của Vyos

- Tạo VPN Connection:
Thông số của VPN Connection sẽ bao gồm 3 mục chính:
Phần 1: General information

Phần 2: Remote VPN information

Quý khách hàng lựa chọn Providers = “others" sau đó làm theo các bước sau:
Đối với IKE:
Đối với IPsec:
Phần 3: Dead peer detection

Sau khi điền đầy đủ thông tin, quý khách hàng vui lòng chọn “Create VPN Connection”
- Đăng nhập ssh vào Ubuntu theo key đã tạo ở trên
- Đăng nhập ssh theo địa chỉ IP VM đã tạo với user là: "ubuntu"
Chạy các lệnh sau( thay các tham số vào):
Kiểm tra phiên bản strongSwan
swanctl -v
edit file sau /etc/ipsec.conf với mẫu:
config setup
charondebug="all"
uniqueids=yes
conn myvpn
type=tunnel
auto=start
keyexchange=ikev2
ike=aes256-sha256-modp2048
keyingtries=%forever
lifetime=3600s
dpddelay=30s
dpdtimeout=120s
dpdaction=restart
esp=aes256-sha256-modp2048
left=x.x.x.x //IP của StrongSwan
leftsubnet=x.x.x.x/24 //Subnet của StrongSwan
leftauth=psk
right=x.x.x.x // IP của đối tác
rightsubnet=x.x.x.x/24 //Subnet của đối tác
rightauth=psk
authby=secret
auto=start
Edit file sau /etc/ipsec.secret với mẫu:
# This file holds shared secrets or RSA private keys for authentication.
x.x.x.x x.x.x.x : PSK "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Pre-shared key
# RSA private key for this host, authenticating it to any other host
# which knows the public part.
- StrongSwan là một chương trình chạy nền trên Ubuntu, cần thêm enable multi-network trên CPU để đạt hiệu năng tốt nhất.
- StrongSwan là một chương trình chạy nền trên Ubuntu, cần thêm enable firewall và routing để có thể kết nối.
- Nếu lab trên Openstack của FCI thì phải add Static route trên router với Destination là IP của đối tác và nexthop là IP LAN của StrongSwan.