kaszanka
kaszanka

Reputation: 21

Connect to webserver from outside LAN raspberry pi 3 windowsiot

I ran a tutorial including HTTP server app for raspberry pi 3. Link here: https://incredibits.io/project/windows-10-iot-internet-of-things-tips/windows-10-iot-raspberry-pi-web-server

In my local network everything works perfectly. I run server, type in browser local IP of my raspberry (192.168.x.x) and "hello world" appears - great. But, I have an issue when i want reach my HTTP server outside from my LAN. What i did: 1. forwarded port 80 in my router 2. opened port 80 in raspberry pi with below commands in PowerShell

netsh advfirewall firewall add rule name="Open 80" dir=in action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name="Open 80" dir=out action=allow protocol=TCP localport=80
  1. checked if above commands works by typing

    netsh advfirewall firewall show rule name="Open 80"

and i get that response:


Rule Name:                            Open 80
----------------------------------------------------------------------
Enabled:                              Yes
Direction:                            Out
Profiles:                             Domain,Private,Public
Grouping:
LocalIP:                              Any
RemoteIP:                             Any
Protocol:                             TCP
LocalPort:                            80
RemotePort:                           Any
Edge traversal:                       No
Action:                               Allow

Rule Name:                            Open 80
----------------------------------------------------------------------
Enabled:                              Yes
Direction:                            In
Profiles:                             Domain,Private,Public
Grouping:
LocalIP:                              Any
RemoteIP:                             Any
Protocol:                             TCP
LocalPort:                            80
RemotePort:                           Any
Edge traversal:                       No
Action:                               Allow
Ok.
  1. checked if my port is visible as open with http://www.yougetsignal.com/tools/open-ports/ - it was CLOSED (ofcourse with server app run

  2. ran exactly the same app in my notebook (with windows 10 ofcourse). I forwarded port 80 in router into my netbook, i checked if port is open - and it was OPEN. I type my external IP into browser and it works. I even try to do it from my smartphone to be sure and it also works.

I think that is a proof that a problem is in my raspberry - its settings

Upvotes: 2

Views: 323

Answers (2)

kaszanka
kaszanka

Reputation: 21

I solved it.

The problem was in my router setup. I have two NAT options (Virtual Server Setup and Port Triggering Setup) and i had settings like below: nat options in my router and previous settings

Removing "web" setting in NAT - Port Triggering Setup solved my problem. My HTTP server running on raspberry pi became visible for outside world.

I don't know why this settings didnt block HTTP server running on laptop but this is different story. Problem with raspberry pi server - solved.

Upvotes: 0

Ian Hoppes
Ian Hoppes

Reputation: 252

Make sure you have the "Internet (Client & Server)" capability selected in your app manifest. You can find this setting by opening the Package.appxmanifest file and clicking the Capabilities tab. enter image description here

Upvotes: 0

Related Questions