How to setup 2 public IPs on AWS instance

In instances

Select instance and add private IP on the existing ethernet card.

In network :
  • buy 2 elastic IPs
  • attach first EIP to the existing ethernet’ card of the instance
  • attach the second EIP to the existing ethernet but select the second private IP.
Setup VIP

ssh to the instance and setup a static VIP on’ the ethernet card with the second private IP

ifup the VIP, and that’s it.

Notes

Using two ethernet cards is feasible but it implies to setup routing’ table. Using VIP avoids playing with routing tables and managing two cards.