具有单个 IP 地址的 AWS EC2 多实例退出 [英] AWS EC2 multi instance exit with a single IP Address

查看:48
本文介绍了具有单个 IP 地址的 AWS EC2 多实例退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 AWS 基础设施,如下所示:

I have an AWS infrastructure as follow:

  • EC2-WS01
  • EC2-WS02
  • 负载均衡器

这些机器运行相同的代码.在这些机器前面有一个负载均衡器来分配负载.所以客户端指向转发请求的负载均衡器.我的应用程序的其中一项服务是 Webhook 服务,它每 15 分钟向受防火墙保护的外部服务器发送一些信息.我们必须设置防火墙以接受来自两个 EC2 IP 地址的请求.我想知道是否有可能确保无论我拥有什么实例,当我提出请求时,它总是由相同的 ip 发出

These machines run the same code. In front of these machines is there a Load Balancer that distribute the load. So the clients point to the load balancer that forward the requests. One of the services of my app is a webhook service that send to an external server, protected by a firewall, some information every 15 minutes. We had to setup the firewall accepting the request from the two EC2 IP Address. I want to know if is possible make sure that regardless of the instances I have, when I make a request, it is always made by the same ip

是否可以使用弹性 IP 或其他什么来做到这一点?

Is possible to do that with an Elastic IP or what else?

推荐答案

您的架构需要:

  • 公共子网中的负载均衡器
  • 私有子网中的 Amazon EC2 实例
  • 公有子网中的 NAT 网关或 NAT 实例,具有弹性 IP 地址
  • 私有子网上的路由表,通过 NAT 网关/NAT 实例发送互联网绑定流量

来自 Amazon EC2 实例的流量将来自"于与 NAT 网关/NAT 实例关联的公有弹性 IP 地址.

The traffic from the Amazon EC2 instances will "come from" the public Elastic IP address associated with the NAT Gateway/NAT Instance.

这篇关于具有单个 IP 地址的 AWS EC2 多实例退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆