2

I am testing my ASP.net website online, but I don't want it to be accessible to anyone, just from my IP address. How I can return 404 or something for people that aren't from my IP address. Developing my site in ASP.net 4 and C#. Or whether it can be done in IIS 7.5.

Liron Harel
  • 10,819
  • 26
  • 118
  • 217

2 Answers2

4

You can use <ipsecurity> restrictions.

mellamokb
  • 56,094
  • 12
  • 110
  • 136
3

Verify if you have IP and Domain Restrictions Role

  1. Open the Server Manager by selecting the path Start > Administrative Tools > Server Manager.
  2. Click "Add Role Services" link to add the required Role. Check the "IP and Domain Restrictions" check box in "Select Role Services" screen and click "Next" to continue.

Enable IP and Domain Restrictions

  1. Open IIS 7.5
  2. Choose the website you want to filter IPs on (on the left panel)
  3. Click on IP Address and Domain Restrictions (in the center panel)
  4. Add Allow Entry, and set your IP address

  5. click the Edit Feature Setting on the Actions panel

  6. select Deny Access for unspecified clients.
Emanuele Greco
  • 12,551
  • 7
  • 51
  • 70