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 :
- You need to know the public address of the 3 "green" router which will be allowed to see your private content.
- Use this php function $_SERVER['REMOTE_ADDR'] to check your incoming (client) ip address.
- 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.