使用閘道路由表控制進入 VPC 的流量 - Amazon Virtual Private Cloud

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用閘道路由表控制進入 VPC 的流量

若要使用閘道路由表控制進入 VPC 的流量,您可以將網際網路閘道或虛擬私有閘道與路由表建立關聯或取消關聯。如需詳細資訊,請參閱閘道路由表

使用主控台將閘道與路由表建立或取消關聯
  1. https://console.aws.amazon.com/vpc/ 開啟 Amazon VPC 主控台。

  2. 在導覽窗格中,選擇 Route Tables (路由表),然後選取路由表。

  3. Edge associations (邊緣關聯) 標籤,選擇 Edit edge associations (編輯邊緣關聯)。

  4. 選取或取消選取閘道的核取方塊。

  5. 選擇儲存變更

使用 將閘道與路由表建立關聯 AWS CLI

使用 associate-route-table 命令。下列範例會將指定的路由表與指定的網際網路閘道建立關聯。

aws ec2 associate-route-table --route-table-id rtb-01234567890123456 \ --gateway-id igw-11aa22bb33cc44dd1
使用 取消閘道與路由表的關聯 AWS CLI

使用 disassociate-route-table 命令。指定路由表與閘道之間的關聯 ID。

aws ec2 disassociate-route-table \ --association-id rtbassoc-0abcdef1234567890