gpt4 book ai didi

amazon-elb - 我们是否需要为运行公共(public) ELB 的子网显式设置路由表?

转载 作者:行者123 更新时间:2023-12-04 17:59:10 27 4
gpt4 key购买 nike

(我试图了解 ELB 网络如何在 VPC 中工作,并发布此问题)

当我们向公共(public) ELB 添加两个子网时,aws elb create-load-balancer --load-balancer-name my-load-balancer --listeners "Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP ,InstancePort=80"--subnets subnet-15aaab61 subnet-198aab81,我假设我需要在运行此步骤之前将这两个子网设置为公共(public)子网——是这个理解正确吗?此外,我假设必须将上述公共(public)子网配置为自动为其每个实例分配公共(public) IP(否则,此 ELB 目标的 DNS 解析将不会获得可寻址的公共(public) IP)- - 这种理解也是正确的吗?

接下来,我在两个私有(private)子网中运行实例,并将它们注册到上面创建的 ELB。我想我需要确保两个公共(public)子网和两个私有(private)子网已连接——我需要做额外的工作来实现这一点吗?(即默认 10.0.0.0/16 -> 本地规则就足够了吗?我是这么认为的,但 [1] 似乎另有说法,因为它在 ELB 设置过程的上下文中添加了 NAT 规则)

感谢您帮助我了解 ELB 相关网络。

[1] Blog about ELB and route table

最佳答案

I assume I need to setup these two subnets as public subnets before running the this step -- is this understanding correct?

技术上不是。但在 ELB 可用之前,它们需要以这种方式设置。

Also, I assume the above public subnets must be configured to automatically assign public IPs to each of its instances (otherwise, DNS resolution of this ELB destination won't get a public addressable IP) -- is this understanding also correct?

不正确。 ELB 获取其公共(public) IP 地址独立于子网是否配置为自动分配公共(public) IP 地址。此设置仅适用于您在该子网上创建的 EC2 实例。不是 ELB。

Next, I have instances running in two private subnets and I register them to the ELB that were created above. I guess I need to make sure the two public subnets and the two private subnets are connected -- do I need to do extra work to make that happen? (i.e., Will the default 10.0.0.0/16 -> local rule be sufficient?

是的。由于本地规则,所有 VPC 子网始终可以路由到 VPC 中的所有其他子网。你不能把这件事搞砸,即使你尝试。

I thought so, but [1] seems to say otherwise because it added a NAT rule in the context of ELB setup procedure)

默认路由引用 NAT 实例(或 NAT 网关)以允许私有(private)子网上的实例发起出站 Internet 请求。它与从 ELB 发送到实例的流量无关,也与遵循“本地”路由的相同流量的响应无关——从平衡器发送到实例的流量具有平衡器的内部源 IP 地址,不是访问ELB的浏览器地址。

关于amazon-elb - 我们是否需要为运行公共(public) ELB 的子网显式设置路由表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37580794/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com