Bài viết này hướng dẫn build Vyos để đấ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:
Truy cập và tạo VPN Site To Site trên trang https://console.fptcloud.com/
- Tạo IPSec policy:
- Tạo IKE policy:
- 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:
Với thông số "Pre-shared key" cần lưu lại để điền vào Vyos:
- Đăng nhập ssh vào Vyos theo key đã tạo trên
- Đăng nhập ssh theo địa chỉ IP: {`IP PUBLIC`} với user là: "vyos" . Minh họa: ssh vyos@{`IP PUBLIC`}
Chạy các lệnh sau( thay các tham số vào):
configure
set interfaces ethernet eth0 address '{`IP Public Vyos`}'
set interfaces ethernet eth1 vif 111 address '{`IP LAN Vyos`}/24'
set protocols static route 0.0.0.0/0 next-hop {`IP-Remote`}
set vpn ipsec authentication psk RIGHT id '{`IP Public Vyos`}'
set vpn ipsec authentication psk RIGHT id {`IP-Remote`}
set vpn ipsec authentication psk RIGHT secret ' {`Pre-Share-Key`}'
set vpn ipsec esp-group ESP-GROUP mode 'tunnel'
set vpn ipsec esp-group ESP-GROUP proposal 1 encryption 'aes256'
set vpn ipsec esp-group ESP-GROUP proposal 1 hash 'sha256'
set vpn ipsec ike-group IKE-GROUP key-exchange 'ikev2'
set vpn ipsec ike-group IKE-GROUP proposal 1 dh-group '14'
set vpn ipsec ike-group IKE-GROUP proposal 1 encryption 'aes256'
set vpn ipsec ike-group IKE-GROUP proposal 1 hash 'sha256'
set vpn ipsec interface 'eth0'
set vpn ipsec site-to-site peer RIGHT authentication mode 'pre-shared-secret'
set vpn ipsec site-to-site peer RIGHT connection-type 'initiate'
set vpn ipsec site-to-site peer RIGHT default-esp-group 'ESP-GROUP'
set vpn ipsec site-to-site peer RIGHT ike-group 'IKE-GROUP'
set vpn ipsec site-to-site peer RIGHT local-address '{`IP Public Vyos`}'
set vpn ipsec site-to-site peer RIGHT remote-address {`IP-Remote`}
set vpn ipsec site-to-site peer RIGHT tunnel 0 local prefix '{`Sunet LAN Vyos`}/24'
set vpn ipsec site-to-site peer RIGHT tunnel 0 remote prefix '{`Sunet LAN Remote`}/24'
Save and commit
commit
save