IP address range question.

birko19

Distinguished
May 5, 2007
1
0
18,510
Hi, my first post here :)

I have a question that might sound stupid but I come from a software programming background and currently I'm working on a project that involves some IP range checking, so here's my issue.

Let's assume a this is the range case we have:

1.2.10-20.30-40

What IP addresses would fit that range and which ones would not fit the range, let me give you some IP examples and please tell me which one fits in and which one does't:

1.2.15.34
1.2.15.44
1.2.25.34
1.2.25.44

My understanding is the IP range that I provided contains the IP addresses in the following order:

1.2.10.30
1.2.10.31
1.2.10.32
1.2.10.33
.
.
.
1.2.11.30
1.2.11.31
.
.
.
And so on...

But my workmates tell me this is what it means:

1.2.10.30
1.2.10.31
1.2.10.32
.
.
.
1.2.10.255
.
.
.
1.2.11.1
1.2.11.2
1.2.11.3
.
.
.
1.2.11.255
.
.
.
1.2.20.1
1.2.20.2
1.2.20.3
.
.
.
1.2.20.40

End.

I'm sorry if I was't very clear, but this is a very confussing case I'm working with right now, so please bare with my explenation....
 

El0him

Distinguished
Feb 3, 2006
228
0
18,680
If you got a range that is 1.2.10-20.30-40

You are limiting your range the third and fourth octet, hence you are correct.
 

calyn

Distinguished
Jun 24, 2005
163
0
18,680
That range would indeed be 10.2.10.30 - 40 , 10.2.11.30 - 40 ... 10.2.20.30 - 40. That means you are correct in your interpretation.