

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 编辑 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. 在导航窗格中，选择 **Site-to-Site VPN 连接**。

1. 选择 VPN 连接。

1. 选择**编辑静态路由**。

1. 根据需要添加或删除路由。

1. 选择**保存更改**。

1. 如果您尚未为路由表启用路由传播，则必须手动更新您的路由表中的路由以在 VPN 连接中反映更新的静态 IP 前缀。有关更多信息，请参阅 [（虚拟私有网关）在路由表中启用路由传播](SetUpVPNConnections.md#vpn-configure-routing)。

1. 对于中转网关上的 VPN 连接，您可以在中转网关路由表中添加、修改或删除静态路由。有关更多信息，请参阅 *Amazon VPC Transit Gateway*中的[中转网关路由表](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)