Why can't I connect to my IIS server, running on my PC, via public static IP?

22,060

Solution 1

The problem you are running into is caused by your router not supporting hairpin NAT. A quick search here pulls up some great answers: Unable to outside access service from inside LAN

Basically, your router doesn't know that it needs to convert your request for the external IP to the internal IP of your server. The quickest "fix" is to create an entry in your hosts file.

Solution 2

Site is available from remote machines, but not from my own. From none of my local network machines.

That is completely different issue. You need to directly plug the internet cable to your computer to see the difference.

Share:
22,060

Related videos on Youtube

Dmytro
Author by

Dmytro

Updated on September 18, 2022

Comments

  • Dmytro
    Dmytro over 1 year

    I know this topic is quite old, but, nevertheless, I am doing this in a first time and I have some troubles with it. I try to open public access to my sites, hosted on IIS 7.5 web server on my Windows 7 operation system.

    What have I already done:
    1. Read a lot of documentation/articles about site hosting, for example:
    www.codeproject.com
    www.sevenforums.com
    forums.asp.net
    Besides those links I read Russian documentations, but, since this resource's preferred language is English, I will not post those links.

    2. I requested and got public static IP from my provider.

    3. Checked this IP value by www.whatismyip.com

    4. Hosted simplest site (just some static html page) on my IIS server.

    5. Forwarded port 80 on my router:
    • Configured virtual server to redirect all requests sent to my public static IP to local IP (192.168.0.133 in my case) of my PC where IIS server is running.
    • Checked my port 80 on this site. Port is open.
    • This is my virtual server configuration:
    enter image description here
    When I change Interface from <All> to WAN - port is closed
    When I add public/private port (end) 80 - port is closed
    When I change protocol to TCP/UDP - port is closed
    Server name can be any. I even wrote my domain name as server name value - the same result.
    When I set remote IP value to my public static IP - port is closed

    6. Checked IIS server by typing http://192.168.0.133/ in browser's address bar. My hosted html page displayed correctly, so server is running.

    7. Configured windows firewall to pass all incoming requests by starting firewall from command line and adding new inbound rule, as described here.
    • Tried to turn firewall off but result is still the same - could not connect, so I suggest my inbound rule configuration is fine.

    8. Turned on all windows IIS features.

    9. Got free domain name on www.noip.com.
    • Successfully pinged domain name. My public static IP was displayed.

    10. Flushed DNS cache by ipconfig /flushdns from command line.

    But, nevertheless, after all these steps I still get Could not connect to remote server error by requesting my public IP in web browser.

    P.S. There was a moment when I got my router's home page, when requested public IP, and a friend of mine also got this page. As Google said, this was some kind of port forwarding error so I think I fixed it, but now I just get could not connect error.

    WHAT AM I MISSING ???

  • Dmytro
    Dmytro about 11 years
    6. Checked IIS server by typing http://192.168.0.133/ in browser's address bar. My hosted html page displayed correctly, so server is running.
  • Dmytro
    Dmytro about 11 years
    Well, here is the funny story )))) A friend of mine tried to request my server, and he got my hosted web page... That means that everything works fine... But I still don't understand why can't I get my page via public IP, only via my local IP. I've already tried on/off trick with windows firewall, result is the same - could not connect.
  • levelnis
    levelnis about 11 years
    Have you tried flushing your DNS cache? ipconfig /flushdns
  • Dmytro
    Dmytro about 11 years
    @levelnis, yes, just tried. The same. Site is available from remote machines, but not from my own. From none of my local network machines.
  • levelnis
    levelnis about 11 years
    You haven't got anything in your hosts file that could be interfering perhaps?
  • Dmytro
    Dmytro about 11 years
    Well, I plugged Internet cable directly to PC. Port is open, site available from remote machines and my own machine by domain name, by requesting public IP I get HTTP Error 404. The requested resource is not found. So I understand the problem is in router's port forwarding settings. I edited question and added my router's virtual server configuration window screen.
  • Dmytro
    Dmytro about 11 years
    @levelnis, my hosts file is practically clean.
  • Dmytro
    Dmytro about 11 years
    I've already done that, but it doesn't fix the problem... I can't connect to any of my sites via, for example, my android tablet or phone to test and see how those pages look on these devices.
  • KJ-SRS
    KJ-SRS about 11 years
    Are those devices connected to the same network via Wifi as the server? There's not much else that can be done besides running an internal DNS server, or getting a new router.