Access Website Hosted In IIS On Windows 10 From Any PC On LAN

Introduction

In this article, we will learn about Access Website Hosted In IIS On Windows 10 From Any PC On LAN.

Prerequisites

  • Windows 10 PC with IIS installed. (In this example IIS version is 10 )
  • Basic knowledge of website hosting on IIS.

Create a website in IIS

Open run (windows key + R) and type inetmgr and press enter or in Cortana Search type IIS.

Run

IIS

IIS Manager opens

Then right-click on Sites and click on Add Website. The Add website dialog opens.

Add website

  • Fill in the required details and select the folder where the compiled code is located. Eg: C:\Nigel\Publish
  • Select the required port, the default is 80. I will be using 7500.
  • Do not enter host name details if you are testing or using on LAN.

Then click ok. A website gets created and it will show under Sites.

Website created

Now right-click on the website name then Manage website and then click Browse.

Manage website

The link should be in the form on http://localhost:7500/ if you used port 7500 and selected http.

Locate your IP Address

Now open the command prompt. Type cmd in a run.

Command prompt

Type ipconfig and press enter. Now locate your PC's IP address on the LAN.

 IP Address

Now in your website link replace localhost with 192.168.0.24 (IP address) so your URL will be - http://192.168.0.24:7500/

Try it in your browser to make sure it works.

Change Firewall Rules

In Cortana, search type firewall then click on Windows Firewall with advanced security.

Change firewall rules

The firewall window opens.

Firewall window opens

Click on Inbound rules on the left. Then click New Rule in the right-side menu.

Inbound rules

The New inbound rule wizard will open. What type of rule would you like to create? Select Port and click Next.

Select port

Does this rule apply to TCP or UDP? Select TCP. Then enter the port number (7500) in the specific local ports textbox. Then click Next >.

Select TCP

Then the Action form opens. Select Allow the connection and click Next.

Action form opens

Then the profile form opens. When does this rule apply? - Select required ones, if not sure then select all. Click Next.

Profile form opens

Give this Firewall rule a Name and Description, so you know for what purpose you created this. Then click finish.

Firewall rule

Now if you share the link we created earlier with someone else on your LAN it should open your website.

Link example: http://192.168.0.24:7500/

Note

  • Be careful when changing Firewall settings otherwise, you may leave your PC vulnerable to online attacks.
  • Only use ports in the nonstandard range (preferably after 9000).
  • Once you are done using the website you can delete the Firewall rule.

Reference

https://www.iis.net/

Summary

In this article, we learned about Access Website Hosted In IIS On Windows 10 From Any PC On LAN.


Similar Articles