By Johny S
Hey,
Let me compare this with AWS so that I can be clearer.
In AWS I have a VPC with cidr block of 10.10.0.0/16. So I can be sure all my machines will end up with an IP within this range.
I have a service that I want to bind to an IP address which can be reached from within the private network, how can I know it’s range?
If I can’t know exactly, at least can I be sure it will start with 10. or is it possible to start with 172.?
Thanks a lot!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello @jserpa,
Actually, there is no direct way to get the range of Private IP addresses. In general, at present, we are using the 10.x range.
However, you can use the private IP address and netmask details from the metadata to get the range. You can follow any of the below methods to get the same:
On the DigitalOcean Cloud Control panel go to the Droplets page, click the name of the Droplet, then select Networking from the side navigation and you can check the private IP address and netmask from there.
Use the commands below in the Droplet::
- curl http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address
- curl http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/netmask
For more detail have a look into the link::
https://developers.digitalocean.com/documentation/metadata/#interface-ipv4-index https://www.ultratools.com/tools/netMask
Hope this helps! Let me know if you have any other questions.
Many OpenVPN subnets use 10.8.x.x range. It’s straight from DigitalOcean’s OpenVPN Setup tutorial, so please don’t introduce this IP range to private networking, as it would get conflicted with assigned VPN client IPs.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.