Skip to content

EC2 instance with 2 IP addresses

John Selbie edited this page Feb 3, 2015 · 10 revisions

My general notes on how to do this:

  1. Select a new Ubuntu instance

  2. Run it in a new or existing VPC subnet

  3. For the eth0 adapter, add two static IP addresses not already in use on this subnet (e.g. 10.0.0.20 and 10.0.0.21). Both on eth0. Do not add eth1.

  4. Launch instance. Associate a public IP instance with the primary address specified in step 3 for this instance.

  5. Now configure the second IP address properly. Edit /etc/network/interfaces file. At the bottom of this file add the following:

    iface eth0:1 inet static

    address 10.0.0.21

    netmask 255.255.255.0

  6. Then run "sudo ifup eth0:1"

That should do it.

Clone this wiki locally