问题:
当我是的实例10.141.80.140和卷曲DNS的北草坪会议大楼,我没有得到响应。
我预期北草坪会议大楼会重定向到10.141.80.140,但它没有发生。
当我在10.141.80.140上时,北草坪会议大楼DNS不会重定向--重定向是从同一子网中的其他实例进行的。
详细信息:
问题:
是否有什么东西,是什么,阻止北草坪会议大楼解决一个实例的请求,将路由回实例,在北草坪会议大楼侦听器目标组?

发布于 2019-05-28 11:37:34
这是一个众所周知的行为,我很乐意向大家解释。网络负载均衡器引入了源地址保护功能--传入连接的原始IP地址和源端口保持不变。当目标响应请求时,VPC内部人员捕获此数据包并将其转发给北草坪会议大楼,后者将将其转发到其目的地。
这种行为有一个副作用:当操作系统内核检测到出口包有一个本地地址作为目标地址时,它将直接将该包转发给应用程序。
例如,给定以下组件:
- The instance wants to telnet the NLB: it does a request for establish a TCP connection against the NLB DNS name on the port 80.
- As it is an outgoing communication, it starts from an ephemeral port; the instance sends a SYN packet (1):
- Source: 10.0.0.55:40000
- Destination: 10.0.0.10:80
- The NLB receives the packet and forwards it to the backend instance (10.0.0.55:80).
- Due the address preservation feature, the backend instance receives a SYN packet with the following information:
- Source: 10.0.0.55:40000
- Destination: 10.0.0.55:80
- The Operation system routes the packet internally (as its destination is the own machine), and here is when the issue happen:
- The initiating socket is expecting the SYN\_ACK from 10.0.0.10:80 (the NLB).
- However, it receives the SYN\_ACK from 10.0.0.55:40000 (the instance itself).
- The OS will send several TCP\_RETRANSMISSION until it times out.
这将不会发生在一个公共的北草坪会议大楼,因为实例将需要在VPC中执行NAT来使用其公共IP地址将请求发送给北草坪会议大楼。内核不会内部转发数据包。
最后,一个可能的解决方法是根据后端的IP地址而不是其实例ID注册后端;使用此方法,由北草坪会议大楼转发的通信量将包含北草坪会议大楼内部IP作为源IP,从而禁用“源地址保存”功能。不幸的是,如果您使用AutoScaling组启动实例,它将只能通过其ID注册已启动的实例。如果是ECS任务,将网络配置为"awsvpc“将迫使北草坪会议大楼通过其IP注册每个目标。
https://stackoverflow.com/questions/56336216
复制相似问题