Site-to-Site VPN
AWS Site-to-Site VPN ใช้สำหรับเชื่อมต่อเครือข่าย On-premises เข้ากับ AWS VPC ผ่าน IPsec VPN Tunnel ที่เข้ารหัส โดย traffic ยังคงวิ่งผ่าน Public Internet แต่ข้อมูลถูกเข้ารหัสทั้งหมด
องค์ประกอบหลัก
Virtual Private Gateway (VGW)
- เป็น VPN Concentrator ฝั่ง AWS
- แนบ (attach) กับ VPC ที่ต้องการเชื่อมต่อ
- รองรับ Route Propagation เพื่อให้ Route Table ของ VPC ได้รับ routes จาก On-premises โดยอัตโนมัติ
Customer Gateway (CGW)
- เป็น อุปกรณ์หรือซอฟต์แวร์ฝั่ง On-premises ที่ใช้เชื่อมต่อกับ AWS
- ต้องระบุ Public IP ของ Customer Gateway Device
- รองรับอุปกรณ์หลากหลาย เช่น Cisco, Fortinet, pfSense, Juniper
- หาก CGW อยู่หลัง NAT ต้องใช้ NAT-Traversal (NAT-T)
การทำงาน
- สร้าง Virtual Private Gateway และแนบกับ VPC
- สร้าง Customer Gateway โดยระบุ Public IP ของอุปกรณ์ On-premises
- สร้าง Site-to-Site VPN Connection เชื่อมระหว่าง VGW กับ CGW
- AWS จะสร้าง 2 VPN Tunnels เพื่อความ redundancy
- เปิดใช้ Route Propagation ใน Route Table ของ VPC
Route Propagation
- เมื่อเปิด Route Propagation บน Route Table ของ VPC
- Routes จาก On-premises (ที่ประกาศผ่าน BGP) จะถูกเพิ่มใน Route Table โดยอัตโนมัติ
- ไม่ต้องเพิ่ม static route ด้วยตนเอง
- รองรับทั้ง Static Routing และ Dynamic Routing (BGP)
VPN CloudHub
VPN CloudHub ใช้สำหรับเชื่อมต่อ หลาย On-premises Sites เข้ากับ AWS แบบ Hub-and-Spoke
- ใช้ Virtual Private Gateway ตัวเดียว เป็น Hub
- เชื่อม Customer Gateway หลายตัว (แต่ละ site) เข้ากับ VGW
- On-premises sites สามารถสื่อสารกันได้ผ่าน AWS VPN CloudHub
- ใช้ BGP สำหรับ dynamic routing ระหว่าง sites
- Traffic ระหว่าง sites ยังคงวิ่งผ่าน Public Internet (แต่เข้ารหัส)
- เหมาะกับองค์กรที่มีสาขาหลายแห่งและต้องการเชื่อมต่อทุกสาขาเข้ากับ AWS
ข้อจำกัดและข้อควรรู้
- Bandwidth สูงสุด 1.25 Gbps ต่อ VPN Tunnel
- หากต้องการ bandwidth มากกว่านี้ ควรใช้ AWS Direct Connect หรือใช้ ECMP ผ่าน Transit Gateway (2.5 Gbps ต่อ VPN connection เมื่อใช้ 2 tunnels)
- VPN ตั้งค่าได้เร็ว (ไม่กี่นาที) ต่างจาก Direct Connect ที่ใช้เวลามากกว่า 1 เดือน
- เหมาะเป็น backup connection สำหรับ Direct Connect
เปรียบเทียบ Site-to-Site VPN vs Direct Connect
| คุณสมบัติ | Site-to-Site VPN | Direct Connect |
|---|---|---|
| ประเภทการเชื่อมต่อ | ผ่าน Public Internet (เข้ารหัส) | สายเชื่อมต่อ Physical (Private) |
| ระยะเวลาตั้งค่า | ไม่กี่นาที | มากกว่า 1 เดือน |
| Bandwidth | สูงสุด 1.25 Gbps/tunnel | 1-400 Gbps |
| ความเสถียร | ขึ้นอยู่กับ Internet | สูงมาก (dedicated line) |
| ค่าใช้จ่าย | ต่ำกว่า | สูงกว่า |
| การเข้ารหัส | IPsec (built-in) | ไม่มี (ต้องใช้ร่วมกับ VPN) |