0

I'm trying to connect a custom device on my LAN from the internet. There seem to be a bunch of guides on how to do this, but they all seem to be missing a step, and I can't seem to figure out what it is.

My setup: I have a device (raspberry pi) running on my LAN. It has a static IP 192.168.1.134. I can access a web page on the pi from my LAN through http://192.168.1.134/webpage.html. I have a router and a DSL modem. The router has a known IP address (23.X.Y.Z).

On the router, I've setup a NAT entry to forward anything with port 80 to 192.168.1.134. (When doing this, the router's website complained that it was moving it's external web site to port 8080...). As soon as I do, I seem to loose connectivity to the internet from the PC on my LAN. I tried accessing my website from 23.X.Y.Z/webpage.html, and that does not seem to work either. I'm wondering if anyone could suggest how I might go about this?

1 Answer 1

1

You have to separate 2 different things that happen here:

  1. When doing this, the router's website complained that it was moving it's external web site to port 8080

    This is happening because if port 80 is being forwarded to another client (ie the Raspberry Pi) it can't be used as the port that the router's management server listens for connection on, therefore it is changing its own port to 8080. From now on, when you would like to access your router's management page you have to use http://<router's LAN address>:8080. This can be probably avoided using PAT but it is a bit more advanced.

  2. I tried accessing my website from 23.X.Y.Z/webpage.html

    Most consumer-grade routers don't support "loopback", meaning you can't use your external IP address in order to access your LAN from inside the LAN itself. In order to test the availability of the web server on your Raspberry Pi you will have to access it from another network, for example your phone while connected to the cellular network.

Either way, the internet access from your PC shouldn't be affected after forwarding a port to the Raspberry Pi.

5
  • For 1 -- it only changes the WAN side, so I can still access the web page from 192.168.1.1 from the LAN without specifying the port. For 2, that's exactly what I did. I disabled my cell-phone's wifi, and attempted to access the web page from the cellular network. It does not seem to work... Jul 11, 2016 at 11:48
  • Perhaps I'm doing port forwarding wrong then. From my modem's web page, I did Advanced-Settings -> NAT -> Add, and added an entry: servername:"pi",External Port Start: 80, External Port End:80, Protocol TCP, Internal Port Start/End: 80, Server IP address: 192.168.134... It sounds like it should have worked, but as soon as I enable the entry, web access from my PC seems to fail. (disabling it restores the connection) Jul 11, 2016 at 11:55
  • @user2766918 Then there is something else going on. You should first verify that the port is forwarded correctly in the router. Verify that you chose TCP and not UDP. Also some routers require a reboot after changing these settings. It will be best to verify all these (maybe even with a screenshot) before pulling the heavy guns out :)
    – DeepSpace
    Jul 11, 2016 at 11:56
  • @user2766918 You should forward the port in the router, not the modem. When you forward the port in the router you should not lose internet access.
    – DeepSpace
    Jul 11, 2016 at 11:57
  • Sorry, typo -- yes, the forwarding is done through the router. Jul 11, 2016 at 11:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .