EC2绑定多个公网IP

默认EC2是有一个私有IP和一个公有IP的,通过以下步骤,能够在EC2上绑定多个公网IP:

  1. 在EC2上添加额外的私网IP
  2. 创建多个EIP
  3. 将EIP绑定在EC2的私有IP上
  4. 通过多个EIP的地址访问EC2上的应用

image-20220529215723750

image-20220529215815542

#! /bin/bash

yum update -y
yum install docker -y
service docker start 
docker pull nginx
docker run -itd  -p 80:80 --name nginx nginx

image-20220529220005772

image-20220701164305005

image-20220701144810209

image-20220630181204669

image-20220529220802452

image-20220529220902132

image-20220529221040701

image-20220529221107153

image-20220529221642357

image-20220529221203715

image-20220529221239477

image-20220529221723519