Dynamic IP addresses are the number one enemy for web service providers. Some third party services may require you to whitelist your IP address, which may cause failed API calls in case you forget to update the list when required. What a hassle.
Fret no more – as of today you can specify IP address ranges using the CIDR notation feature just added to the API settings!
IP Address Format of CIDR Notation
I am pretty sure you have seen IP address ranges in the format of 192.168.2.0/24, but what does that mean?
Technically it means, that 24 bit of the address in the IP address must match the same as 192.168.2.0. In this example, the IP address range is from 192.168.2.0 to 192.168.2.255.
Another example: If you added 192.168.2.0/25 to the API Whitelisted IP addresses list, then the allowed IP range would be just 192.168.2.0 to 192.168.2.127.
Still sounds too complicated? You can simply use a CIDR Utility Tool to calculate the CIDR notation for your IP address ranges.
Whitelisting Range of IP Addresses
Most cloud web service providers already share their public IP address ranges as CIDR notations, so you can just copy+paste the list to Messente's API settings.
Here is a short list of some of the most popular cloud web service providers and their public IP address ranges:
- Amazon AWS EC2 Public IP Ranges
- Microsoft Azure Cloud Platform Public IP Ranges
- Google Compute Engine Public IP Ranges
- Digital Ocean
No list of public IP address ranges yet.
Limitations and Workaround
Using the CIDR IP address format, you can not always specify your required range of IP addresses as one line.
For example, if you wanted to whitelist the IP address range 192.168.2.12 to 192.168.2.34, then you would need to add three CIDR notations:
At least you won’t have to insert all 23 IP addresses separately.
Also, you can simply just use the CIDR Utility Tool mentioned above to calculate the ranges for you.
Disabling IP Address Validation
We strongly suggest you to get a fixed public IP address, if possible. However, if you really, really want to disable the IP address validation (we strongly suggest against doing this), you could add “0.0.0.0/0″ to the allowed IP address list.
If you still want to disable the IP address validation, at least make sure you use HTTPS for communication. This way you make it pretty hard for anyone to sniff your traffic.