• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

Public/Private Network ?

How do I know if a person is accessing my web application from a public network (over internet) or is the person accessing it from the organisation's network? The IP address can not be restricted as it is a DHCP server.
0
rishi_raj
Asked:
rishi_raj
  • 3
  • 2
1 Solution
 
NigelpCommented:
You should be able to look at the first bytes of the IP address to decide if the traffic is from the organisation's network otherwise the traffic will be from an external source.
0
 
rishi_rajAuthor Commented:
Although I accepted the answer, but I have a doubt. The first bytes of my server's IP address may also be used by any external server. There s no way to stop that. In such a case how do I identify the diff. in the network?
0
 
NigelpCommented:
If you could give me some more info such as some examples of your IP addresses and what type of web server it is you're developing applications on I may be able to give you a bit more help.
0
 
rishi_rajAuthor Commented:
I cannot share the exact IP address of the server as it is our client's server and I can not share details related to it. But I can tell you that the IP address string is of a standard formation xxx.x.x.xx

The exact scenario is something like this.

At the place of origin of the application (say HQ) there is the Main APP server (Weblogic) and the WEB Server (IIS).
Then there are some external outlets (independent of HQ) say P1, P2...Pn each having a LAN of their own. (It is practically not feasible to get the )

The intention of our application is to identify the location of the user accessing the application so that on the basis of the location a different home page can be shown.
eg: one home page for "public place" like a internet cafe
and another home page for HQ,P1, P2...etc.

I hope this info makes the things much clearer.



0
 
NigelpCommented:
You need to identify the network id of each lan (HQ,P1,P2)
Each lan should have a something like a Class C IP address where the first 24 bits of the IP address represent each individual network.

example
HQ = 206.169.61.???
P1 = 194.232.71.???
P2 = 174.55.27.???

Check the first 24 bits of the incoming address - if it matches any of the addresses on your list it's internal - otherwise it's external.

You'll probably need more network info from whoever manages the network to get the correct IP addresses and subnet masks as they may use more than 24 bits for the network ID.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now