Ond*_*idr 2 routing amazon-web-services amazon-vpc vpc-peering amazon-nat-gateway
我想使用另一个 VPC 的 Nat 网关(不是 EC2 上的 Nat 实例!)将我的流量从对等 VPC 路由到 Internet。我的基础设施如下所示:
/---------------------VPC-LIVECHAT---------------------\
| /---Subnet A---\ /---Subnet B---\ /---Subnet C---\ |
| | | | | | | |
| \-10.10.0.0/24-/ \-10.10.1.0/24-/ \-10.10.2.0/24-/ |
\------------------------------------------------------/
| |
| VPC Peering Connection |
| |
/----------------------VPC-COMMON----------------------\
| /---Subnet A---\ /---Subnet B---\ /---Subnet C---\ |
| | /--------\ | | /--------\ | | /--------\ | |
| | | NAT GW | | | | NAT GW | | | | NAT GW | | |
| | \--------/ | | \--------/ | | \--------/ | |
| \-10.10.3.0/24-/ \-10.10.4.0/24-/ \-10.10.5.0/24-/ |
\------------------------------------------------------/
| |
| VPC Peering Connection |
| |
/---------------------VPC-DATABASE---------------------\
| /---Subnet A---\ /---Subnet B---\ /---Subnet C---\ |
| | | | | | | |
| \-10.10.6.0/24-/ \-10.10.7.0/24-/ \-10.10.8.0/24-/ |
\------------------------------------------------------/
Run Code Online (Sandbox Code Playgroud)
我的点子:
我认为这个设置应该工作得很好,它只是路由 VLAN。但不是在 AWS 中。AWS 不希望我在路由表中的不同 VPC 中使用 Nat Gateway 并出现错误
“路由表 rtb-293fa54d 和接口 interface-c2002e9e 属于不同的网络”
我也不能在 AWS 中使用 Nat Gateway 的私有 IP,AWS 不支持路由目标中的 IP 地址(我真的很想知道为什么)。
我正在使用 CloudFormation,我的路由定义如下所示:
"RoutePrivate3ToNatInCommon" : {
"Type" : "AWS::EC2::Route",
"Condition" : "IsNotVpcCommon",
"Properties" : {
"DestinationCidrBlock" : "0.0.0.0/0",
"RouteTableId" : { "Ref" : "PrivateSubnet3RoutingTable" },
"NatGatewayId" : { "Fn::GetAtt" : [ "NatGatewaySettingsForNotCommon", "NatGatewayAZC" ] }
}
}
Run Code Online (Sandbox Code Playgroud)
NatGatewaySettingForNotCommon 是我的自定义 lambda 支持的资源,它帮助我获取每个可用区的 Nat 网关列表。
有什么办法可以实现这个设置吗?每个区域我将有大约 10 个 VPC,每个区域有 3 个私有子网,我真的不想设置(并支付)30 个 Nat 网关。这看起来像常规的“非多云”网络设置,因此在云中实现它应该没有问题。或者是吗?
AWS 不支持这种类型的配置。VPC 对等互连不支持“多跳”路由。VPC 对等不支持以下配置。
归档时间: |
|
查看次数: |
4468 次 |
最近记录: |