-
Notifications
You must be signed in to change notification settings - Fork 367
EC2 instance with 2 IP addresses
My general notes on how to do this:
Launch a new EC2 Instance. Follow the launch steps as follows
Step 1: Select a new Ubuntu instance
Step 2: Select instance type (t1.micro is fine)
Step 3: Network configuration
Select the VPC to launch this instance into
For subnet, select the subnet associated with the VPC
For "auto-assign public IP", select "disable" (we'll use an elastic ip to connect later)
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.
Launch instance.
Associate two elastic IP addresses with this VPC instance. One for the first IP (10.0.0.20) and another for the second IP (10.0.0.21).
Log into this machine on it's primary IP with the elastic IP associated with it.
While logged into this instance, etc /etc/network/interfaces file. At the bottom of this file add the following:
auto eth0:1
iface eth0:1 inet static
address 10.0.0.21
netmask 255.255.255.0
Then run "sudo ifup eth0:1"