Multiple IP Ranges in User IP Condition


#1

Hello Matrix Gurus

 

I've configured a show if design area to display content only for the following IP ranges

 

10.20.*

10.21.*

10.22.*

10.23.*

 

The below image is my design's customisation settings. I'm wondering if:

A) my Subnet is correctly set to except the full IP range for each address

B:) Are there any performance advantages by coding this directly (somehow) within the design's parse file? 

 

Cheers for any enlightenment.

 

ConditionSettings.png


(Nic Hubbard) #2

Looks like the image is not loading. Can you try it again?


#3

Looks like the image is not loading. Can you try it again?

Thanks Nic, Hopefully image is viewable to all now.


(David Schoen) #4

Those subnets are correct for the IPs you gave above, e.g 255.255.0.0 basically says "check all the bits in the first two octets and none in the last two" - which is what you want.

 

I'm not familiar with the show if feature, so I'll stay out of that specific bit of the conversation, but as something to try have you confirmed you're not hitting a cache issue by trying to load the relevant page with _nocache inside and outside one of those IP ranges?


(David Schoen) #5

Oh. As a side issue in this case you can write all 4 out as the single range 10.20.0.0 / 255.252.0.0, this may help to understand what's going on: http://jodies.de/ipcalc?host=10.20.0.0&mask1=14&mask2=

 

All you really need to look at for the full range when using a calculator to see what a network address expands to is the network address (in this case 10.20.0.0 because you can't set any more bits to 0 that are not masked by the netmask) and the broadcast address (which is always the last address in the range) - as those two include the IPs you're interested in this case you can write it out as one range.


#6

Those subnets are correct for the IPs you gave above, e.g 255.255.0.0 basically says "check all the bits in the first two octets and none in the last two" - which is what you want.

 

I'm not familiar with the show if feature, so I'll stay out of that specific bit of the conversation, but as something to try have you confirmed you're not hitting a cache issue by trying to load the relevant page with _nocache inside and outside one of those IP ranges?

 

Cheers for verfying that David. Good point about cache getting in the way - I'll be sure to include some _nocache tests to confirm.


#7

Oh. As a side issue in this case you can write all 4 out as the single range 10.20.0.0 / 255.252.0.0, this may help to understand what's going on: http://jodies.de/ipcalc?host=10.20.0.0&mask1=14&mask2=

 

All you really need to look at for the full range when using a calculator to see what a network address expands to is the network address (in this case 10.20.0.0 because you can't set any more bits to 0 that are not masked by the netmask) and the broadcast address (which is always the last address in the range) - as those two include the IPs you're interested in this case you can write it out as one range.

Brilliant resource, bookmarked! cheers again.