I am trying to associate a secondary internal IP with my Amazon VPC small machine, I am using a Ubuntu based image with AMI ID:ami-6936fb00. Problem is that I am unable to figure out how to configure my OS(Ubuntu) to record the second private IP address ( this is required as mentioned in the AWS Docs: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#using-instance-addressing-eips)!
I have single ENI and have associated one extra private IP with it.
Any help would be appreciated.
Thanks
Your
/etc/network/interfaces
file probably has something like the following:This is what assigns the primary IP (it may also be DHCP). To assign a secondary IP add a post-up script to attach an additional address to eth0.
I was finally able to figure out how to record second private IP for my AWS VPC machine: I appended this to /etc/network/interfaces:
and then running
ifup eth0:0
My ifconfig showed both eth0 and eth0:0 with correct private IPs.