Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Self Hosted WebApi Accessible over LAN

Very new to the Self Host WebApi, but I am very impressed with its ease of use and extendability. At least through this tutorial. Everything I've done so far works on my development machine whether I use localhost, 127.0.0.1, or my LAN Ip (192.168.0.x) but I am baffled why I can't access the service from any other computer even others in the same subnet.

In short after going through the tutorial on the machine where it is running: Browsing to

localhost:3636/api/products/ 

results in the expected xml return. On another machine on the LAN browsing to:

192.168.0.x:3636/api/products/ 

results in a timeout Data points for those who might know how this all interacts:

1.) My dev machine(192.168.0.x, server, host whatever you want to call it) has IIS on it; I was so paranoid it was in the way that I stopped it via the Administration GUI

2.) I have reserved the URL/Port with the following command line executions:

    >netsh http add urlacl url=http://+:3636/ user=DOMAIN\USER listen=yes delegate=yes
    >netsh http add urlacl url=http://192.168.0.x:3636/ user=DOMAIN\USER listen=yes delegate=yes

2.b) I've tried both of those together and individually, and tried changing the user to "everyone" to no avail

3.) I have tried to change the code in the tutorial to set the

    config.HostNameComparisonMode = HostNameComparisonMode.Exact //default is Strong Wildcard 

4.) I can successfully ping and tracert to 192.168.0.x from other machines on the LAN

5.) A friend recommended I setup a TCPListener and ensure I could telnet to that to eliminate the firewall as a possibility. If that logic is sound, the firewall isn't the problem

EDIT: Thanks for your help, here's another data point that I believe confirms it's not a firewall issue. I previously posted this connection when behind a rather obtuse (at least to a non Certified guy like me) Juniper Firewall/Router. I have since redone the tutorial on another machine (without IIS) on my home network and still cannot publish the service to other computers within my LAN. Any ideas?

like image 867
David Avatar asked May 31 '13 23:05

David


1 Answers

Well it wasn't the hardware firewall, it was the windows firewall! yikes i wasted a bunch of time on that. Once I turned off the windows firewall (the code runs in an intranet anyway) everything worked.

Anyone know of a good site that explains how firewalls and wireshark interact; or i suppose that just has to be one's first test.

like image 179
David Avatar answered Jan 02 '23 20:01

David