

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

# 刪除網際網路閘道
<a name="delete-igw"></a>

若某個 VPC 不再需要網際網路存取，您可以從該 VPC 分離網際網路閘道，然後將其刪除。只要網際網路閘道仍然連接至 VPC，您就無法刪除網際網路閘道。如果 VPC 的資源具有相關聯的公有 IP 地址或彈性 IP 地址，則您無法分離網際網路閘道。

**透過主控台從 VPC 分離網際網路閘道**

1. 在 [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/) 開啟 Amazon VPC 主控台。

1. 在導覽窗格中，選擇 **Internet gateways** (網際網路閘道)。

1. 勾選網際網路閘道的核取方塊。

1. 若要連接它，請選擇**動作**、連接至 VPC、選取可用的 VPC，然後選擇**連線網際網路閘道**。

1. 若要將其分離，請選擇**動作**、**從 VPC 分離**，然後選擇**分離網際網路閘道**。出現確認提示時，選擇 **Detach internet gateway** (分離網際網路閘道)。

**透過命令列描述網際網路閘道 (包括連接項目)**
+ [describe-internet-gateways](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-internet-gateways.html) (AWS CLI)
+ [Get-EC2InternetGateway](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2InternetGateway.html) (AWS Tools for Windows PowerShell)

**透過命令列從 VPC 分離網際網路閘道**
+ [detach-internet-gateway](https://docs.aws.amazon.com/cli/latest/reference/ec2/detach-internet-gateway.html) (AWS CLI)
+ [Dismount-EC2InternetGateway](https://docs.aws.amazon.com/powershell/latest/reference/items/Dismount-EC2InternetGateway.html) (AWS Tools for Windows PowerShell)

**透過主控台刪除網際網路閘道**

1. 在 [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/) 開啟 Amazon VPC 主控台。

1. 在導覽窗格中，選擇 **Internet gateways** (網際網路閘道)。

1. 勾選網際網路閘道的核取方塊。

1. 選擇 **Actions** (動作)、**Delete internet gateway** (刪除網際網路閘道)。

1. 出現確認提示時，輸入 **delete**，然後選擇 **Delete internet gateway** (刪除網際網路閘道)。

**透過命令列刪除網際網路閘道**
+ [delete-internet-gateway](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-internet-gateway.html) (AWS CLI)
+ [Remove-EC2InternetGateway](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2InternetGateway.html) (AWS Tools for Windows PowerShell)