Reputation: 22760
All IP's mentioned here are IPv4
I am trying to use a system which asks for a set of IP addresses, and offers me the example format of 192.168.0.0/24
to enter sets of IP addresses... but I don't understand what that format implies nor what it is called.
Because the exampled format is an IP address, webs searching for this information is very muddy and hard to find anything useful.
Documentation:
You can use the following formats:
Single IP addresses — Example: 192.168.0.1
A range of IP addresses — Example: 192.168.0.0/24
Specifically, I don't understand the /24
on the IP address syntax; I understand this is a "block" of 24 but considering that there seems to be many more than 24 possible IPs from - for example - 192.168.0.--
then I don't get the importance of the /24
; is this a maximum? Can /255
work, as that seems the actual number of possible values [in a block]? Does the /24
only apply to the "final" block or does it apply to any block with value of 0
?
I have a set of IP addresses I need the system to "catch"/recognise. The IPs to catch have the first two blocks are always the same, and the final two blocks can be anything.
For example:
I want to catch ALL of the below:
145.178.12.145
145.178.98.165
145.178.10.123
...
...
145.178.10.255
But I do NOT want to catch
145.179.124.35
27.49.35.121
Only catching IPs that begin 145.178........
; how can I do this with the /24
formatting given above?
The set is
Upvotes: 0
Views: 5462
Reputation: 615
You could use /24 for last part 127.0.0.xxx
127.0.0.0/24 means that ip range from 127.0.0.0 to 127.0.0.255
127.0.0.0/23 means that ip range from 127.0.0.0 to 127.0.1.255
127.0.0.0/22 means that ip range from 127.0.0.0 to 127.0.3.255
127.0.0.0/8 means that ip range from 127.0.0.0 to 127.255.255.255
127.0.0.1/1 means that ip range from 0 to 255.255.255.255
You can check from this address:
https://www.ipaddressguide.com/cidr
CIDR is the short for Classless Inter-Domain Routing, an IP addressing scheme that replaces the older system based on classes A, B, and C. A single IP address can be used to designate many unique IP addresses with CIDR.
A CIDR IP address looks like a normal IP address except that it ends with a slash followed by a number, called the IP network prefix.
Upvotes: 2
Reputation: 154
This is the explanation of the /
in the IP.
Many things use slash notation, also known as CIDR (Classless Inter-Domain Routing) notation, for many purposes, such as policy configuration. You use slash notation differently for IPv4 and IPv6 addresses.
Slash notation is a compact way to show or write an IPv4 subnet mask. When you use slash notation, you write the IP address, a forward slash (/), and the subnet mask number.
To find the subnet mask number:
Convert the decimal representation of the subnet mask to a binary representation.
Count each “1” in the subnet mask. The total is the subnet mask number.
For example, to write the IPv4 address 192.168.42.23 with a subnet mask of 255.255.255.0 in slash notation:
Convert the subnet mask to binary.<br> In this example, the binary representation of 255.255.255.0 is:<Br> 11111111.11111111.11111111.00000000.<Br> Count each 1 in the subnet mask.<br> In this example, there are twenty-four (24).<br> Write the original IP address, a forward slash (/), and then the number from Step 2.<br> The result is 192.168.42.23/24.<br>
This table shows common network masks and their equivalents in slash notation.
Network Mask Slash Equivalent
255.0.0.0 /8
255.255.0.0 /16
255.255.255.0 /24
255.255.255.128 /25
255.255.255.192 /26
255.255.255.224 /27
255.255.255.240 /28
255.255.255.248 /29
255.255.255.252 /30
255.255.255.254 /31
255.255.255.255 /32
To solve your problem, 145.178.0.0/16 will catch all the IPs from 145.178.0.0 to 145.178.255.255.
Upvotes: 4