Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,

I want to create a firewall for packet filtering.

When user accesses a website which he is not supposed to, then my application should trap the request and display a custom html page in the browser, displaying that he cannot access the website.

So how can I trap and drops or block the packet and display custom HTML.

Regards,
Wasim Shaikh
Posted
Updated 21-Nov-10 23:31pm
v3

1 solution

Why are you trying to reinvent the wheel, as the machines are part of an Intranet implement a proxy server to control internet access this will then work for windows and Mac machines and not require installation of utilities that could be shut-down/bypassed on the client machines.
 
Share this answer
 
Comments
wasim_14 18-Nov-10 23:28pm    
The thing is that we need to block the internet for a particular user. Hence, with the User Id we 1st need to find out on which machine the user has logged in and then block internet on that machine.

If we do it from a remote machine, there are 3 problems:
1. We do not know which machine name the user has logged into.
2. If we come to know the machine name, how do we Block the internet on that machine remotely.
3. If in case we are able to Block internet on Windows Machines from a remote server, will the same work on MAC OS X also.
Rod Kemp 18-Nov-10 23:37pm    
What you are wanting to do is what a proxy server is designed to do, which is block or allow internet access from an intranet by user and computer.
What you need to do is find a competent system admin and put your requirements to him/her as everything your trying to do can be achieved by proper network configuration including the use of a proxy server.
wasim_14 19-Nov-10 0:08am    
We would like to do this programatically without using Proxy servers.

We need to query our application Database and fetch the Employees for whom Internet should be Blocked.
Only for these employees the Internet access should be Blocked.

This cannot be achieved using a proxy server.
Rod Kemp 19-Nov-10 0:50am    
It can be achieved using a proxy, Squid Web Proxy allows the use of an external database so that whenever someone tries to access the internet a dialog box pops up asking for a username and password before access is allowed and so long as the proxy is also acting as the gateway it can't be bypassed where as a program on a local computer can be bypassed simply by shutting it down from task manager e.g. killing the process.
Quite simply you are trying to replicate the features found in a properly configured network domain utilising a proxy server as the network gateway to the internet in such a way as to make it a simple matter to bypass.

You need to talk to a system administrator who knows what they are talking about, if you do talk to one who says it is not possible they are a moron who doesn't know what they are talking about.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900