Question

Lets say I have three independent LANs and a central server somewhere. I want to offer a service exclusively to users on those LANs (via internet ofc). And a slightly different service to different LANs: users on LAN "A" should recieve content "A" and only "A". Can this be achieved by some sort of IP filtering on the server side (like checking the source address) and how secure is that? Or with RSA (or something) keys: can a router (on a LAN) be configured so it can communicate with the server in a secure way?

Basically I want my server to only be visible for users that connect to internet through certain routers (LANs), and for each LAN offer a slightly different service.

I would greatly appreaciate any advice on how to achieve this, since I'm not an expert :) Also I hope that this kind of a question is ok to ask here, since it is not strictly a programming one.

Regards, Petar

Was it helpful?

Solution

I will try to answer this

Basically I want my server to only be visible for users that connect to internet through certain routers (LANs)

As far as I know, once you make your server public (set public/live IP & register yout domain), it will be visible on the web for anyone who know your web address.

But you can give a "limitation" like who will be able to see your private content. Here is my simple steps :

  1. You need to know the public address of the 3 "green" router which will be allowed to see your private content.
  2. Use this php function $_SERVER['REMOTE_ADDR'] to check your incoming (client) ip address.
  3. If the client's IP address is listed as one of your "green" router's IP address, then display your content, and if not the display a page that says "You are not allowed to this page" or something like that.

So for conclusion..

Can this be achieved by some sort of IP filtering on the server side (like checking the source address)

Yes it can by doing the steps above.

I hope this can help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top