How do you set a CIDR/IP so anyone can access it from anywhere? I'm trying to make my AWS RDS DB instance accessible from anywhere as my ISP doesn't give me a static IP. Everytime my IP changes I have to go change the security record.
-
3another option: do you have a server/box on a permanent IP somewhere? allow that IP thru, ssh to that permanent IP box, and setup a tunnel from your non-static IP to the AWS RDS. – russau Jun 16 '11 at 03:22
5 Answers
0.0.0.0/0
does the trick on the EC2 firewall settings
A CIDR defines a range of IP addresses. In the CIDR notation above, /0
is saying "every possible IP".
I like using http://cidr.xyz/ to visualize the range of addresses.

- 1,874
- 2
- 16
- 19

- 8,928
- 6
- 39
- 49
-
-
-
1@MuhammadRiyaz Give access 4rm anywhere is not good. You can add list of IPs in it. Setting CIDR/IP so anyone can in that list, access it. Like, if we have 103.120.20.195/28 as CIDR in security group. Following IPs can access it. 103.120.20.192 103.120.20.193 103.120.20.194 103.120.20.195 103.120.20.196 103.120.20.197 103.120.20.198 103.120.20.199 103.120.20.200 103.120.20.201 103.120.20.202 103.120.20.203 103.120.20.204 103.120.20.205 103.120.20.206 103.120.20.207 Note: Sometimes our IP have changes dynamically, and our ISP use some specific ranges. – Asad Rao May 05 '17 at 06:55
-
-
Can you give the same mask (for all IPs) but for the IPv6 addresses? – Sergey Potekhin Oct 29 '18 at 13:02
-
Also works for Oracle Cloud Infrastructure (OCI) - thanks for this. – DavidMWilliams Aug 22 '23 at 07:14
I'm not familiar with how one configures DB Security Groups, but if you allow access from IP's in this range, you'll allow access from any IP (...): 0.0.0.0/0
...
From a security perspective, you should not do this. You should authorize the smallest possible group. For example, if only the last portion of your IP changes, e.g. your IP is always 1.2.3.*, then authorize 1.2.3.0/24
.
For more information about CIDR notation, drop by Wikipedia: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

- 3,350
- 2
- 17
- 19
For All IP ADD CIDR for DB Security Group:
If CIDR/IP :0.0.0.0/0
Not Working then Try
CIDR/IP: 1.1.1.1/32

- 3,175
- 2
- 31
- 41

- 12,712
- 6
- 88
- 78
@Fikri reply is not correct.
if 0.0.0.0/0 does not work, try:
0.0.0.0/1 - from 0.0.0.0 to 127.255.255.255 addresses
128.0.0.0/1 - from 128.0.0.0 to 255.255.255.255 addresses

- 21
- 2
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 26 '23 at 03:32