1

I have my wordpress multisite setup in LAN network. I also setup dynamic DNS (eg. www.mysite.com) which is directed to my router's public IP (eg. 10.10.10.10). My router will port forward any request to my server's IP (eg. 192.168.0.100).

When I tried to view the wordpress site from another device in my LAN network by typing in my server's IP in the browser, the site showed up nicely. But when I tried to view the site from a device outside of my LAN network by typing in the dynamic DNS name or my router's public IP, the browser showed that there was an error. Sometimes it show timed out error and sometimes it show that a network change has been detected.

The site URL and wordpress URL was set to (http://192.168.0.100) for this example.

Is there any way I could configure so that the site could be viewed from outside the LAN network? Any solution is much appreciated.

  • FWIW, what you're trying to do is often a violation of the ISP's terms and conditions, if your network is on a regular home internet connection. – Jacob Peattie Jun 22 '19 at 4:41
  • Thanks for the reminder Jacob Peattie. I am just going an extra mile to test if hosting from home could possibly work out. – 5kyl1ght Jun 22 '19 at 6:05
  • I suspect that a private site, while technically in violation of home-level ISP TOS, would not be an issue. ISPs just want more money to provide a static IP (whicy you can get around). But as long as you are using the local site as a personal/private server, you should be OK with a home-level ISP plan. IMHO. – Rick Hellewell Jun 23 '19 at 21:32
  • Noted with thanks – 5kyl1ght Jun 24 '19 at 14:05
0

You need to set up port forwarding on your router.

So when you go to your public-facing IP address (say it's 204.122.30.5, use a "what's my IP" site, or check your router's info page), you'll want to set up incoming port xxxx to forward to your local server (in your case 192.168.0.100).

Once you get it set up, if you go to http://204.122.30.5:xxxx (your public-facing address plus the port number you set up for port forwarding), you should be able to get to your local site from the outside. For the 'xxxx' number, choose a four-digit value that is random.

Be aware that there are some security risks involved in allowing outside access to your home network. There are things you can do to mitigate those risks. Lots of googles/bings/ducks can help you out with that and port forwarding. Your router's manufacturer's support pages will also help with setting up port forwarding.

| improve this answer | |
  • Hi Rick Hellewell, thanks for the explanation. I have done port-forwarding, but I still cannot access the wordpress site from external network. I have setup virtual host in the file 'httpd-vhosts.conf'. So now I have a wordpress site and one non-wordpress site built with html and css. When I access the non-wordpress site by typing in my router's public IP, the site show up. But when I access wordpress site, it could not show up. I could not figure out the problem. – 5kyl1ght Jun 22 '19 at 7:16
  • When you access from the outside, you have to add the port number to the IP address of your public IP. Like the link in the 2nd paragraph of my answer, adjusted for your numbers. The router port forwarding you set up should take that xxxx port number and router it to the internal IP of your WP site. If the internal IP of the WP needs a port other than 80 or 443, then you need to 'tell' the port forwarding settings about that non-standard internal port. – Rick Hellewell Jun 22 '19 at 18:06
  • Hi Rick Hellewell, I have got the solution to the problem faced. I have changed the port number (port forwarded) and eventually found out that port number is not the real problem so I decided to use back the default port 80. It was caused by other factors and I have written an answer post below. Thanks for the help. – 5kyl1ght Jun 23 '19 at 19:28
  • Glad you found the solution. Although I don't see why a multisite can't use a non-port-80 address. Perhaps you needed to specify the port number in addition to the IP in the wp-options table entry for the site(s). And a static page should work as well, as long as you can PING the IP+port, and the IP+port is set up in wp-options table. A checkmark for my answer is always appreciated. – Rick Hellewell Jun 23 '19 at 21:31
  • Maybe it could work because I do not try addressing non-default (other than 80) port on multisite but only tested for wordpress single site. – 5kyl1ght Jun 24 '19 at 14:00
0

Yay, I can now view the site from outside LAN network. The workaround was that I re-installed wordpress and do not run it on multisite because somehow the multisite wordpress cannot be accessed outside LAN network. Wordpress also cannot setup with a static page and a post page as it cannot loads up the site too from outside LAN network. If it can, it does not show up the page as requested.

As for dynamic DNS, I register with a new domain and it works fine.

As for port forwarding, I port forwarded port 80 (default port) and it works well.

By the way, thanks Rick Hellewell for providing the solution on port-forwarding. I am sure port forwarding for other non-default port would work too. Cheers!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.