0

I have one asp.net web service (asmx) in separate project that is hosted on windows server having other asp.net web applications running on it. How can I restrict asp.net web service to be accessed by single IP address? I want that my web service must be accessed by one IP configured by me. If requests comes from any other IP, it must not reach to my web service and discarded by windows firewall itself. I know that this is something to do with windows firewall.

I did it for SQL Server previously, but I don't know how to configure single asp.net web service project to do so.

1 Answer 1

0

Unless your web service is running in a separate IIS instance on a different port than the rest of your asp.net sites, there's no way to do what you're asking with the firewall. The firewall can only block things by port, not URL.

So you have two choices.

  1. Move the web service to its own IIS instance running on a non-standard port (81, 8080, etc). Then add your firewall rule that restricts incoming traffic to that port for your designated IP address.

  2. Add code to your web service so that it is actually responsible for rejecting requests that come in from invalid IP addresses. It should be easy enough to do with the session/request objects you have access to.

4
  • Thank you. I will first go with the first option and then second. I will let you know the outcome. Mar 12, 2011 at 19:05
  • Do you mean that I have to run it on separate IIS application pool? Can you please tell me how to move web service project to separate IIS instance on a non-standard prot and configure firewall rule. I can't find any option for this. Mar 14, 2011 at 16:55
  • I am able to change the port binding for whole website. How can I change it for one virtual application? Mar 14, 2011 at 17:27
  • From the IIS Manager in the Sites section, Add New Site. Mar 14, 2011 at 19:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .