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:
iface eth0:1 inet static
address 10.0.0.21
netmask 255.255.255.0
Then run "sudo ifup eth0:1"
https://github.com/jselbie/stunserver/wiki/EC2-instance-with-2-IP-addresses
quick script to getting stunserver working on EC2 instance
Following steps work for Ubuntu server on EC2
First, get second interface up and going
edit /etc/network/interfaces
add "eth0:1" to the "auto" line
add:
iface eth0:1 inet static address 10.0.0.xxx netmask 255.255.255.0
Reboot required to fully validate. "ifup -a" to bring up eth0:1 before the reboot
Now get the code compiled and running
sudo apt-get update
sudo apt-get install g++
sudo apt-get install git
sudo apt-get install make
sudo apt-get install libboost-dev
sudo apt-get install libssl-dev
git clone https://github.com/jselbie/stunserver
cd stunserver
make
./stuntestcode (confirm all pass)
sudo cp stunclient /usr/bin/stunclient
sudo cp stunserver /usr/bin/stunserver
edit /etc/rc.local to launch /usr/bin/stunserver&
reboot via control panel
https://github.com/jselbie/stunserver/wiki/quick-script-to-getting-stunserver-working-on-EC2-instance