-1

I have an AWS EC2 instance that I'm running in the US-EAST OHIO region. But, I don't want to set 0.0.0.0/0 IP address in my inbound rules for the security group. So, I select: SSH -> MyIP to get the ip address every time I run the instance.

I want to understand how I can add a range of IP addresses instead? For example, when I select SSH -> Custom instead of MyIP, and if I want to include all IP addresses that include the ranges 54.95.21.(any number here), how do I do that? i.e., the last number could be any number, it should allow that, first 3 should be fixed. Also, what should be the subnet for the range?

Xavier
  • 227
  • 1
  • 3
  • 11

1 Answers1

2

54.95.21.* is expressed as 54.95.21.0/24.

x.x.x.x/y is called CIDR notation.

The number after / is the number of masked bits. /24 is equivalent to the dotted-quad subnet mask of 255.255.255.0 (each 255 is 8 bits, 2^8-1 = 255, 8 + 8 + 8 + 0 = 24).

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html

Michael - sqlbot
  • 169,571
  • 25
  • 353
  • 427