EC2 Ubuntu - Force instance to use internal IP

Posted by Peter on Server Fault See other posts from Server Fault or by Peter
Published on 2011-02-20T11:23:51Z Indexed on 2011/06/27 0:24 UTC
Read the original article Hit count: 611

I've just set up a micro instance on EC2 (AMI ID ami-e59ca991). I had hoped to avoid charges for a year as my usage falls well within the bound of the free tier. I have been charged $0.01 for "regional data transfer". I read here that this is because my instance is talking to its self via it's external IP address.

From what I've Googled it looks like you can stop the charges by making sure that the instance uses its internal IP address. However, when I ping the hostname of my instance internally (via an ssh session) it resolves to the instances internal IP address.

How can I configure my instance so that I do not get these charges? Is it as simple as adding a line to my hosts file?

Additionally, is this the real reason for the charge? I'm concerned that I've misunderstood the pricing somewhere. I have Apace and MySQL (with phpmyadmin) running on the machine - could I be being charged for data transfer associated with these (I have only one flat HTML page and I have only logged in via phpmyadmin - I have no data in my database).

Edit:

Additionally, my user account on MySQL was declared as:

grant all privileges on *.* to 'peter'@'localhost';

Should I have instead used the internal hostname for the instance?

grant all privileges on *.* to '[email protected]';

Cheers,

Pete

© Server Fault or respective owner

Related posts about amazon-ec2

Related posts about ip