1

How do I know what the Amazon DHCP server range for dynamic IP allocation is inside of my VPC? For example, I have a 172.31.32.0/20 network and I'd like to allocate a private permanent IP - which range I should choose to avoid collision with the DHCP range?

PS: I use Linux network aliases for adding a second static IP to eth0 (1st "Manage Private IP Adresses" on EC2 console and 2nd - adding appropriate alias config to Linux)

3
  • possible duplicate of Assign a static private ip to an EC2 instance
    – MadHatter
    May 25, 2014 at 7:53
  • 2
    MadHatter, my question is different - I do use VPC and I was able to add second static private IP using Linux eth alias. But I want to be sure that my addresses won't be in conflict with Amazon DHCP server range. May 25, 2014 at 8:20
  • 2
    I'm sorry, Vitaly, I had missed that subtlety. I have withdrawn my close vote and agree that, to me at least, this is a different question.
    – MadHatter
    May 25, 2014 at 8:53

1 Answer 1

2

In a VPC, Amazon's IP range for your server is whatever you tell them to use in the subnet you've put the server in. They reserve a few addresses (I think three) for their own use for DNS and routing and so on, but they'll use the whole of the rest of the subnet range. If you want to use a static address, assign it to the instance (or network interface) when you create it, and it then won't be assigned as a dynamic address.

6
  • Is there a way to assign a static private address to the machine?
    – Adam Matan
    May 25, 2014 at 8:30
  • Mike, thank you. I'd like to reserve some IP range for static allocation; let's say 100 IPs for using with my appservers in the future. Right now I have just a few appservers, so I cannot assign IPs right now. May 25, 2014 at 8:31
  • 1
    @Vitaly You can't reserve a range, I'm afraid. The best you can do is hold back a whole subnet and use that subnet for your future requirement.
    – Mike Scott
    May 25, 2014 at 8:36
  • @AdamMatan I'm talking about private addresses in this answer -- for public addresses you assign an Elastic IP address, and you'll never get a consecutive range of addresses.
    – Mike Scott
    May 25, 2014 at 8:36
  • @MikeScott sorry, my bad. I just don't seem to understand the mechanism of assigning a private IP to an instance. It's quite straightforward with public ones, but private ones require Elastic Network Interfaces which are quote confusing. docs.aws.amazon.com/AmazonVPC/latest/UserGuide/…
    – Adam Matan
    May 25, 2014 at 8:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .