在打印窗口把「目标」选为「另存为 PDF」即可保存,页面已带 awsgood.com 版权水印。 返回原文

www.awsgood.com

AWS VPC 過程遇到的問題與心得

2016-08-31 Amazon VPC 约 3 分钟

整理一些設定 VPC 過程遇到的問題與心得。我設定的是案例官方文件中的 Scenario 3: VPC with Public and Private Subnets and Hardware VPN Access, 也就是包含

  1. 數個 Public Subnet
  2. 數個 Private
  3. VPN to own IT infrastructure over an IPSec VPN tunnel

同時,這個規劃也考慮了 AZ 以及開發時的各種環境需求,像是 Dev / Test / Staging / Production … 等環境,過程中遇到的問題都整理在這裡。

如何將兩個 VPC 串接

如何限制 VPC Peering 之間的存取控制?

利用以下兩個

流程上參考下圖:

VPC-security-diagram

VPC 的 Size 可以調整?

不可以。CIDR 建立好之後就無法更動。

怎麼知道目標會走哪一個 route table?

看 subnet 設定在哪一個 route table.

route table 跟 subnet 關係是一對一,也就是一個 subnet 只允許在一張 route table.

現有的 EC2 Instance ENI 可否更換 subnet?

AWS 文件常看到 Public Subnet & Private Subnet 是什麼意思?

參閱: Your VPC with Subnets

Network ACL 和 Security Group 有什麼不一樣?

詳細參閱:

Private Subnet 裡的 EC2 突然無法對外連線了?

  1. 確認 Instance 的 Security Group 設定正確
  2. 確認 Instance 網卡 ENI 的 Security Group 設定正確. 如果有第二張網卡,那也要檢查.
  3. 找到 Instance 的 subnet 掛在哪一張 Route Table,確認 NAT Gateway 也在裡面.
  4. 找到 NAT Gateway 之後,找到他所屬的 Subnet 的 Route Table ,確認 Internet Gateway 在裡面

Public Subnet 裡的 EC2 無法對外連線了?

  1. 確認 Instance 本身有 EIP
  2. 檢查 Security Group, 確認 Outbound 正確
  3. 檢查 Subnet 的 Route Table,確認裡面 destination 有 Internet Gateway

VPC NAT Gateway 是否有單點 (SPOF) 問題?

建立 NAT Gateway 時,要選擇 Subnet,就等於表示此 Gateway 在 Subnet 所在的 AZ。如果此 AZ 出問題,Route Table 共用此 Gateway,其他的 AZ 將無法出去。參考:NAT Gateway Basics 以下的描述:

If you have resources in multiple Availability Zones and they share one NAT gateway, in the event that the NAT gateway’s Availability Zone is down, resources in the other Availability Zones lose Internet access. To create an Availability Zone-independent architecture, create a NAT gateway in each Availability Zone and configure your routing to ensure that resources use the NAT gateway in the same Availability Zone.