

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

# 編輯 AWS Site-to-Site VPN 連線的靜態路由
<a name="vpn-edit-static-routes"></a>

對於在虛擬私有閘道上設定為靜態路由的 Site-to-Site VPN 連接，您可以新增或移除 VPN 組態的靜態路由。

**若要使用主控台新增或移除靜態路由**

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

1. 在導覽窗格中，選擇**站台對站台 VPN 連接**。

1. 選取 VPN 連接。

1. 選擇**編輯靜態路由**。

1. 視需要新增或移除路由。

1. 選擇**儲存變更**。

1. 如果您尚未啟用路由表的路由傳播，您必須在路由表中手動更新路由，以反映您 VPN 連接中更新的靜態 IP 前綴。如需詳細資訊，請參閱[(虛擬私有閘道) 在路由表中啟用路由傳播](SetUpVPNConnections.md#vpn-configure-routing)。

1. 對於傳輸閘道上的 VPN 連接，您可以在傳輸閘道路由表格中新增、修改或移除靜態路由。如需詳細資訊，請參閱 *Amazon VPC Transit Gateways* 中的[傳輸閘道路由表](https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html)。

**使用命令列或 API 新增靜態路由**
+ [CreateVpnConnectionRoute](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVpnConnectionRoute.html) (Amazon EC2 查詢 API)
+ [create-vpn-connection-route](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-vpn-connection-route.html) (AWS CLI)
+ [New-EC2VpnConnectionRoute](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2VpnConnectionRoute.html) (AWS Tools for Windows PowerShell)

**使用命令列或 API 刪除靜態路由**
+ [DeleteVpnConnectionRoute](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteVpnConnectionRoute.html) (Amazon EC2 查詢 API)
+ [delete-vpn-connection-route](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-vpn-connection-route.html) (AWS CLI)
+ [Remove-EC2VpnConnectionRoute](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2VpnConnectionRoute.html) (AWS Tools for Windows PowerShell)